Re: Implementing full UTF-8 support (aka supporting 0x00) - Mailing list pgsql-hackers

From Geoff Winkless
Subject Re: Implementing full UTF-8 support (aka supporting 0x00)
Date
Msg-id CAEzk6feZ3PcQhSPEitH-5_QuQNGq4FjkXiEO8+ocRQmVtj7Mig@mail.gmail.com
Whole thread Raw
In response to Re: Implementing full UTF-8 support (aka supporting 0x00)  (Álvaro Hernández Tortosa <aht@8kdata.com>)
Responses Re: Implementing full UTF-8 support (aka supporting 0x00)  (Álvaro Hernández Tortosa <aht@8kdata.com>)
List pgsql-hackers
On 3 August 2016 at 20:36, Álvaro Hernández Tortosa <aht@8kdata.com> wrote:
>     Isn't the correct syntax something like:
>
> select E'\uc080', U&'\c080';
>
> ?
>
>     It is a single character, 16 bit unicode sequence (see
> https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html).

No, what you've done there is created the three-byte utf8 sequence \xec8280

# select U&'\c080'::bytea; bytea
----------\xec8280

It's not a UCS2 c080, it's utf8 c080.

Geoff



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Implementing full UTF-8 support (aka supporting 0x00)
Next
From: Andres Freund
Date:
Subject: Re: Optimizing numeric SUM() aggregate