diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-07-23 10:26:28 +0300 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-07-23 10:26:28 +0300 |
commit | 3c4f82b2984c0cf70b2bc61190495cf9cf1a6aad (patch) | |
tree | 54e39bcaa704c80d9ad2c99d74928f91ea50b74e /indra/llcommon/llstring.h | |
parent | f6c08d45108d713fc42786885d1d38a4b95c10ac (diff) |
EXT-8318 ADDITIONAL FIXED ensure that thousands separator is in utf8 format (on Windows) before converting it to LLWString.
Problem on Windows:
==================
LLPanelMainInventory::updateItemcountText() formats number using viewer locale.
non-break space is detected as unknown symbols while converting utf8str_to_wstring when formatted text is set to LLTextBox.
FIX:
===
Added converting of string to multi-byte string and then to utf8 string while formatting on Windows.
created opposite to "ll_convert_wide_to_string" function "ll_convert_string_to_wide" and helper function to call both of them.
It is used now to convert result of formatted string while formatting integer number in locale.
Fix affects Windows only.
Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/775/
--HG--
branch : product-engine
Diffstat (limited to 'indra/llcommon/llstring.h')
-rw-r--r-- | indra/llcommon/llstring.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 8071c8aa2d..41fac0f8cc 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -564,7 +564,20 @@ using snprintf_hack::snprintf; * * This replaces the unsafe W2A macro from ATL. */ -LL_COMMON_API std::string ll_convert_wide_to_string(const wchar_t* in); +LL_COMMON_API std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page); + +/** + * Converts a string to wide string. + * + * It will allocate memory for result string with "new []". Don't forget to release it with "delete []". + */ +LL_COMMON_API wchar_t* ll_convert_string_to_wide(const std::string& in, unsigned int code_page); + +/** + * Converts incoming string into urf8 string + * + */ +LL_COMMON_API std::string ll_convert_string_to_utf8_string(const std::string& in); //@} #endif // LL_WINDOWS |