You stated the followng:
I test everything in this way:
First, I create table
CREATE TABLE names ( name varchar(20) );
Next, I insert a few names via browser (encoded in ISO8859-2) to tcl script;
The Tcl script encodes the names to UTF-8 (UNICODE) and sends them to PostgreSQL.
Then, PostgreSQL sends results of query
SELECT UPPER(name) AS fn FROM names ORDER BY fn;
(encoded in UNICODE) to the Tcl script.
The script encodes the results to ISO8859-2 and sends then to browser.
You have to be careful about what it means to submit LATIN-2
data from the browser to your AOLserver web server.
AOLserver *needs* to be told what character set your form
data is in so that it can convert it to Unicode properly.
Your browser will *not* supply this information automatically. You
set AOLserver to expect LATIN2 in the form data. There are about
five different ways to do this. See my notes at http://imode.arsdigita.com/i18n or http://www.ai.mit.edu/people/hqm/openacs
If you just want to run your site in all LATIN2, you should get
my AOLserver patches and apply them, and then make sure that
in your .ini or .tcl server config file you have the lines
ns_section "ns/parameters"
ns_param HackContentType 1
ns_param URLCharset shift_jis
ns_param OutputCharset shift_jis
ns_param HttpOpenCharset shift_jis
URLCharset is the important one. My patches to AOLserver will look
at this parameter and will use the specified encoding when
reading posted form data.
You can also explcitly call the function ns_setformencoding
before you call ns_getform.