From 2a10f72366cac65a0e9ade665a10729b28d381fc Mon Sep 17 00:00:00 2001 From: MouriNaruto Date: Sat, 17 Feb 2024 16:27:08 +0800 Subject: [PATCH] Add optional workaround for users who wants UTF-8 console output for LvglWindowsSimulator project. (Suggested by jinsc123654.) --- LvglWindowsSimulator/LvglWindowsSimulator.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/LvglWindowsSimulator/LvglWindowsSimulator.cpp b/LvglWindowsSimulator/LvglWindowsSimulator.cpp index 80134b3..6a36094 100644 --- a/LvglWindowsSimulator/LvglWindowsSimulator.cpp +++ b/LvglWindowsSimulator/LvglWindowsSimulator.cpp @@ -10,6 +10,17 @@ int main() { lv_init(); + /* + * Optional workaround for users who wants UTF-8 console output. + * If you don't want that behavior can comment them out. + * + * Suggested by jinsc123654. + */ +#if LV_TXT_ENC == LV_TXT_ENC_UTF8 + SetConsoleCP(CP_UTF8); + SetConsoleOutputCP(CP_UTF8); +#endif + int32_t zoom_level = 100; bool allow_dpi_override = false; bool simulator_mode = true;