psql and Latin-2 characters

From: Nikola Milutinovic <Nikola(dot)Milutinovic(at)ev(dot)co(dot)yu>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: psql and Latin-2 characters
Date: 2002-11-27 06:26:30
Message-ID: 3DE46596.70103@ev.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.

I'm having a bit of a problem with inputting Latin-2 characters from "psql". If
I understand correctly, the way to do it is:

\encoding iso-8859-2
UPDATE consumer SET name='Nikola Milutinovi\346' WHERE id=1;

Where, '\346' is an octal sequence for "small latin S with CARON" in Latin-2
encoding. Needless to say, this is not working, the character is not OK and PHP
page that displays it shows nothing.

To make sure that (PgSQL --> PHP --> Apache --> Browser) path is working as it
should I have tested this using Java, a small Java program that just does the
update with all Latin-2 characters interesting to me, and it works. Thsi is the
code snippet for those who are interested.

String newTest = "\u0110 \u0111 \u0160 \u0161 \u010C \u010D \u0106 \u0107 \u017D
\u017E";
st = conn.createStatement();
st.executeUpdate( "UPDATE consumer SET name='" + newTest + "' WHERE id=1" );

This sets name to 5 tuplets (small and capital) of Latin-2 characters: "D
SLASH", "S CARON", "C CARON", "C ACSAN", "Z CARON". The database is UNICODE encoded.

QUESTION
--------

Whats, the deal with "psql"?

Having had troubles with coding (wrong code numbers), I have tripple-checked the
code values, even in PgSQL source - that octal code of Latin-2 is mapped to
UTF-8 code for that particular letter. Could it be that my problem is influenced
by the settings of my LOCALE (Tru64 UNIX 4.0D, LOCALE="C" - in other words
"Generic")?

Is there anything else I could, short of debugging the whole thing?

Nix.

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2002-11-27 06:31:29 Re: 7.3RC2 install woes
Previous Message Jean-Christian Imbeault 2002-11-27 06:21:51 7.3RC2 createlang error