From: Esteban I. Ruiz Moreno Date: Wed, 5 Jun 2013 01:14:31 +0000 (-0300) Subject: Add basic unicode support to the console (linux workaround) X-Git-Tag: 0.4.8~394^2~20 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=93dfc3ec70007ab684ef71487081f0335eae0635;p=oweals%2Fminetest.git Add basic unicode support to the console (linux workaround) --- diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index c1219fb80..daec18efc 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -550,7 +550,13 @@ bool GUIChatConsole::OnEvent(const SEvent& event) } else if(event.KeyInput.Char != 0 && !event.KeyInput.Control) { - m_chat_backend->getPrompt().input(event.KeyInput.Char); + #if (defined(linux) || defined(__linux)) + wchar_t wc = L'_'; + mbtowc( &wc, (char *) &event.KeyInput.Char, sizeof(event.KeyInput.Char) ); + m_chat_backend->getPrompt().input(wc); + #else + m_chat_backend->getPrompt().input(event.KeyInput.Char); + #endif return true; } }