Displaying non UTF-8 8 bit character codes with writefln()

Aziz K. aziz.kerim at gmail.com
Thu Oct 4 12:53:56 PDT 2007


Graham wrote:
> After searching back a bit further than before I see this was discussed
> in April and the answer was to use printf for the 8 bit string.
>
> something like:
>
> writef("elapsed time %.9f", elapsed_time);
> printf(" \xB5S\n");
>
> does work, but if anybody has a more elegant solution please let me know.
>
Hi,

There's a better solution. You could switch to the Tango librabry which  
uses WriteConsoleW() internally to correctly write Unicode characters on  
the Windows console.

Regards,
Aziz


More information about the Digitalmars-d-learn mailing list