Re: encoding of PostgreSQL messages - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: encoding of PostgreSQL messages
Date
Msg-id 20081231094655.GA3599@merkur.hilbert.loc
Whole thread Raw
In response to Re: encoding of PostgreSQL messages  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: encoding of PostgreSQL messages  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, Dec 29, 2008 at 09:07:14AM -0300, Alvaro Herrera wrote:

> > That would not quite be enough -- I am talking about
> > messages reported *during* auth, say
> >
> >     FATAL: password authentication failed for user "postgres"
> >
> > or
> >
> >     fe_sendauth: no password supplied
> >
> > both of which, in other locales, may contain non-ASCII characters.
>
> Those are sent in the server encoding IIRC (which admittedly you don't
> have a way to know, at that point.)
>
> And I'm now wondering if we should delay initializing the translation
> stuff until after client_encoding has been reported.

Or else

- just don't pass those messages through gettext so they are
  always in 7 bit ASCII English

- do pass them through gettext but append a 7-bit ASCII
  filter so things do get passed in pseudo ASCII (this will
  work for many singlebyte encodings but more often than
  not for multibyte ones)

Both changes would be less intrusive than postponing the
translation.

If I had a choice I would opt for the first.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: Julius Tuskenis
Date:
Subject: Re: Load Image File From PostgreSQL DB
Next
From: Tom Lane
Date:
Subject: Re: encoding of PostgreSQL messages