From 0962e33a558312c1d004a2eff666312a78be7b7b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 13 Feb 2020 20:29:34 +1100 Subject: [PATCH] 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. --- src/Window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Window.c b/src/Window.c index 9315a5964..512702015 100644 --- a/src/Window.c +++ b/src/Window.c @@ -2736,9 +2736,12 @@ static RequestClipboardCallback clipboard_func; static void* clipboard_obj; EMSCRIPTEN_KEEPALIVE void Window_GotClipboardText(char* src) { - String str = String_FromReadonly(src); + String str; char strBuffer[512]; if (!clipboard_func) return; + String_InitArray(str, strBuffer); + String_AppendUtf8(&str, src, String_CalcLen(src, 2048)); + clipboard_func(&str, clipboard_obj); clipboard_func = NULL; }