[support] search: issues with PostgreSQL

Andreas Deininger adeininger at googlemail.com
Fri Dec 21 08:14:00 UTC 2007


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 at 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


More information about the support mailing list