Re: invalidly encoded strings

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: invalidly encoded strings
Дата
Msg-id 20070912.124356.41631070.t-ishii@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: invalidly encoded strings  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
> However ISTM we would also need something like
> 
> length(bytea, name) returns int
>     -- counts the number of characters assuming that the bytea is in
>     -- the given encoding
> 
> Hmm, I wonder if counting chars is consistent regardless of the
> encoding the string is in.  To me it sounds like it should, in which
> case it works to convert to the DB encoding and count chars there.

Not necessarily.

It's possible that after encoding conversion, number of chars are
different before and after. An example is, UTF-8 and EUC_JIS_2004.

0xa4f7(EUC_JIS_2004) <--> U+304B *and* U+309A (Unicode)

This is defined in the Japanese goverment's standard.
--
Tatsuo Ishii
SRA OSS, Inc. Japan


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

Предыдущее
От: "Brendan Jurd"
Дата:
Сообщение: Re: Per-function search_path => per-function GUC settings
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CVS HEAD is broken by flex