Okay I have everything but one thing working now. The only thing that doesn't really work is displaying pictures that are saved in the database as a blob...
What I did:
1.) Installed aolserver 3.3.1ad13
2.) Put the following lines in nsd.tcl
ns_section "ns/parameters"
ns_param HackContentType true
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=iso-8859-1"
ns_param ".tcl" "text/html; charset=iso-8859-1"
ns_param ".htm" "text/html; charset=iso-8859-1"
ns_param ".adp" "text/plain; charset=iso-8859-1"
ns_param ".txt" "text/plain; charset=iso-8859-1"
3.) Put the following line in /home/aolserver/modules/tcl/init.tcl
encoding system [ns_config ns/server/[ns_info server] SystemEncoding iso8859-1]
4.) Replaced line 291 /home/aolserver/modules/tcl/form.tcl with the following line:
ns_set put $form $name [encoding convertfrom iso8859-1 $value]
5.) Added the following line to the proc ReturnHeaders in tcl/ad-utilities.tcl.preload:
ns_startcontent -charset "iso-8859-1"
6.) Compiled Postgres 7.1.3 with:
./configure --enable-locale --enable-recode --enable-multibyte --enable-unicode-conversion --with-maxbackends=64 --with-tcl --with-perl --with-openssl --with-CXX --enable-syslog
7.) Initialized Postgres with:
initdb -E unicode
8.) Created my database with:
createdb mydb
(you don't have to use "-E unicode" anymore, because you initialized PG with "-E unicode")
9.) Added this to /etc/profile:
PGCLIENTENCODING='UNICODE'
export PGCLIENTENCODING
10.) Here comes the sun now:
After I imported my old database (sql-ascii) I would see all the special characters displayed correctly in my browser. When I checked i.e. the users table in my database with "psql mydb" everything would display correctly, too!!!
After I changed some data from the users table with my browser and checked my database with "psql mydb" again, the newly updated line would show corrupted characters, while the untouched lines would display correctly!!!
Keep calm. Everything went technically correct. What I did then:
10.1.) Typed the following in my shell:
PGCLIENTENCODING='Latin1' ; export PGCLIENTENCODING
10.2.) Reentered my database:
psql mydb
The new line was displayed correctly this time, while PG had the following problem with lines that contained *imported* special characters:
ERROR: Could not convert UTF-8 to ISO8859-1
--------------------------------------------------------------------
Questions:
1.) Do I have to import my old database in a special way that this last ERROR doesn't show?
2.) What can I do about the blog pictures not being displayed?
Thanks to Marcin and Henry so far!!!