Skip to content

Commit

Permalink
Add optional workaround for users who wants UTF-8 console output for …
Browse files Browse the repository at this point in the history
…LvglWindowsSimulator project. (Suggested by jinsc123654.)
  • Loading branch information
MouriNaruto committed Feb 17, 2024
1 parent c1debbf commit 564aef6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions LvglWindowsSimulator/LvglWindowsSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ int main()
{
lv_init();

int32_t zoom_level = 100;
bool allow_dpi_override = false;
bool simulator_mode = true;
/*
* 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

lv_display_t* display = lv_windows_create_display(
L"LVGL Windows Simulator Display 1",
800,
Expand Down

0 comments on commit 564aef6

Please sign in to comment.