Evening,
On Thu 17 Mar 2011 19:38, Mike Gran <[email protected]> writes:
> So, if have a CGI script where the stdout could have one
> a couple of different encodings based on a web client's language
> preference settings, but, where the CGI program is running in a "C"
> or "en_US.utf8" locale, this might count.
The thing is that we need to be giving the C library strings encoded in
the current locale, not the locale of any particular port, because
that's how library functions will decode the strings internally -- take
the regexec case, for example, recently fixed.
I think that if the CGI script wants to read or write in a particular
locale, either you set the LC_ALL/LC_CTYPE vars, do a setlocale in the
Guile script, or set the encoding on a port. But that's port encodings,
not something related to scm_{to/from}_locale_string, I don't think...
Of course, in the CGI context, the encoding of any _environment
variables_ is another thorny question, but not one that should depend on
port encodings.
Regards,
Andy
--
http://wingolog.org/