You are not logged in.
Hello,
I have a windows executable that asks for your username & password and launches a web browser to let you enter a website if the credentials are correct. This is a text-only program and it launches it self in a console in Windows. When I tried to run it using Wine on Arch, all the messages (written in Chinese) are displayed as garbage characters. I looked up Wine's documentation but the procedures only work for applications running with a GUI. I already have Chinese fonts installed on my Arch system and symlinked it into the C:/windows/Fonts folder in the Wine prefix, but it doesn't seem to work. Any ideas?
Thanks!
Offline
Maybe a screenshot of the "garbage" would be a good idea.
Does it run in your VTE or does it open a cmd.exe window? If the former, try launching the latter and execute it there.
Offline
These are the characters printed by the program when I ran it:
Z:\mnt\tsinsen>TsinsenLogin
╟δ╩Σ╚δ╙├╗º├√ú║
╟δ╩Σ╚δ├▄┬δú║
╒²╘┌╡╟┬╝ú¼╟δ╔╘║≥...
┤φ╬≤ú¼═°┬τ┴¼╜╙┤φ╬≤íú
Press any key to continue...
I typed "wine cmd.exe" and it gave me a DOS terminal, running inside the original urxvt window. I guess it is still running inside my VTE? It doesn't launch a new graphical window.
Offline
That's UTF-16.
I'ev no idea how smart wine/cmd.exe would be on translating this, but am afraid it's not going to work this way either.
wineconsole cmd
might do (should spawn a windows TE)
Offline
Yes "wineconsole cmd" does spawn a separate cmd.exe window.
I tried to run wineconsole with "LC_ALL=zh_CN.utf8". It made the window title into Chinese instead of English, but it didn't affect the cmd.exe running inside it.
Offline
It wouldn't help you anyway - you need something that renders UTF-16, not some utf-8 locale (where the locale only controls the language)
No POSIX shell will do that (because UTF-16 isn't ASCII compatible), so your best hope is that some windows program (or the wineconsole) does.
You can convert those strings using eg. inconv, but it's not designed to "tap" into a programs output. And idk of an exisiting wrapper lib to be preloaded to provide such feature.
Offline
Hey,
How do you know that these characters are UTF-16? Is there a software that judges this?
I tried this to convert the characters to UTF-8 (original.txt contained the characters):
iconv -f UTF-16 -t UTF-8 original.txt > output.txt
But it just gave me more garbage characters that looks like a combination of Korean, and Chinese:
鿎듢閩캣髎듢閙鳢閗슺鳢袚쎺鄊
Am I supposed to convert it into UTF-8?
Offline
Because windows operates on utf16 and instead of graphics elements ascii, you at least end up in the asian character set.
Your paste looks more like UTF-16BE (big endian) than UTF-16LE (little endian, windows default - I assume there's no BOM available)
Edit: that said, GB18030 produces chinese as well. I assume you can read that and infer what makes sense and what does not?
translate.google.com says the first token, "鈺熚粹暕危鈺毼粹暀鈹溾晽潞鈹溾垰煤", means "Nazi endangered pure coal" …
Last edited by seth (2018-07-23 14:59:46)
Offline
I asked around on the wine forums & IRC channel but it seems like that nobody knows the solution. They suggested me to file a bug report at wine.
Originally I thought there must be a simple fix to this issue, but it seems like that it's quite complicated
Offline
Hey,
After a bit more googling, I found this page on StackOverflow which describes how the font encodings work in cmd.exe:
https://stackoverflow.com/questions/125 … -exe-using
However it seems like the cmd.exe implementation inside Wine does not support the "chcp" command, so I can't change the encoding to UTF-8....
Last edited by Unturned (2018-08-05 01:46:26)
Offline