# HG changeset patch # User Bruno Haible # Date 1036417987 0 # Node ID ed9b8c0441b52f9bafb63cc33d75d627db297464 # Parent be4a50a68d307e5c50174635ad6919c4db9a5365 Update config.charset and localcharset.c to current gettext version. diff --git a/lib/ChangeLog b/lib/ChangeLog --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,38 @@ +2002-05-09 Bruno Haible + + * config.charset: Update for newest glibc. Add canonical names + ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS. + +2002-05-09 Bruno Haible + + * localcharset.c (get_charset_aliases): Add more Windows specific + aliases. + +2002-05-08 Owen Taylor + + * config.charset: A few additions for Solaris. + +2001-12-05 Bruno Haible + + * localcharset.c (locale_charset): Don't return an empty string. + +2001-10-23 Bruno Haible + + * config.charset: msdos in uk_UA uses CP1125. + +2001-08-05 Bruno Haible + + Make it possible to build libcharset with CC=gcc CFLAGS="-x c++". + * localcharset.c (locale_charset): Declare as extern "C". + +2002-02-15 Bruno Haible + + * config.charset [msdosdjgpp]: For Russian, use CP866. + +2002-02-11 Bruno Haible + + * config.charset: Add support for NetBSD. + 2002-09-25 * strdup.c: copy from libc/string (via ../config/srclist*). diff --git a/lib/config.charset b/lib/config.charset --- a/lib/config.charset +++ b/lib/config.charset @@ -34,7 +34,7 @@ # ASCII, ANSI_X3.4-1968 glibc solaris freebsd # ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes -# ISO-8859-3 glibc yes +# ISO-8859-3 glibc solaris yes # ISO-8859-4 osf solaris freebsd yes # ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-6 glibc aix hpux solaris yes @@ -42,9 +42,11 @@ # ISO-8859-8 glibc aix hpux osf solaris yes # ISO-8859-9 glibc aix hpux irix osf solaris yes # ISO-8859-13 glibc +# ISO-8859-14 glibc # ISO-8859-15 glibc aix osf solaris freebsd # KOI8-R glibc solaris freebsd yes # KOI8-U glibc freebsd yes +# KOI8-T glibc # CP437 dos # CP775 dos # CP850 aix osf dos @@ -58,35 +60,38 @@ # CP865 dos # CP866 freebsd dos # CP869 dos -# CP874 win32 dos +# CP874 woe32 dos # CP922 aix -# CP932 aix win32 dos +# CP932 aix woe32 dos # CP943 aix -# CP949 osf win32 dos -# CP950 win32 dos +# CP949 osf woe32 dos +# CP950 woe32 dos # CP1046 aix # CP1124 aix +# CP1125 dos # CP1129 aix -# CP1250 win32 -# CP1251 glibc win32 -# CP1252 aix win32 -# CP1253 win32 -# CP1254 win32 -# CP1255 win32 -# CP1256 win32 -# CP1257 win32 +# CP1250 woe32 +# CP1251 glibc woe32 +# CP1252 aix woe32 +# CP1253 woe32 +# CP1254 woe32 +# CP1255 glibc woe32 +# CP1256 woe32 +# CP1257 woe32 # GB2312 glibc aix hpux irix solaris freebsd yes # EUC-JP glibc aix hpux irix osf solaris freebsd yes # EUC-KR glibc aix hpux irix osf solaris freebsd yes # EUC-TW glibc aix hpux irix osf solaris # BIG5 glibc aix hpux osf solaris freebsd yes -# BIG5-HKSCS glibc -# GBK aix osf win32 dos -# GB18030 glibc +# BIG5-HKSCS glibc solaris +# GBK glibc aix osf solaris woe32 dos +# GB18030 glibc solaris # SHIFT_JIS hpux osf solaris freebsd yes -# JOHAB glibc win32 +# JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII glibc yes +# TCVN5712-1 glibc +# GEORGIAN-PS glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux @@ -217,6 +222,7 @@ echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-3 ISO-8859-3" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" @@ -226,9 +232,13 @@ echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "BIG5 BIG5" + echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" + echo "GBK GBK" + echo "GB18030 GB18030" echo "cns11643 EUC-TW" echo "5601 EUC-KR" + echo "ko_KR.johap92 JOHAB" echo "eucJP EUC-JP" echo "PCK SHIFT_JIS" echo "TIS620.2533 TIS-620" @@ -272,6 +282,20 @@ echo "ja_JP.Shift_JIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; + netbsd*) + echo "646 ASCII" + echo "ISO8859-1 ISO-8859-1" + echo "ISO8859-2 ISO-8859-2" + echo "ISO8859-4 ISO-8859-4" + echo "ISO8859-5 ISO-8859-5" + echo "ISO8859-15 ISO-8859-15" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; beos*) # BeOS has a single locale, and it has UTF-8 encoding. echo "* UTF-8" @@ -286,7 +310,7 @@ echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" echo "# Juan Manuel Guerrero " - echo "# and Bruno Haible ." + echo "# and Bruno Haible ." echo "#" echo "C ASCII" # ISO-8859-1 languages @@ -396,8 +420,10 @@ echo "bg_BG CP866" # not CP855 ?? echo "mk CP866" # not CP855 ?? echo "mk_MK CP866" # not CP855 ?? - echo "ru KOI8-R" # not CP866 ?? - echo "ru_RU KOI8-R" # not CP866 ?? + echo "ru CP866" + echo "ru_RU CP866" + echo "uk CP1125" + echo "uk_UA CP1125" # ISO-8859-6 languages echo "ar CP864" echo "ar_AE CP864" diff --git a/lib/localcharset.c b/lib/localcharset.c --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Written by Bruno Haible . */ +/* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include @@ -82,6 +82,11 @@ # define getc getc_unlocked #endif +#ifdef __cplusplus +/* When compiling with "gcc -x c++", produce a function with C linkage. */ +extern "C" const char * locale_charset (void); +#endif + /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize @@ -201,7 +206,20 @@ # if defined WIN32 cp = "CP936" "\0" "GBK" "\0" - "CP1361" "\0" "JOHAB" "\0"; + "CP1361" "\0" "JOHAB" "\0" + "CP20127" "\0" "ASCII" "\0" + "CP20866" "\0" "KOI8-R" "\0" + "CP21866" "\0" "KOI8-RU" "\0" + "CP28591" "\0" "ISO-8859-1" "\0" + "CP28592" "\0" "ISO-8859-2" "\0" + "CP28593" "\0" "ISO-8859-3" "\0" + "CP28594" "\0" "ISO-8859-4" "\0" + "CP28595" "\0" "ISO-8859-5" "\0" + "CP28596" "\0" "ISO-8859-6" "\0" + "CP28597" "\0" "ISO-8859-7" "\0" + "CP28598" "\0" "ISO-8859-8" "\0" + "CP28599" "\0" "ISO-8859-9" "\0" + "CP28605" "\0" "ISO-8859-15" "\0"; # endif #endif @@ -267,7 +285,7 @@ static char buf[2 + 10 + 1]; - /* Win32 has a function returning the locale's codepage as a number. */ + /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; @@ -341,5 +359,11 @@ break; } + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + if (codeset[0] == '\0') + codeset = "ASCII"; + return codeset; }