[plt-scheme] Changing current locale's encoding

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Aug 9 21:35:50 EDT 2006

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.


Posted on the users mailing list.