Re: Bug with UTF-8 character

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Bug with UTF-8 character
Дата
Msg-id 20060526134833.GC27513@svana.org
обсуждение исходный текст
Ответ на Bug with UTF-8 character  (Hans-Jürgen Schönig <postgres@cybertec.at>)
Ответы Re: Bug with UTF-8 character  ("Marko Kreen" <markokr@gmail.com>)
Список pgsql-hackers
On Fri, May 26, 2006 at 08:21:56AM +0200, Hans-Jürgen Schönig wrote:
> good morning,
>
> I got a bug request for the following unicode character in PostgreSQL
> 8.1.4: 0xedaeb8
>
> ERROR:  invalid byte sequence for encoding "UTF8": 0xedaeb8
>
> This one seemed to work properly in PostgreSQL 8.0.3.
>
> I think the following code in postgreSQL 814 has a bug in it.
>
> File: postgresql-8.1.4/src/backend/utils/mb/wchar.c

Your character converts to char DBB8. According to the standard,
characters in the range D800-DFFF are not characters but surrogates.
They don't mean anything by themselves and are thus rejected by
postgres.

http://www.unicode.org/faq/utf_bom.html#30

This character should be preceded by a low surrogate (D800-DBFF). You
should combine the two into a single 4-byte UTF-8 character.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

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

Предыдущее
От: "Gurjeet Singh"
Дата:
Сообщение: Re: max(*)
Следующее
От: "Marko Kreen"
Дата:
Сообщение: Re: Bug with UTF-8 character