Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9450: fstream open utf8 filename fails x86_64-w64-mingw32
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-14 09:27:17
#9450: fstream open utf8 filename fails x86_64-w64-mingw32
-------------------------------+------------------------
Reporter: spoo@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------
Comment (by spoo@â¦):
Here's a WINEDBG=+relay trace snip for a working example using _wopen:
{{{
0024:Call msvcrt._wfopen(00404012 L"\6e90\5c4b.txt",0040400c L"rb")
ret=00401532
0024:Call KERNEL32.CreateFileW(00404012
L"\6e90\5c4b.txt",80000000,00000003,0032f950,ffffffff00000003,00000080,00000000)
ret=7fa609f2952b
0024:Ret KERNEL32.CreateFileW() retval=0000004c ret=7fa609f2952b
0024:Ret msvcrt._wfopen() retval=7fa60a1a0c60 ret=00401532
}}}
Here's the trace snip for the broken example with boost (fstream.cxx):
{{{
0024:Call msvcrt.fopen(00049628 "\xe6\xba\x90\xe5\xb1\x8b.txt",004d0778
"r") ret=00486efb
0024:Call ntdll.RtlAllocateHeap(00010000,00000000,00000016)
ret=7f3fa25e446c
0024:Ret ntdll.RtlAllocateHeap() retval=00049740 ret=7f3fa25e446c
0024:Call KERNEL32.MultiByteToWideChar(00000000,00000001,00049628
"\xe6\xba\x90\xe5\xb1\x8b.txt",0000000b,00049740,0000000b)
ret=7f3fa25cd130
0024:Ret KERNEL32.MultiByteToWideChar() retval=0000000b ret=7f3fa25cd130
0024:Call ntdll.RtlAllocateHeap(00010000,00000000,00000004)
ret=7f3fa25e446c
0024:Ret ntdll.RtlAllocateHeap() retval=000435d0 ret=7f3fa25e446c
0024:Call KERNEL32.MultiByteToWideChar(00000000,00000001,004d0778
"r",00000002,000435d0,00000002) ret=7f3fa25cd130
0024:Ret KERNEL32.MultiByteToWideChar() retval=00000002 ret=7f3fa25cd130
0024:Call KERNEL32.CreateFileW(00049740
L"\00e6\00ba\0090\00e5\00b1\2039.txt",80000000,00000003,0032f4c0,00000003,00000080,00000000)
ret=7f3fa25dc52b
0024:Ret KERNEL32.CreateFileW() retval=ffffffffffffffff ret=7f3fa25dc52b
0024:Call ntdll.RtlFreeHeap(00010000,00000000,00049740) ret=7f3fa25e058f
0024:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7f3fa25e058f
0024:Call ntdll.RtlFreeHeap(00010000,00000000,000435d0) ret=7f3fa25e0597
0024:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7f3fa25e0597
0024:Ret msvcrt.fopen() retval=00000000 ret=00486efb
}}}
I'm not sure what the call equivalencies are but I think that's all from
the second example. If I had to hazard a guess, it looks like the problem
might be that it's not converting the string to wide characters and using
the corresponding msvcrt call.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9450#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC