bug-gnu-libiconv
[Top][All Lists]
Advanced

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

Re: [bug-gnu-libiconv] [PATCH] OS/2 patches for libiconv


From: Bruno Haible
Subject: Re: [bug-gnu-libiconv] [PATCH] OS/2 patches for libiconv
Date: Sat, 4 Jun 2011 19:27:29 +0200
User-agent: KMail/1.9.9

Hi,

KO Myung-Hun wrote in
<http://lists.gnu.org/archive/html/bug-gnu-libiconv/2011-03/msg00000.html>:
> I attach OS/2 patches for libiconv.

Thank you for the patches.

> 0001-Add-EXEEXT-to-iconv_no_i18n.patch

This one is fine. It matches the recommendation by Ralf Wildenhues in
<http://lists.gnu.org/archive/html/bug-libtool/2009-04/msg00013.html>. Applied.

> 0002-If-codeset-is-not-set-by-the-user-use-a-codepage-for.patch

This one has the effect that when the user has set the environment variable
LC_ALL or LC_CTYPE or LANG to a value that contains no dot, then the program
will use the encoding from the codepage in the OS.

This is not good, because that's not how POSIX programs are supposed to
behave
(see <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html>):

- If LC_ALL, LC_CTYPE, or LANG are set to a non-empty value, this value holds.
  What localcharset.c does additionally is that it maps locale names to
  encodings. But in any case it is important that in the "C" locale the
  results don't depend on operating system settings, because users on different
  machines should get the same results.

- If LC_ALL, LC_CTYPE, LANG are not set, _then_ the program is free to use
  the settings from the operating system (see POSIX, above):
    "All implementations shall define a locale as the default locale, to
     be invoked when no environment variables are set, or set to the empty
     string. This default locale can be the POSIX locale or any other
     implementation-defined locale. Some implementations may provide
     facilities for local installation administrators to set the default
     locale, customizing it for each location."

So, if you found that localcharset did not return the encoding you expected,
then either
  - unset some environment variables, or
  - add a mapping from locale name to encoding in the file charset.alias.

Bruno
-- 
In memoriam Mordechai Gebirtig <http://en.wikipedia.org/wiki/Mordechai_Gebirtig>



reply via email to

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