Thread: Encoding problem in psql (Windows)

Encoding problem in psql (Windows)

From
Markus Reinhold
Date:
Hej,
though there are a few posts in the mailing lists archive with similar or
the same error messages, I couldn't find a solution for my problem with psql
there. So here's my encoding issue: I'm using a fresh install of 8.1.3 on a
German Windows 2000. I have set the codepage (1252) and font (Lucida
Console) for cmd.exe as recommended by the *Notes for Windows Users* in the
man page for psql. Now after creating a database with UTF8-encoding,
switching to it via \c and trying to list all users with \du I always get
the following error message:

ERROR:  invalid UTF-8 byte sequence detected near byte 0xe4

The error persists after switching the client character set encoding to
SQL_ASCII - though I have no idea if that could be of help anyway. Now the
strange thing is that there is no such error when querying all users after
switching to the template1 database, which is in my case encoded in
SQL_ASCII (though I have read that is no encoding at all, is it?).

Another strange thing: When accessing the very same Windows server from my
Linux box and trying to list all users from its version of psql there is no
such error at all. IMHO this indicates that this has to be an issue of
Windows or the Windows version of psql...

Now my question is whether one of you has run into similar problems and
might be able to help me to solve it? Thank you very much in advance...

Regards,
Markus Reinhold