Re: invalid UTF-8 via pl/perl

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: invalid UTF-8 via pl/perl
Дата
Msg-id D3E7DCCB-9ACE-4D02-B684-594BF0B61529@kineticode.com
обсуждение исходный текст
Ответ на Re: invalid UTF-8 via pl/perl  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: invalid UTF-8 via pl/perl  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Jan 3, 2010, at 11:54 AM, Andrew Dunstan wrote:

> There are two issues with this patch. First, how far if at all should it be backpatched? All the way, or 8.3, where
wetightened the encoding rules, or not at all? 

8.3 seems reasonable.

> Second, It produces errors like this:
>
>   andrew=# select 'a' || invalid_utf_seq() || 'b';
>   ERROR:  invalid byte sequence for encoding "UTF8": 0xd0
>   HINT:  This error can also happen if the byte sequence does not
>   match the encoding expected by the server, which is controlled by
>   "client_encoding".
>   CONTEXT:  PL/Perl function "invalid_utf_seq"
>   andrew=#
>
>
> That hint seems rather misleading. I'm not sure what we can do about it though. If we set the noError param on
pg_verifymbstr()we would miss the error message that actually identified the bad data, so that doesn't seem like a good
plan.

I'm sure I'm just revealing my ignorance here, but how is the hint misleading?

Best,

David



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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: PATCH: Add hstore_to_json()
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: invalid UTF-8 via pl/perl