1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Use utf-8 for the Irrlicht clipboard (#11538)

This commit is contained in:
DS 2021-08-23 14:09:50 +02:00 committed by GitHub
parent fad835cf64
commit dad87a360b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 11 deletions

View file

@ -338,7 +338,7 @@ void GUIChatConsole::drawText()
false,
false,
&AbsoluteClippingRect);
} else
} else
#endif
{
// Otherwise use standard text
@ -580,8 +580,7 @@ bool GUIChatConsole::OnEvent(const SEvent& event)
const c8 *text = os_operator->getTextFromClipboard();
if (!text)
return true;
std::basic_string<unsigned char> str((const unsigned char*)text);
prompt.input(std::wstring(str.begin(), str.end()));
prompt.input(utf8_to_wide(text));
return true;
}
else if(event.KeyInput.Key == KEY_KEY_X && event.KeyInput.Control)