Re: Bug with UTF-8 character - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Bug with UTF-8 character
Date
Msg-id 20060526134833.GC27513@svana.org
Whole thread Raw
In response to Bug with UTF-8 character  (Hans-Jürgen Schönig <postgres@cybertec.at>)
Responses Re: Bug with UTF-8 character
List 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 by date:

Previous
From: "Gurjeet Singh"
Date:
Subject: Re: max(*)
Next
From: "Marko Kreen"
Date:
Subject: Re: Bug with UTF-8 character