Page 1 of 1

Winbox encoding error when launched from windows command promt

Posted: Fri Jun 01, 2018 10:08 am
by atillaeyice
Hello im trying to add add an addon to my radius server so i can just tab and winbox to their account but the problem is that when passing arguments whit comand promt i get this output.

username and passwords for users containing Turkish characters "ş Ş " when command prompt passes that to winbox they appear as "ÅŸ" i have tried to change command prompt Code Page (chcp) to 857 still same issue i tested whit chrome whit giving url in turkish they work but when i pass the arguments to winbox from command prompt same issue. also it happens at dude to it gives same output to dude.
c:/winbox.exe 0.0.0.0 ş ş appears ÅŸ ÅŸ

Re: Winbox encoding error when launched from windows command promt

Posted: Sat Jun 02, 2018 1:38 am
by Sob
It's way too soon for national characters in usernames and passwords. Personally I'm waiting until at least 2050, before I dare to try anything like that. There are still too many programs that can't handle it.

In this case it's WinBox (and anything from MikroTik), it doesn't support Unicode, only whatever 8-bit code page the system has, and actually not even that. Anything over basic 7-bit ascii is just a sequence of bytes. If you enter it using WinBox, it displays fine in WinBox on same system. But it's not consistent even with WebFig.

What you see suggests that system passes your special characters to WinBox as Unicode, so two bytes instead of one, and WinBox sees them like that. Even changing codepage using chcp doesn't seem to do anything. I don't know if it's system passing Unicode parameters no matter what, or if WinBox (clearly not caring about codepages at all) reads them wrong.

Re: Winbox encoding error when launched from windows command promt

Posted: Sat Jun 02, 2018 3:37 am
by BRMateus2
Even all programming languages that I know do use tricks to make Unicode work, because the Unicode specification is very hard to understand and implement literally how it is specified without many performance constraints. Command prompt as I know, only supports ASCII specifications with ISO-8859 ("ANSI"), even through Windows 10 supports UTF-16 at the kernel level.

So don't use special characters, likely never, outside special message strings.