diff --git a/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/nel/src/3d/driver/direct3d/driver_direct3d.cpp index bb954ba4d..f26a37afb 100644 --- a/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1265,9 +1265,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l return 0; } +#ifdef WM_UNICHAR // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar if (message == WM_UNICHAR) return (wParam == UNICODE_NOCHAR); +#endif return DefWindowProcW(hWnd, message, wParam, lParam); } diff --git a/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/nel/src/3d/driver/opengl/driver_opengl_window.cpp index dc48ecbf0..a987b7425 100644 --- a/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -183,9 +183,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l return 0; } +#ifdef WM_UNICHAR // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar if (message == WM_UNICHAR) return (wParam == UNICODE_NOCHAR); +#endif return trapMessage ? 0 : DefWindowProcW(hWnd, message, wParam, lParam); } diff --git a/nel/src/gui/view_text.cpp b/nel/src/gui/view_text.cpp index d8552f153..c39460c9a 100644 --- a/nel/src/gui/view_text.cpp +++ b/nel/src/gui/view_text.cpp @@ -119,9 +119,11 @@ namespace NLGUI // - "_" that should be the character with the lowest part // - A with an accent for the highest part // https://www.compart.com/en/unicode/U+00C4 - _FontSizingChars = { (u32char)'_', 0x000000C4 }; + static const u32char chars[] = { (u32char)'_', 0x000000C4, 0 }; + _FontSizingChars = chars; // fallback if SizingChars are not supported by font - _FontSizingFallback = { (u32char)'|' }; + static const u32char fallback[] = { (u32char)'|', 0 }; + _FontSizingFallback = fallback; computeFontSize (); } @@ -954,13 +956,15 @@ namespace NLGUI } // "_Ä" lowest/highest chars (underscore, A+diaeresis) - _FontSizingChars = { (u32char)'_', 0x000000C4 }; + static const u32char chars[] = { (u32char)'_', 0x000000C4, 0 }; + _FontSizingChars = chars; prop = (char*) xmlGetProp( cur, (xmlChar*)"sizing_chars" ); if (prop) _FontSizingChars = CUtfStringView((const char*)prop).toUtf32(); // fallback if SizingChars are not supported by font - _FontSizingFallback = { (u32char)'|' }; + static const u32char fallback[] = { (u32char)'|', 0 }; + _FontSizingFallback = fallback; prop = (char*) xmlGetProp( cur, (xmlChar*)"sizing_fallback" ); if (prop) _FontSizingFallback = CUtfStringView((const char*)prop).toUtf32(); @@ -2199,7 +2203,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; @@ -2226,7 +2230,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) diff --git a/nel/src/misc/inter_window_msg_queue.cpp b/nel/src/misc/inter_window_msg_queue.cpp index ead2565a4..74c34b281 100644 --- a/nel/src/misc/inter_window_msg_queue.cpp +++ b/nel/src/misc/inter_window_msg_queue.cpp @@ -459,9 +459,11 @@ namespace NLMISC { return handleWMCopyData(hwnd, (COPYDATASTRUCT *) lParam); } +#ifdef WM_UNICHAR // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar if (uMsg == WM_UNICHAR) return (wParam == UNICODE_NOCHAR); +#endif return DefWindowProc(hwnd, uMsg, wParam, lParam); } diff --git a/nel/src/misc/win_event_emitter.cpp b/nel/src/misc/win_event_emitter.cpp index 0d370cffc..8788bab7b 100644 --- a/nel/src/misc/win_event_emitter.cpp +++ b/nel/src/misc/win_event_emitter.cpp @@ -162,6 +162,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); } break; +#ifdef WM_UNICHAR case WM_UNICHAR: if (wParam != UNICODE_NOCHAR && _KeyboardEventsEnabled) { @@ -170,11 +171,15 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA server->postEvent (new CEventChar ((u32char)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); } break; +#endif case WM_CHAR: if (_KeyboardEventsEnabled) { //if (wParam < KeyCount) //nlinfo("WM_CHAR with %u", wParam); +#ifndef WM_UNICHAR + // FIXME: Combine UTF-16 pairs +#endif server->postEvent (new CEventChar ((ucchar)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); } break; diff --git a/ryzom/tools/client/client_config_qt/src/general_settings_widget.cpp b/ryzom/tools/client/client_config_qt/src/general_settings_widget.cpp index f38e5299b..6bb81f70f 100644 --- a/ryzom/tools/client/client_config_qt/src/general_settings_widget.cpp +++ b/ryzom/tools/client/client_config_qt/src/general_settings_widget.cpp @@ -42,13 +42,13 @@ void CGeneralSettingsWidget::load() CSystem &s = CSystem::GetInstance(); std::vector codes = NLMISC::CI18N::getLanguageCodes(); - std::vector names = NLMISC::CI18N::getLanguageNames(); + std::vector names = NLMISC::CI18N::getLanguageNames(); languageComboBox->clear(); for(uint i = 0; i < codes.size(); ++i) { - languageComboBox->addItem(QString::fromUtf16(names[i].c_str()), QString::fromUtf8(codes[i].c_str())); + languageComboBox->addItem(QString::fromUtf8(names[i].c_str()), QString::fromUtf8(codes[i].c_str())); } sint32 cbIndex = getIndexForLanguageCode( QString::fromUtf8( s.config.getString( "LanguageCode" ).c_str() ) );