umka-lang icon indicating copy to clipboard operation
umka-lang copied to clipboard

`scanf` doesn't support UTF-8 on Windows

Open vtereshkov opened this issue 1 year ago • 5 comments

The C runtime on Windows supports UTF-8 in printf(), but not in scanf():

scanf doesn't currently support input from a UNICODE stream.

(https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/scanf-scanf-l-wscanf-wscanf-l?view=msvc-170)

~printf() example~:

fn main() {
   s := "Привет, мир!"
   printf("%s\n", s)
}
C:\Users\vtere\Desktop\umka-lang\umka_windows_mingw>umka.exe ..\test.um
╨Я╤А╨╕╨▓╨╡╤В, ╨╝╨╕╤А!

Split from #108.

vtereshkov avatar Feb 24 '24 13:02 vtereshkov