http://bugs.winehq.org/show_bug.cgi?id=16994
Summary: widechartomultibyte not converting properly Product: Wine Version: 1.0.1 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: lkcl@lkcl.net
Created an attachment (id=18786) --> (http://bugs.winehq.org/attachment.cgi?id=18786) wchar to multibyte test case
(sorry, yes i know this is wine 1.0.1 i'm in the middle of compiling 1.1.13, will update when it finishes).
this is from the python regression tests, the test is test_pep272.py, relevant section here:
filenames = [ #'abc', #u'ascii', #u'Gr\xfc\xdf-Gott', u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2',
u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', u'\u306b\u307d\u3093', u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u66e8\u66e9\u66eb', u'\u66e8\u05e9\u3093\u0434\u0393\xdf', ]
for name in filenames: print "about to open" f = open(name, 'w') f.write((name+'\n').encode("utf-8")) f.close()
the relevant trace showing the problem is here:
0009:Call msvcrt._wfopen(0060fe60 L"\03b5\0393\03ac\03b9\033c-\03c2\03b1",00403000 L"w") ret=00401353 0009:Call KERNEL32.WideCharToMultiByte(00000000,00000000,0060fe60 L"\03b5\0393\03ac\03b9\033c-\03c2\03b1",00000008,00116df0,00000008,00000000,00000000) ret=7ee14352 0009:trace:nls:WideCharToMultiByte cp 0 L"\03b5\0393\03ac\03b9\033c-\03c2\03b1" -> "?????-??", ret = 8
test case attached.
http://bugs.winehq.org/show_bug.cgi?id=16994
--- Comment #1 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-18 05:41:54 --- p.s. - again, if you use native MSVCRT.DLL, it works absolutely fine.
http://bugs.winehq.org/show_bug.cgi?id=16994
--- Comment #2 from Hans Leidekker hans@meelstraat.net 2009-01-18 06:22:30 --- Created an attachment (id=18789) --> (http://bugs.winehq.org/attachment.cgi?id=18789) msvcrt: Unwrap wide open functions.
The problem is the wide versions of the open functions are implemented on top of their ansi cousins, which entails a lossy conversion.
Can you try this patch?
http://bugs.winehq.org/show_bug.cgi?id=16994
--- Comment #3 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-18 07:18:41 --- that works _great_!
http://bugs.winehq.org/show_bug.cgi?id=16994
--- Comment #4 from Luke Kenneth Casson Leighton lkcl@lkcl.net 2009-01-18 07:20:36 --- lkcl@gonzalez:~/src/python2.5-2.5.2$ ./python.exe Lib/test/test_pep277.py test_directory (__main__.UnicodeFileTests) ... u'\xdf-\u66e8\u66e9\u66eb' ok test_failures (__main__.UnicodeFileTests) ... ok test_listdir (__main__.UnicodeFileTests) ... [u'Gr\xfc\xdf-Gott', u'abc', u'ascii', u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2', u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435', u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1', u'\u306b\u307d\u3093', u'\u66e8\u05e9\u3093\u0434\u0393\xdf', u'\u66e8\u66e9\u66eb'] ok test_open (__main__.UnicodeFileTests) ... ok test_rename (__main__.UnicodeFileTests) ... ok
---------------------------------------------------------------------- Ran 5 tests in 0.070s
OK
WHA-HEEEEEY :)
http://bugs.winehq.org/show_bug.cgi?id=16994
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, testcase
http://bugs.winehq.org/show_bug.cgi?id=16994
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2009-01-19 10:55:21 --- Hans's patch was committed.
http://bugs.winehq.org/show_bug.cgi?id=16994
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2009-01-30 11:05:03 --- Closing bugs fixed in 1.1.14.