Hi, I use a LAMP stack of debian/apache/mod_perl/postgresql on a primary and backup server. Both servers use fr_FR@euro as default locale, and host two mod_perl applications that connect to a database. App1 connects to a LATIN9 encoded database, App2 to a UTF8 one; each serves the appropriate content_type. The problem happens on the backup server : after a pg_restore, the data in App2 is not recognized as UTF8 encoded, and is not properly displayed in web browsers (garbled characters).
Setting client_encoding has no effect (in postgresql configuration, or at connection time). Using pg_enable_utf8 => 1 has no effect and is deprecated anyhow. Tried all combinations of setting PGCLIENT_ENCODING before and after dump/restore. Dump of database yields a utf-8 file. I've copied all configuration files from the primary to the backup, both run the same current Debian stable version and packages. Both primary and backup servers have the same 'locale -a' output. The only thing that works on the backup server is to change my handlers to output an ISO-8859 ( eq to LATIN9 ) content_type. So they seem to think the database is LATIN9 encoded. I found this difference in the configuration : Primary server has in 'cat /etc/default/locale' LANG=fr_FR@euro LANGUAGE=fr_FR:fr while backup server has : LANG=fr_FR@euro Rebuilding on a server using UTF-8 by default works fine for both apps cat /etc/default/locale LANG=fr_FR.UTF-8 What should I look at to debug this and understand why my connection does not get the right encoding on the backup server? -- Salutations, Vincent Veyron http://marica.fr/ Gestion des contentieux, des dossiers de sinistres assurance et des contrats pour le service juridique