Replies: 1 comment 1 reply
|
If you are on Windows, then you may use: module module_name @if(env::WIN32);
import std::os::win32;
const Win32_UINT UTF8_CT_ID = 65001;
extern fn Win32_BOOL set_console_input_cp(Win32_UINT cp_id) @cname("SetConsoleCP");
extern fn Win32_BOOL set_console_output_cp(Win32_UINT cp_id) @cname("SetConsoleOutputCP");
module module_name;
import std;
fn void main(String[] args)
{
// Set UTF-8 console mode on Windows.
$if env::WIN32:
set_console_input_cp(UTF8_CT_ID);
set_console_output_cp(UTF8_CT_ID);
$endif
io::printn("Ё"); // Works fine.
} |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
All reactions