Hi,
I'm running drupal 5.5 with PostgreSQL 8.2.5 on a windows box.
I enabled the search module form core and in general, the search works. However as soon as I enter a string with umlauts into the search field (e.g. "Bär"), I'm getting a bunch of error messages which are all more or less like:
warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0xe47220 HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". in D:\Websites\Stiegele\includes\database.pgsql.inc on line 125. user warning: query: SELECT src FROM url_alias WHERE dst = 'de/search/node/B�r ' in D:\Websites\Stiegele\includes\database.pgsql.inc on line 144.
The pg_client_encoding of my PostgreSQL database is set to UTF-8, I just checked this with "select pg_client_encoding();". The charset of my web pages is uft-8, too: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Any advice on how to get rid of these errors is appreciated.
Regards Andreas
Hi,
with help of a post from Bill Moran (which never got to the list AFAICS) I was able to track down the problem a little bit:
The encoding of my drupal database is UTF-8 (that's also what the drupal installation instructions tell), and the client encoding is set to utf8 also. As soon as I change the client encoding to latin1 (e.g. via the environment variable PGCLIENTENCODING), I don't get the database error messages that I've posted any more. However, the search is still not working properly (meaning the characters I typed into the search input field do not appear correct in the search input field that is repeated in the search result screen). So setting the client encoding to latin1 does not seem to be an appropriate action to me. Also after setting the client encoding to latin1, all umlauts in my node texts are displayed incorrectly (the page header tells that the charset is utf-8, and I don't want to change that).
The strange thing is, I have a drupal installation with PostgreSQL running on a linux box, and everything is fine there, including the search. So it seems to be the issue is related to the windows environment.
Any help is appreciated.
Regards Andreas
2007/12/19, Andreas Deininger adeininger@googlemail.com:
Hi,
I'm running drupal 5.5 with PostgreSQL 8.2.5 on a windows box.
I enabled the search module form core and in general, the search works. However as soon as I enter a string with umlauts into the search field (e.g. "Bär"), I'm getting a bunch of error messages which are all more or less like:
warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0xe47220 HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". in D:\Websites\Stiegele\includes\database.pgsql.inc on line 125. user warning: query: SELECT src FROM url_alias WHERE dst = 'de/search/node/B�r ' in D:\Websites\Stiegele\includes\database.pgsql.inc on line 144.
The pg_client_encoding of my PostgreSQL database is set to UTF-8, I just checked this with "select pg_client_encoding();". The charset of my web pages is uft-8, too:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Any advice on how to get rid of these errors is appreciated.
Regards Andreas
On Fri, 21 Dec 2007 09:14:00 +0100 "Andreas Deininger" adeininger@googlemail.com wrote:
The strange thing is, I have a drupal installation with PostgreSQL running on a linux box, and everything is fine there, including the search. So it seems to be the issue is related to the windows environment.
Any help is appreciated.
Could it be a browser problem that doesn't choose the correct encoding for sending the form? Did you check the server configuration on Windows?
Can I forward your email to the pgsql list?
2007/12/21, Ivan Sergio Borgonovo mail@webthatworks.it:
On Fri, 21 Dec 2007 09:14:00 +0100 "Andreas Deininger" adeininger@googlemail.com wrote:
The strange thing is, I have a drupal installation with PostgreSQL running on a linux box, and everything is fine there, including the search. So it seems to be the issue is related to the windows environment.
Any help is appreciated.
Could it be a browser problem that doesn't choose the correct encoding for sending the form? Did you check the server configuration on Windows?
Yes indeed, it's the server configuration that is causing the trouble. More specifically, I'm running IIS 6 and I'm using the ISAPI_REWRITE 3 filter from Helicon in order to get clean URLs. As soon as I disable "Clean URLs", the search works fine. So this is certainly not an issue of drupal and also not of PostgreSQL like I assumed first, but from the filter used.
Thanks for bringing me on the right track, I'll investigate that further by checking the rewrite configuration now. If anyone has a solution for that already or any tip, that is appreciated of course.
Can I forward your email to the pgsql list?
Thanks for the offer, but I think there is no need for that any more.
Regards Andreas