locales, unicode and ansi with msvcrt (bug 8022)

Ann & Jason Edmeades us at edmeades.me.uk
Sun Apr 15 16:14:59 CDT 2007

>My current plan, unless you have strong objections, is to make the wprintf
>msvcrt routines use WideCharToMultiByte on the string into the GetACP
>codepage before being written out, and add file tests for this into the
>msvcrt testsuite

OK, A bit more testing and a bit more research starts to help...

    f1 = fopen("text.file", "w+t"); fwprintf(f1, L"hello\n"); fclose(f1);
    f2 = fopen("binary.file", "w+b"); fwprintf(f1, L"hello\n"); fclose(f2);

In this case text.file comes out in multibyte (single byte in my case), and
binary.file comes out in Unicode. So I think the answer is to see whether
the stream we are writing to is binary or text and only convert if text.
This is on the assumption that the stdhandles are opened in text mode. Next
problem is to see how to tell :-)

I'm also guessing relay and snoop cant see internal dll calls, so that might
explain the lack of calls. Perhaps something like wcstombs would be the key
to this


More information about the wine-devel mailing list