Forum OpenACS Q&A: Ugly characters instead of Swedish characters: å, ä, ö

I'm using Red Hat 6.1, the Pg 6.5.2 RPM package that goes with it and
AS3 beta 6.1.
My tables are getting filled with some very strange characters in
place of: å ä ö (yes Swedish letters are also strange:-).
I suspected this had something to do with locale (it's disabled by
default, I think) in Postgres...But...
If I perform an insert from a HTML form, I'm having trouble...If I do
an update from a HTML form or insert from psql it's working just
How can I enable locale when using a Pg RPM?
(The DB driver is the one delivered with as3b61.)

I hope it's OK to ask though I haven't installed ACS (yet:-).

Thankful for any hints!

Hmm, not sure at all that this will fix anything, but if you use 6.5.3 or 7.0beta, people will probably have an easier time helping you, since that's what everyone here tends to use :)
In addition to what Ben said, this is an area that's been fiddled with in various versions, including I believe in 7.0 (but I'm not sure, as I tend to take full advantage of being a native English speaker and ignore this issue :( )

You might check the hacker's group archives on, as there has been discussion of difficulties here, one advantage of an international group of developers.  There's a big gap in the archives due to a screwed-up switch to Majordomo2 but you might find some help there, and in the documentation.

I strongly suggest you switch to 7.0 if possible, so you only have to figure this out once (until 7.1 comes out, at least!)

Also, 6.5.2 has the "always bang the disk with a write+fsynch to pg_log even on read-only selects" feature, which is death to the performance of systems like the ACS, not to mention the poor disk holding the database.  6.5.3 fixes this...

I haven't had any problem with PostgreSQL and my spanish char set so far. But I have noticed the problem you are pointing out with acspg.

I dived through the code and noticed that the problem came from the line

    regsub -all ' "$string" '' result

in the DoubleApos function defined in the ad-utilities.tcl.preload file. I changed it with

        set result [string map {' ''} $string]

and now it seems to work. (??)

I tried the regsub in my tclsh interpreter and it had no problem, but it does have inside aolserver.

Hope this helps.

I have seen the same thing with german äö - my Postgres is 7.0, so that's probably not the issue. I will try Daniel's fix and see if anything changes for the better.