Hi Jason,
While preparing tests I found the 'user' backend of wineconsole works with WriteConsole/WriteFile correct (see test1 and test2), so I used it as etal.
I figured out the main issue with cmd: It passes strings to WriteFile in ANSI, but should in OEM.
I think the main locale issue is found. CMD and XCOPY violate this. So it is not MSVCRT bug. Moreover, [w]fprintf MUST NOT perform any AnsiToOem convertions (as test3 and test4 show).
I made and attached a quick hack to demostrate that cmd was buggy. Attached screenshots show the difference. The patch heals almost everything, even localized filenames. So I'm CC'ing mail to wine-devel, console/cmd gurus must know much more ;-)
I found some issues with wprintf, see README for test3 and test4. The attached tests are made with your patch applied.
What about running cmd without console, I think it is not a good idea - we must check locale and enconding, thus we must perform various convertions: to utf8, to cp1251, to koi8-r... Or just we must set correct value of console_[input|output]_codepage variables? Does windows console supports UTF8 as output codepage?
Given I don't know russian, is there any chance of writing me a short program which uses _wfopen, fwprintf, fclose to create me a file with a name and contents which are russian text, so I can test some of the cmd.exe issues reported with NLS chars.
Could I also have:
- Output from 'chcp' in a windows command prompt
c:>chcp "Текущая кодовая страница: 866" ["Current codepage: 866"]
- screen shot of 'dir' in a windows command prompt after running the
program so I know what characters I am expecting 3. Details of the LANG env var, and details of the xterm (I run Mandrake, and have Settings->Font and Settings->Encoding options which seem like the way to tailor what appears
LANG=ru_RU.KOI8-R xterm -fn koi10x20
Hopefully I can take the program and run it under wine, and see what filename it creates, then work out why DIR doesn't display it correctly. I am almost certain its because the wine cmd.exe program is converting in the wrong codepage somehow. I want to do an exercise of unicoding wine's cmd once I finish work on the commands I have left to do (mostly copy, for and attrib)
I suspect your winegcc issues are use of the L"unicode string" from my example at a guess, but to be honest I don't know
I've already figured out it: I should pass option "-mno-cygwin" to winegcc. It makes winegcc link against msvcrt.dll instead of glibc.
Thanks a lot for working upon this bug! -- Kirill