diff --git a/source/terml.cpp b/source/terml.cpp index 5dffd2e..ad420c3 100644 --- a/source/terml.cpp +++ b/source/terml.cpp @@ -242,7 +242,7 @@ void terml::setup_buffer() void terml::set_console_settings() { setvbuf(stdout, nullptr, _IOFBF, BUFSIZ * BUFSIZ); - printf(ALT_BUF() HIDE_CURSOR()); + printf(ALT_BUF() HIDE_CURSOR() 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"