Forum OpenACS Q&A: Yet a charset problem!

Collapse
Posted by Claudio Pasolini on
I'm ready to deploy a couple of applications and so I need to solve the well known problem of garbage characters generated when using non US characters. After reading almost all the threads about the internationalization issue I installed the patch #44 of Jonathan Marsden on my RPM based ACS-3.2.5 (thank you Jonathan!) but I got this error after restarting AOL:
[24/Nov/2001:16:46:16][11720.4101][-conn0-] Notice: Error processing 
file /var/lib/aolserver/servers/acs/www/index.tcl NONE no value given 
for parameter "[list" to "ReturnHeaders"
    while executing
"ReturnHeaders "
    ("uplevel" body line 17)
    invoked from within
"uplevel 1 $code"
    (procedure "source_with_encoding" line 11)
    invoked from within
"source_with_encoding $ad_conn(file)"
Any ideas?
Claudio Pasolini
Collapse
Posted by David Kuczek on
Hello Claudio,

I had the same problem just yesterday:

https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0003Je&topic_id=11&topic=OpenACS

I want to run nsd8x instead of nsd76 and my site is using German characters.

To understand the full range of this problem, here a link from the aolserver mailing list:

http://www.mail-archive.com/aolserver%40listserv.aol.com/msg01669.html

Here some steps that I took. They might help you...

1.) Switched from AOLserver3.4 to AOLserver-3.3.1+ad13

http://www.arsdigita.com/acs-repository/older

2.) updated my aolserver nsd.tcl file like Harry Minski told to in:

https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0002YI&topic_id=11&topic=OpenACS

Read Jonathan Marsdens last response to the upper thread telling me about problems with ns_write and that those problems don't occur with ns_return....

So I tested ns_return and voila works, tested ns_write: Unluckily he's right... German characters are displayed correctly with ns_return, but not with ns_write... so I applied the patch #44 and got the same error that you got!!!

Finally I read through Tilmann Singer's post on the following thread:

https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0000oi&topic_id=11&topic=OpenACS

and know that he has everything up and running now, although he manually had to patch ad+12, which you don't have to do with ad+13 anymore!

I decided to put that effort on hold, because openacs 4.x will fully be .adp and not a problem concerning iso-8859-1 anymore (I hope)...

Collapse
Posted by Claudio Pasolini on
David,
I already tried the solution proposed by W. Winkler in this thread but it didn't work on my RedHat 7.1 + AOLserver/3.2+ad12 + PostgreSQL 7.1 + OpenACS 3.2.5 combo and so I'm hopefully trying with Jonathan's patch.
Collapse
Posted by Henry Minsky on
If you are using ns_write, then you need to first tell AOLserver
explicitly what character encoding to convert to. You do this using the aolserver command ns_startcontent. It takes either a MIME type
or the name of an encoding (I forget whether it uses the Tcl encoding names or the MIME encoding names, i.e., shiftjis vs shift_jis). You need to call this before any output has been written, I think, including output headers maybe.

Anyway, it's not rocket science -- it's just a real pain in the
neck trying to figure out what code is setting the output encoding where.

I think a goal ought to be

1)  to make sure that OpenACS ships
'out of the box' supporting ISO-8859-1 (latin-1) properly. If it is
not doing that now, we should definitely look into it.

2) The next goal should be that we should have things parameterized so that it is easy to throw one global "switch" and
set the entire site to a single other character set (i.e., tcl and adp files can be authored in that charset and normal pages will be
output in that charset).

Beyond that, supporting multiple character sets simultaneously is
a hard problem, but if the first two goals are met, then supporting
multiple encodings will probably be easier to hack.

Collapse
Posted by Claudio Pasolini on
Henry,
I think that it would be great to have an OpenACS ISO-8859-1 compliant out-of-the-box!
For now I'm already using ns_startcontent and the browser output is correct, but I don't know how to get input form's data into TCL variables without chars being corrupted. I tried Jonathan's patch #44 but after some initial problem I discovered that my version of AOLserver doesn't support the ns_setformencoding proc and so I stopped the testing.