summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-08-03 20:55:36 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-08-03 20:59:21 +0300
commit6afefa31df7947ad5d1c35d4d2d564a6521ff0f5 (patch)
tree21caef6d03617cb0825125e4f0346a9d67b6d856 /indra
parentcc25193af9a64f36a75f401160f5757498f3e5fc (diff)
SL-13691 wstring index was used for normal string
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpreviewscript.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 7a68d1e270..9a79ab2fd1 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -736,7 +736,10 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
}
if (immediate || (mLiveHelpTimer.getStarted() && mLiveHelpTimer.getElapsedTimeF32() > LIVE_HELP_REFRESH_TIME))
{
- std::string help_string = mEditor->getText().substr(segment->getStart(), segment->getEnd() - segment->getStart());
+ // Use Wtext since segment's start/end are made for wstring and will
+ // result in a shift for case of multi-byte symbols inside std::string.
+ LLWString segment_text = mEditor->getWText().substr(segment->getStart(), segment->getEnd() - segment->getStart());
+ std::string help_string = wstring_to_utf8str(segment_text);
setHelpPage(help_string);
mLiveHelpTimer.stop();
}