Unicode -> Windows 1252

Stewart Gordon smjg_1998 at yahoo.com
Fri Mar 18 17:15:34 PDT 2011


On 16/03/2011 22:17, Tom wrote:
> I have a D2 code that writes some stuff to the screen (usually runs in cmd.exe
> pseudo-console). When I print spanish characters they show wrong (gibberish symbols and
> so, wich corresponds to CP-1252 encoding).
>
> Is there a way to convert all outputted streams to CP-1252 without having to wrap writeln
> function (and replacing all its calls)?

My utility library has a console I/O module that converts to/from the console codepage 
under Windows:
http://pr.stewartsplace.org.uk/d/sutil/
See if it's useful to you.  I'm not sure whether it works under D2, but it's probably 
quite straightforward to tweak it so that it does.

Stewart.


More information about the Digitalmars-d-learn mailing list