psql and Latin-2 characters
От | Nikola Milutinovic |
---|---|
Тема | psql and Latin-2 characters |
Дата | |
Msg-id | 3DE46596.70103@ev.co.yu обсуждение исходный текст |
Список | 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.
В списке pgsql-general по дате отправления: