I think I've figured it out - thanks all for your help. Craig Ringer appears
to be right.
From documentation for psql 9.1 under Usage>Connecting to a database
"If at least one of standard input or standard output are a terminal, then
psql sets the client encoding to "auto", which will detect the appropriate
client encoding from the locale settings (LC_CTYPE environment variable on
Unix systems). If this doesn't work out as expected, the client encoding can
be overridden using the environment variable PGCLIENTENCODING."
This is not in 9.0 documentation, so I think is new? Anyway, that explains
the difference in behaviour between 9.0 and 9.1
So...I've altered runpsql.bat to include these lines at the beginning:
REM change terminal to UTF8
chcp 65001
and added an environment variable PGCLIENTENCODING=UTF8
Now I can connect to the LATIN1 database without any problems (postgres
automatically converts between UTF8 and LATIN1 - "Character set conversion
between server and client"
http://www.postgresql.org/docs/9.1/static/multibyte.html)
Please, does anyone know if I am likely to cause myself problems running the
terminal with the UTF8 codepage?
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-6246-character-encoding-for-64-bit-tp4888531p4902202.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.