On Wed, Mar 28, 2012 at 10:06 AM, Ruben Van Boxem
<vanboxem.ru...@gmail.com> wrote:
> 2012/3/28 Earnie Boyd <ear...@users.sourceforge.net>
>>
>> On Wed, Mar 28, 2012 at 8:28 AM, Jim Michaels <jmich...@yahoo.com> wrote:
>> >
>> >  they tabled it for C++11. which I thought wasn't too bright.  maybe it
>> > was
>> > someone who used the windows cmd shell and never figured out he could
>> > switch
>> > from raster font to"lucida console".
>> >
>>
>> It has nothing to do with C++11, it is about Microsoft and their
>> desires to want you using the Windows API instead of the C runtime.
>> And Ruben's sample code was C and not C++ specific although he stated
>> the C++ API exhibited the same results.
>
>
> Although I share your sentiments wrt to a bad C runtime implementation on
> Windows, this is strictly not forbidden by the Standard. It just happens
> that the *nix wprintf family converts the wchar_t's to UTF-8, which is
> supported by the regular char printf's. The Standards only state that an
> implementation defined conversion happens, which happens to be a conversion
> to the local ANSI codepage on Windows. Conclusion: it's the C/C++ wchar_t
> output functionality that is broken, not the Windows implementation of it.
> Programs relying on any "right" conversion to be happening there are relying
> on implementation defined behavior and thus are not portable by design.
>
> I know, it sucks, and it surprised me too.
>

Yea, well, Microsoft has some peculiar extensions to the C runtime
that aren't exactly ANSI compatible either.  You might try the
_wprintf_l() API to specify a locale but based on MSDN wprintf()
should print the UTF-8 character.  You should be able to use printf()
with a %C format specifier to print the UTF-8 character and that
doesn't work either.  I was using 4.6.1 as delivered by mingw.org.
And you stated that you used MSVC as well and couldn't get it to work
correctly so my conclusion is that it is the runtime API that is
broken.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to