Boost logo

Boost :

Subject: Re: [boost] [gsoc] Request Feedback for Boost.Ustr Unicode String Adapter
From: Cory Nelson (phrosty_at_[hidden])
Date: 2011-08-12 15:37:07


On Tue, Aug 9, 2011 at 3:45 AM, Soares Chen Ruo Fei <crf_at_[hidden]> wrote:
> Currently Boost.Ustr provides limited support towards I/O. Due to
> portability issues I think it is very hard for Boost.Ustr alone to
> solve problems such as printing Unicode strings to the screen. In
> fact, I have no idea on how to print even raw Unicode strings onto the
> Windows terminal. (Any Windows expert knows how to solve this?)

On Windows, you can use WriteConsoleW() with
GetStdHandle(STD_OUTPUT_HANDLE). I have no clue how this will behave
if your stdlib buffers output. In VC++ specifically (2005 and up) you
can do _setmode(_fileno(stdout), _O_U16TEXT), and wprintf() and wcout
will behave properly for all Unicode text.

You still need to set the console's font to one supporting Unicode
glyphs, though.

-- 
Cory Nelson
http://int64.org

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