Fix trying to paste unicode characters in web client showing messed up characters. Match the behaviour of other platforms and just ignore unicode characters that are not in code page 437.

This commit is contained in:
UnknownShadow200 2020-02-13 20:29:34 +11:00
parent a18de8d585
commit 0962e33a55

View File

@ -2736,9 +2736,12 @@ static RequestClipboardCallback clipboard_func;
static void* clipboard_obj; static void* clipboard_obj;
EMSCRIPTEN_KEEPALIVE void Window_GotClipboardText(char* src) { EMSCRIPTEN_KEEPALIVE void Window_GotClipboardText(char* src) {
String str = String_FromReadonly(src); String str; char strBuffer[512];
if (!clipboard_func) return; if (!clipboard_func) return;
String_InitArray(str, strBuffer);
String_AppendUtf8(&str, src, String_CalcLen(src, 2048));
clipboard_func(&str, clipboard_obj); clipboard_func(&str, clipboard_obj);
clipboard_func = NULL; clipboard_func = NULL;
} }