Forum OpenACS Q&A: Response to Character Set Problem with web form input

Collapse
Posted by Henry Minsky on
If you're using ISO-8859-1, then I think things will work by default,
but make sure that your database is configured for Unicode.

/usr/local/pgsql/bin/initdb  --encoding unicode  -D /usr/local/pgsql/data

createdb --encoding=unicode yourdbname

AOLserver internally uses UTF8 to talk to postgres, so I think
this is required. You might get away with ISO-8859-1 for some
characters, but I bet you are getting screwed by the UTF-8 to ISO-8859-1 conversion.

Note that the AOLserver version we use is patched so that you
can pass an encoding to ns_getform, to tell it explicitly what
charset the form data was posted in, so that it can convert
properly to Unicode in AOLserver Tcl strings. Look in the
tcl/modules/form.tcl file to see how it works.