Attempting to use the "encoding" command in aolserver 3.4.2 was a failure for me. Input from a browser could be changed to utf-8, but I never could send it back to the browser (after doing any encoding/regsub/ns_dbquotevalue/etc) as iso8859-1. I COULD get it into a file using plain tcl operations (fconfigure $fp -encoding iso8859-1).
My theory is that aolserver (originally built on tcl7) doesn't really understand The Right Way to handle encodings with tcl8 and has a bad habit of converting everything back to utf-8. For instance, when I say set iso_version [encoding convertto iso8859-1 $unicode_version] and then send the $iso_version to the browser, the browser receives utf-8 stuff. I hacked up the Tcl_EncodingObjCmd and made a Tcl_EncodingCmd which uses Tcl_ExternalToUtf and Tcl_UtfToExternal instead of Tcl_ExternalToUtfDString and Tcl_UtfToExternalDString. http://www.pk67.com/aolserver/encodings.html I bound my new Tcl_EncodingCmd to "encoding2" (pretty creative name, eh?) and using this instead of the standard "encoding" (Tcl_EncodingObjCmd) I'm able to convert utf-8 to iso8859-1 and send it to a browser without it being converted back to utf-8. Clearly this is a hack. What is the status of supporting the "encoding" command in aolserver? Is this issue going to get "fixed"? Is it actually broken, or did I miss something? Thanks!