From 48939df9a5ef1ff20f4f9717d1341b51a50dff14 Mon Sep 17 00:00:00 2001 From: Ekdohibs Date: Mon, 4 Apr 2016 18:31:00 +0200 Subject: Escape more strings: formspecs, item descriptions, infotexts... Also, change the escape character to the more standard \x1b Thus, it can be used in the future for translation or colored text, for example. --- src/game.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index d513517b7..23f261cfd 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3731,7 +3731,7 @@ void Game::handlePointingAtNode(GameRunData *runData, NodeMetadata *meta = map.getNodeMetadata(nodepos); if (meta) { - infotext = utf8_to_wide(meta->getString("infotext")); + infotext = unescape_enriched(utf8_to_wide(meta->getString("infotext"))); } else { MapNode n = map.getNodeNoEx(nodepos); @@ -3807,13 +3807,15 @@ void Game::handlePointingAtObject(GameRunData *runData, const v3f &player_position, bool show_debug) { - infotext = utf8_to_wide(runData->selected_object->infoText()); + infotext = unescape_enriched( + utf8_to_wide(runData->selected_object->infoText())); if (show_debug) { if (infotext != L"") { infotext += L"\n"; } - infotext += utf8_to_wide(runData->selected_object->debugInfoText()); + infotext += unescape_enriched(utf8_to_wide( + runData->selected_object->debugInfoText())); } if (input->getLeftState()) { -- cgit v1.2.3