Friday, August 15, 2008

[GENERAL] UTF8 in commandprompt (CMD) on XP fails. Tips?

Hi group,

I am trying to set up a testenvironment on my developmachine (XP Prof
SP3), using PHP as a scriptinglanguage to access Postgres (8.3).

I am working on a multilanguagal database, so I picked UTF8 as encoding
for this database.

Right now I am able to:
1) Send information (Including UTF8) from a html form to PHP.
2) Pick up the info in PHP, and insert it into Postgres
3) Get the info out of Postgres, and display it right as HTML in a
browser. (Using HTML strict and encoding UTF-8 of course).

So far so good.

My problem started with using psql.
psql complained to me it couldn't display all characters right when I
started my session.
So I changed the encoding to UTF8, using:
\encoding UTF8

Now I can query from commandline, but many UTF8 characters are displayed
wrong.
(NOT if I use a webbrowser with UTF8, but only commandline)

I read something on the net about using a different font and change my
codepage.
I did this (without succes):
1) Changed the font of the dosshell to Lucida Console
2) Gave the command chcp 65001

Now, if I give a simple SQL command, it responds with:
Not Enough Memory.

I am not sure if this is a Postgres problem or Microsoft (probably the
latter)

Anyway, Is it possible to have psql working with UTF8 in a windows
commandprompt?

TIA!

Regards,
Erwin Moller

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: