[plt-scheme] Changing current locale's encoding

From: Jefferson Heard (heard at duvel.ir.iit.edu)
Date: Wed Aug 9 22:27:49 EDT 2006

Matthew Flatt wrote:
> At Thu, 10 Aug 2006 02:59:26 +0400, Артамонов Николай wrote:
>> I have trouble with changing current locale's encoding.
> The locale story on Windows has never been clear to me. I see that
> Vista includes a lot of new support that appears to unify Unix-style
> locales with Windows code pages, so maybe this will be easier to get
> right in the future.
> In any case, MzScheme's `locale-string-encoding' currently always
> produces "UTF-8" under Windows, which certainly isn't right.
> For now, I think that MzScheme should simply assume that anything after
> "." in a locale name is an encoding name. So, if you change the locale
> to "Russian_Russia.866", then `locale-string-encoding' should return
> "866", and conversions like `bytes->string/locale' should work through
> iconv with the encoding "866". (I see that iconv recognizes both "866"
> and "cp866".)
> Is it as simple as that? Done in SVN.
> Matthew
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
I'm not sure bytes->string/locale will work if it goes through iconv on 
Windows.  I've pretty well confirmed that the iconv lib is broken under 
windows, as all my code using bytes->string/locale and bytes-converters 
works on Linux and not on Windows with everything else the same.  I 
tried the cygwin dll for iconv to no avail as well.

Posted on the users mailing list.