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

From MauMau
Subject Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII
Date
Msg-id 75B586D4B6684564BA4D69BC938FAE3E@maumau
Whole thread Raw
In response to Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
From: "Greg Stark" <stark@mit.edu>
> Wait, why does the ctype of the database affect the ctype of the
> messages? Shouldn't these be two separate things? One describes the
> character set being used to store data in the database and the other
> the character set the log file and clients are in.


At session start, PostgreSQL sets the ctype of the database to be the 
process's LC_CTYPE locale category in src/backend/utils/init/postinit.c:
ctype = NameStr(dbform->datctype);
...if (pg_perm_setlocale(LC_CTYPE, ctype) == NULL)

The LC_CTYPE locale category determines the character encoding for messages 
obtained by gettext().  This is gettext()'s specification.


Regards
MauMau




pgsql-hackers by date:

Previous
From: "MauMau"
Date:
Subject: Re: [bug fix] strerror() returns ??? in a UTF-8/C database withLC_MESSAGES=non-ASCII
Next
From: Robert Haas
Date:
Subject: Re: strange IS NULL behaviour