From 3c4f82b2984c0cf70b2bc61190495cf9cf1a6aad Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 23 Jul 2010 10:26:28 +0300 Subject: 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 --- indra/win_crash_logger/llcrashloggerwindows.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/win_crash_logger') diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp index 2884231299..01c750487e 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.cpp +++ b/indra/win_crash_logger/llcrashloggerwindows.cpp @@ -145,7 +145,7 @@ void LLCrashLoggerWindows::ProcessCaption(HWND hWnd) TCHAR header[MAX_STRING]; std::string final; GetWindowText(hWnd, templateText, sizeof(templateText)); - final = llformat(ll_convert_wide_to_string(templateText).c_str(), gProductName.c_str()); + final = llformat(ll_convert_wide_to_string(templateText, CP_ACP).c_str(), gProductName.c_str()); ConvertLPCSTRToLPWSTR(final.c_str(), header); SetWindowText(hWnd, header); } @@ -158,7 +158,7 @@ void LLCrashLoggerWindows::ProcessDlgItemText(HWND hWnd, int nIDDlgItem) TCHAR header[MAX_STRING]; std::string final; GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText)); - final = llformat(ll_convert_wide_to_string(templateText).c_str(), gProductName.c_str()); + final = llformat(ll_convert_wide_to_string(templateText, CP_ACP).c_str(), gProductName.c_str()); ConvertLPCSTRToLPWSTR(final.c_str(), header); SetDlgItemText(hWnd, nIDDlgItem, header); } @@ -201,7 +201,7 @@ bool handle_button_click(WORD button_id) wbuffer, // pointer to buffer for text 20000 // maximum size of string ); - std::string user_text(ll_convert_wide_to_string(wbuffer)); + std::string user_text(ll_convert_wide_to_string(wbuffer, CP_ACP)); // Activate and show the window. ShowWindow(gHwndProgress, SW_SHOW); // Try doing this second to make the progress window go frontmost. -- cgit v1.2.3