Re: Encoding and i18n

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Encoding and i18n
Date: 2007-10-06 15:35:18
Message-ID: 23861.1191684918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-10-06 16:49:02 Re: Encoding and i18n
Previous Message Alvaro Herrera 2007-10-06 15:33:08 Re: Encoding and i18n