Transparent ANSI to UTF-8 conversion

Lubos Pintes lubos.pintes at gmail.com
Wed Feb 27 02:56:15 PST 2013


Hi,
I would like to transparently convert from ANSI to UTF-8 when dealing 
with text files. For example here in Slovakia, virtually every text file 
is in Windows-1250.
If someone opens a text file, he or she expects that it will work 
properly. So I suppose, that it is not feasible to tell someone "if you 
want to use my program, please convert every text to UTF-8".

To obtain the mapping from ANSI to Unicode for particular code page is 
trivial. Maybe even MultibyteToWidechar could help with this.

I however need to know how to do it "D-way". Could I define something 
like TextReader class? Or perhaps some support already exists somewhere?
Thank


More information about the Digitalmars-d-learn mailing list