using encodings other than UTF-8 - part 2

Jay Norwood jayn at io.com
Sun Oct 7 07:00:53 PDT 2007


Piotr Dworaczyk Wrote:

> > I use something like this for converting from other encodings:
> >
> > char[] readFile(char[] name) {
> >
> >         char[] file=cast(char[])std.file.read(name) ~ '\0';
> >         file=std.windows.charset.fromMBSz(cast(char*)file, 1250);
> >         return file;
> > }
> >
> > and similarly for writing:
> >         std.windows.charset.toMBSz(content, 1250);      //1250 - polish  
> > windows codepage
> >
> Thanks / Dzieki / for the code.
> 
> > But I have to agree that support for codepages should be much better  
> > (e.g. easy detecting
> > current codepage)...
> 
> Welcome to The Club :)
> 
> 
> -- 
> Using Opera Mail: http://www.opera.com/mail/

The fox tools project had a big effort to add a bunch of text codecs over the last couple of years.   Perhaps a library conversion to D would supply the support you want.

http://www.fox-toolkit.org/fox.html 





More information about the Digitalmars-d mailing list