Re: Problem of a server gettext message.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problem of a server gettext message.
Date: 2007-12-10 22:05:28
Message-ID: 20363.1197324328@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> When the server wants to send an error message to the client, it will
> convert them from the server to the client encoding. The English
> messages are ASCII, so this will work, because server encodings are
> required to be ASCII compatible. The result of the gettext calls,
> however, is encoded in EUC-JP, so the server will take the EUC-JP
> bytes and attempt to do a UTF-8 to SJIS conversion on them. This will
> cause a crash.

The problem here basically comes from the fact that gettext looks to
LC_CTYPE to decide what encoding it's supposed to convert to (and I
suppose it punts when LC_CTYPE = C). Does it have a way by which we
could override that, to tell it the actual DB encoding regardless
of the locale environment?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-12-10 22:16:12 Re: Release Note Changes
Previous Message Tom Lane 2007-12-10 22:02:05 Re: archive_command failures report confusing exit status