Re: Unicode confusion

Поиск
Список
Период
Сортировка
От Ian Barwick
Тема Re: Unicode confusion
Дата
Msg-id 200305101150.29725.barwick@gmx.net
обсуждение исходный текст
Ответ на Unicode confusion  ("Chris Palmer" <chris.palmer@geneed.com>)
Список pgsql-general
On Saturday 10 May 2003 01:47, Chris Palmer wrote:
> Hello,
(...)
> According to *The Java Programming Language, Third Edition* (p. 138),
> "...you can use the escape sequence \uxxxx to encode Unicode characters,
> where each x is a hexadecimal digit...". Therefore, shouldn't I see "262f
> 0b87" in the hex editor? It seems I'm not getting the same stuff out that I
> am putting in. psql is not much help; it just shows wacky characters (4 of
> them: "â¯à®").
>
> Am I doing something wrong? Does something need to be set in the database
> or in the JDBC Connection object? Or am I just a confused monkey?

If it's any help, your code should work as expected. The hex data you see
(3F3F0A) is two question marks and an \n; I would guess Java is not able to
display the unicode characters in your environment and is replacing them with
'?'.

PostgreSQL stores Unicode internally as UTF-8, so if you view the
data with psql in a non-unicode-environment, you will probably be
seeing the UTF-8 byte values expressed in whatever 8 bit characters
your terminal uses.

Ian Barwick
barwick@gmx.net


В списке pgsql-general по дате отправления:

Предыдущее
От: Bob Wheldon
Дата:
Сообщение: Zope
Следующее
От: "Adam Siegel"
Дата:
Сообщение: realtime data inserts