Boost logo

Boost :

Subject: Re: [boost] "Best so far" for C level i/o of Unicode text with Windows console
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2011-11-03 19:14:42


[Alf P. Steinbach]
> I found that the Visual C++ implementation of the C library i/o
> generally does not support console input of international characters. It
> can deal with narrow character input from the current codepage, if that
> codepage is not UTF-8.

Changing the console's codepage isn't the right magic. See http://blogs.msdn.com/b/michkap/archive/2008/03/18/8306597.aspx

With _O_U16TEXT, VC8+ can write Unicode to the console perfectly. However, I believe that input was broken up to and including VC10, and that it's been fixed in VC11.

(I don't know about UTF-8. For reasons that are still mysterious to me, UTF-8 typically isn't handled as well as people expect it to be. Windows really really likes UTF-16 for Unicode. In practice, this is not a big deal, because UTF-8 and UTF-16 are losslessly convertible.)

Stephan T. Lavavej
Visual C++ Libraries Developer


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk