pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Bruce Momjian <bruce@momjian.us>
To: willmis@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #11550: Error messages contain not encodable characters (Latin9)
Date: Fri, 3 Oct 2014 10:21:08 +0300
Message-ID: <542E4E64.60208@vmware.com> (raw)
In-Reply-To: <20141003001519.GD20459@momjian.us>
References: <20141001200923.17171.69683@wrigleys.postgresql.org>
	<20141003001519.GD20459@momjian.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)  latest in thread

Message-ID: <542E4E64.60208@vmware.com>
Permalink:  ../542E4E64.60208@vmware.com/
Also on:    postgresql.org/message-id/542E4E64.60208@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnakangas@vmware.com, bruce@momjian.us, willmis@gmail.com
  Subject: Re: BUG #11550: Error messages contain not encodable characters (Latin9)
  In-Reply-To: <542E4E64.60208@vmware.com>
  References: <20141001200923.17171.69683@wrigleys.postgresql.org> <20141003001519.GD20459@momjian.us> <542E4E64.60208@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox