From 9ff5eee1e81357c65f7688455ab25cb64dae04f6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 29 Oct 2020 13:13:56 +0800 Subject: [PATCH] Fix --- nel/src/gui/view_text.cpp | 4 ++-- nel/src/gui/view_text_id.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nel/src/gui/view_text.cpp b/nel/src/gui/view_text.cpp index acb898d12..2f8a27d0c 100644 --- a/nel/src/gui/view_text.cpp +++ b/nel/src/gui/view_text.cpp @@ -2206,7 +2206,7 @@ namespace NLGUI if (_ClampRight) { CUtfStringView sv(_Text); - ::u32string ucStrLetter = u32string(1, (u32char)' '); + ::u32string ucStrLetter = ::u32string(1, (u32char)' '); for (CUtfStringView::iterator it(sv.begin()), end(sv.end()); it != end; ++it) { ucStrLetter[0] = *it; @@ -2233,7 +2233,7 @@ namespace NLGUI { // FIXME: Optimize reverse UTF iteration ::u32string uctext = CUtfStringView(_Text).toUtf32(); - ::u32string ucStrLetter = u32string(1, (u32char)' '); + ::u32string ucStrLetter = ::u32string(1, (u32char)' '); for (sint i = (sint)uctext.size() - 1; i >= 0; --i) { ucStrLetter[0] = uctext[i]; diff --git a/nel/src/gui/view_text_id.cpp b/nel/src/gui/view_text_id.cpp index 1f1ac5440..ea961dd2a 100644 --- a/nel/src/gui/view_text_id.cpp +++ b/nel/src/gui/view_text_id.cpp @@ -228,8 +228,12 @@ namespace NLGUI while(NLMISC::strFindReplace(result, "{ros_exit}", "")); // Modify the text? - if(_StringModifier) - _StringModifier->onReceiveTextId(ucstring::makeFromUtf8(result)); + if (_StringModifier) + { + ucstring tmp = ucstring::makeFromUtf8(result); + _StringModifier->onReceiveTextId(tmp); // FIXME: UTF-8 + result = tmp.toUtf8(); + } // Set the Text if(_IsTextFormatTaged)