Re: Encoding and i18n - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Encoding and i18n
Date
Msg-id 23861.1191684918@sss.pgh.pa.us
Whole thread Raw
In response to Re: Encoding and i18n  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> So does the _() macro automatically recode it to the current server encoding?

From the gettext manual:

---

gettext not only looks up a translation in a message catalog. It also
converts the translation on the fly to the desired output character
set. This is useful if the user is working in a different character set
than the translator who created the message catalog, because it avoids
distributing variants of message catalogs which differ only in the
character set.

The output character set is, by default, the value of nl_langinfo
(CODESET), which depends on the LC_CTYPE part of the current locale. But
programs which store strings in a locale independent way (e.g. UTF-8)
can request that gettext and related functions return the translations
in that encoding, by use of the bind_textdomain_codeset function.

---

We don't currently call bind_textdomain_codeset, in part because of the
lack of portability of names for codesets.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Encoding and i18n
Next
From: Gregory Stark
Date:
Subject: Re: Encoding and i18n