From 520f6c662534355c0a496f2323e50dd30b21be8a Mon Sep 17 00:00:00 2001 From: CPunch Date: Sat, 9 Mar 2024 16:23:41 -0600 Subject: [PATCH] linux: set console codepage to UTF8 --- source/terml.cpp | 1 + source/terml_private.h | 1 + 2 files changed, 2 insertions(+) diff --git a/source/terml.cpp b/source/terml.cpp index 5dffd2e..772476b 100644 --- a/source/terml.cpp +++ b/source/terml.cpp @@ -243,6 +243,7 @@ void terml::set_console_settings() { setvbuf(stdout, nullptr, _IOFBF, BUFSIZ * BUFSIZ); printf(ALT_BUF() HIDE_CURSOR()); + printf(SELECT_UTF8()); fflush(stdout); set_console_settings_impl(); } diff --git a/source/terml_private.h b/source/terml_private.h index 679ab0c..3e8fbc6 100644 --- a/source/terml_private.h +++ b/source/terml_private.h @@ -16,6 +16,7 @@ #define HIDE_CURSOR() CSI "?25l" #define SHOW_CURSOR() CSI "?25h" +#define SELECT_UTF8() CSI "%G" #define REPORT_CUSROR_POSITION() CSI "6n" #define CURSOR_POSITION_FORMAT() "%*1s[%u;%u"