Re: BUG #11550: Error messages contain not encodable characters (Latin9)

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: BUG #11550: Error messages contain not encodable characters (Latin9)
Дата
Msg-id 542E4E64.60208@vmware.com
обсуждение исходный текст
Ответ на Re: BUG #11550: Error messages contain not encodable characters (Latin9)  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: BUG #11550: Error messages contain not encodable characters (Latin9)
Re: BUG #11550: Error messages contain not encodable characters (Latin9)
Список pgsql-bugs
On 10/03/2014 03:15 AM, Bruce Momjian wrote:
> On Wed, Oct  1, 2014 at 08:09:23PM +0000, willmis@gmail.com wrote:
>> If we set client_encoding to Latin9 (as we are here in Germany), we get an
>> error message from PostgreSQL:
>>
>> character with byte sequence 0xe2 0x80 0x9e in encoding UTF8 has no
>> equivalent in LATIN9
>>
>> This behaviour leads to problems in tools we use like Zeos etc.
>>
>> Is there a way to change the delimiters in messages by some way?
>
> No.

Well, you could manually search & replace the .po files and run msgfmt
on them. But no, there's no easy way out.

Can we fix this? It's annoying that you can't use LATIN9 with a German
locale, as that is the most common encoding used with German, aside from
UTF-8.

In general, it's annoying that you get errors like that if you use an
encoding that can't represent all the characters in error messages. In
situations like this, it would be clearly better to transliterate the
quotation marks to " or «». Also with umlauts (äöü), it would be better
to transliterate them to ae, oe, ue, than to throw an error.

Gettext does perform translitteration, but the problem is that we first
convert the error message to the server encoding, using gettext, and
then convert from server encoding to the client encoding ourselves. It
would make more sense to let gettext convert directly to the client
encoding. We currently construct all the messages in server encoding and
convert to client encoding just before sending to the client, so
changing that would require some care to keep track which messages are
already in client encoding and which ones need conversion. But if
someone is willing to put some effort to it, it seems doable.

- Heikki

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #11550: Error messages contain not encodable characters (Latin9)
Следующее
От: Walter Willmertinger
Дата:
Сообщение: Re: BUG #11550: Error messages contain not encodable characters (Latin9)