Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII
Date
Msg-id 522E418F.5090005@gmx.net
Whole thread Raw
In response to [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII  ("MauMau" <maumau307@gmail.com>)
Responses Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII
List pgsql-hackers
On 9/6/13 9:40 AM, MauMau wrote:
> $ psql -d postgres -c "SELECT * FROM a"
> ... This outputs, in Japanese, a message meaning "could not open file
> "base/xxx/yyy": ???".
> 
> The problem is that strerror() returns "???", which hides the cause of
> the trouble.
> 
> The cause is that gettext() called by strerror() tries to convert UTF-8
> messages obtained from libc.mo to ASCII.  This is because postgres calls
> setlocale(LC_CTYPE, "C") when it connects to the database.

Does anyone know why the PostgreSQL-supplied part of the error message
does not get messed up?



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: New statistics for WAL buffer dirty writes
Next
From: Peter Eisentraut
Date:
Subject: Re: Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII