alire
alire copied to clipboard
Encoding problem in Windows 10
Reported by Henrik Hârkônen on gitter:
Hello all! I just noticed one "thing" when using Alire on Windows 10 for the first time. I created a new project with alr init --lib command and then it asked me stuff, like my name. And because my name is unfortunate to not contain only the ascii-7bit characters, reading the alire.toml when starting alr edit for example, fails to a "invalid UTF-8 encoding at" error. I was using the windows cmd -shell. I edited with VSCode the ä and ö characters to proper ones and then it worked, but I was wondering what caused this. Is the cmd shell reading the input as cp1252 and that get's written to the toml, or how does this go?
Here's the "alr -vv -d edit" command's output trace and config.toml from my @HOMEDIR.config\alire\ folder.
Thanks, @heharkon.
I think it depends on region, but UTF-8 support on Windows is still in beta, but can be enabled. I don't have this enabled and it defaults to IBM437 as described in a progress_indicators ticket. I suspect the console input needs to be set with SetConsoleCP
to an more appropriate code page (like CP_UTF8). @heharkon , what does chcp
say when you run it in console?
Hi!
It says:
C:\Users\hehar>chcp Active code page: 850