bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gettext] Add support for GETTEXTIOENCODING environment variable


From: Bruno Haible
Subject: Re: [bug-gettext] Add support for GETTEXTIOENCODING environment variable?
Date: Fri, 26 Apr 2019 01:04:07 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

Hi Michele,

Michele Locati wrote:
> The author of POEdit (Václav Slavík [1]- https://github.com/vslavik )
> wrote a really helpful patch that can be used to control the I/O
> charset encoding with an environment variable (GETTEXTIOENCODING).
> 
> This is very handy (in particular under Windows) to easily control the 
> charset.

Such a feature already exists in libintl; it's the environment variable
OUTPUT_CHARSET. I've now documented this variable through
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=4f5be6cb457f26015f8e487c3a8f13ab544b8bd3

> What about merging it directly in gettext?
> 
> See 
> https://github.com/vslavik/gettext-tools-windows/blob/v0.19.8.1/patches/gettextioencoding.patch

While changing the locale_charset() function, like you did, may be the more
correct approach - whereas OUTPUT_CHARSET currently is only considered by
the libintl functions -, I hesitate to do it like this because some outputs
are meant to go into files, and ultimately it's the programmer which should
decide which things should come out in the ANSI code page and which should come
out in the OEM code page. So, we would need to replace locale_charset with
two functions
  locale_charset()
  stdio_charset()
(similarly to what is done in Python, GNU clisp, etc.) I'm not sure this added
complexity is worth the trouble.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]