Forum OpenACS Q&A: Response to Support for multibyte: .tcl ok .adp not

Collapse
Posted by Tilmann Singer on
Still can't get the handling of POSTed german umlauts right with
nsd8x. Kenny - you say post/get in Big5 encoding works fine, can you
confirm that the posted values are correctly stored in the db - do
they look as expected when queried with psql?

The error that I experience does _not_ appear in the browser: the
umlauts will be displayed correctly, but stored as two funny
characters in the db, according to the server log and to direct
querying with psql.

Here is a list of the steps that I took - please tell me what I am
missing.

Downloaded aolserver3_2+ad12_src.tar.gz

Downloaded aolserver-ad12-japanese-patches.tgz from
http://www.ai.mit.edu/people/hqm/openacs/ and followed the
instructions in the contained README file:

applied acs-aolserver-ad12.patch

copied 8bit.enc

make, make install

applied ad12-tcl.patch to the modules/tcl directory of the compiled
aolserver

Got openacs-3.2.5.tgz from openacs.org

created a db with createdb --encoding=UNICODE and loaded the openacs
datamodel

downloaded openacs-japanese-patches from
http://www.ai.mit.edu/people/hqm/openacs/ and replaced all occurencies
of shift_jis with iso-8859-1 as well as the line on the beginning
(which will go into tcl/00-ad-preload.tcl):

encoding system shiftjis

with

encoding system iso8859-1

applied that modified patch to the freshly unpacked OpenACS 3.2.5

Set those configuration parameters in my nsd.tcl:

ns_section "ns/parameters"
    ns_param  HackContentType 1
    ns_param  URLCharset      iso-8859-1
    ns_param  OutputCharset  iso-8859-1
    ns_param  HttpOpenCharset iso-8859-1

ns_section "ns/mimetypes"
        ns_param .html "text/html; charset=iso8859-1"
        ns_param .tcl "text/html; charset=iso8859-1"
        ns_param .adp "text/html; charset=iso8859-1"

Now when I start the aolserver and do a POST that contains german
umlauts (tested with /pvt/basic-info-update-2.tcl) the umlauts will be
converted into two funny characters. They do already show up in the
server log:

[07/May/2001:19:42:55][1541.9222][-conn2-] Notice: Querying 'update users
    set first_names = 'Günther',
    last_name = 'Schmidt',
[...]

(This is an uppercase A with tilde on it followed by a quarter sign in
first_names, in case this posting gets somehow converted)

before that there is this notice in the server log:

[07/May/2001:19:42:55][1541.9222][-conn2-] Notice: ns_getform using
encoding iso8859-1 for charset iso-8859-1

I also tried changing the line $AOLSERVER/modules/tcl/init.tcl

encoding system [ns_config ns/server/[ns_info server] SystemEncoding
utf-8]

to:

encoding system [ns_config ns/server/[ns_info server] SystemEncoding
iso-8859-1]

Don't know what effect that actually has but it was mentioned
somewhere on the forum.