diff options
author | Bruno Haible <bruno@clisp.org> | 2001-01-10 18:25:51 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2001-01-10 18:25:51 +0000 |
commit | 304b41f21f5fc2690c960f9b53333570eae2a9dd (patch) | |
tree | 25addba6bc150cd8351668c885cdf1167797a3b5 /intl | |
parent | d88e7ad19af9cfee0564058c8d0d4dd3707bf111 (diff) | |
download | external_gettext-304b41f21f5fc2690c960f9b53333570eae2a9dd.zip external_gettext-304b41f21f5fc2690c960f9b53333570eae2a9dd.tar.gz external_gettext-304b41f21f5fc2690c960f9b53333570eae2a9dd.tar.bz2 |
Upgrade to libiconv-1.5.1.
Diffstat (limited to 'intl')
-rwxr-xr-x | intl/config.charset | 84 | ||||
-rw-r--r-- | intl/localcharset.c | 54 |
2 files changed, 110 insertions, 28 deletions
diff --git a/intl/config.charset b/intl/config.charset index 83f0b79..b1f5d41 100755 --- a/intl/config.charset +++ b/intl/config.charset @@ -31,36 +31,52 @@ # The current list of GNU canonical charset names is as follows. # # name used by which systems a MIME name? -# ASCII, ANSI_X3.4-1968 glibc solaris -# ISO-8859-1 glibc aix hpux irix osf solaris yes -# ISO-8859-2 glibc aix hpux irix solaris yes +# 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 solaris freebsd yes +# ISO-8859-3 glibc yes # ISO-8859-4 solaris yes # ISO-8859-5 glibc aix hpux irix solaris yes -# ISO-8859-6 aix hpux solaris yes +# ISO-8859-6 glibc aix hpux solaris yes # ISO-8859-7 glibc aix hpux irix osf solaris yes # ISO-8859-8 glibc aix hpux solaris yes # ISO-8859-9 glibc aix hpux irix osf solaris yes # ISO-8859-13 glibc -# ISO-8859-15 aix solaris -# KOI8-R glibc solaris yes +# ISO-8859-15 glibc aix solaris freebsd +# KOI8-R glibc solaris freebsd yes # KOI8-U glibc yes # CP850 aix osf # CP856 aix +# CP866 freebsd +# CP874 win32 # CP922 aix -# CP932 aix +# CP932 aix win32 # CP943 aix +# CP949 win32 +# CP950 win32 # CP1046 aix # CP1124 aix # CP1129 aix -# CP1252 aix -# EUC-CN aix hpux solaris -# EUC-JP aix hpux solaris yes -# EUC-KR aix hpux solaris yes -# EUC-TW aix hpux solaris -# BIG5 aix hpux solaris yes -# GBK aix +# CP1250 win32 +# CP1251 glibc win32 +# CP1252 aix win32 +# CP1253 win32 +# CP1254 win32 +# CP1255 win32 +# CP1256 win32 +# CP1257 win32 +# GB2312 glibc aix hpux irix solaris yes +# EUC-JP glibc aix hpux irix solaris yes +# EUC-KR glibc aix hpux irix solaris yes +# EUC-TW glibc aix hpux irix solaris +# BIG5 glibc aix hpux solaris yes +# BIG5HKSCS glibc +# GBK aix win32 +# GB18030 glibc # SJIS hpux solaris -# TIS-620 aix hpux solaris +# JOHAB glibc win32 +# TIS-620 glibc aix hpux solaris +# VISCII glibc yes # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux @@ -115,7 +131,7 @@ case "$os" in echo "IBM-1124 CP1124" echo "IBM-1129 CP1129" echo "IBM-1252 CP1252" - echo "IBM-eucCN EUC-CN" + echo "IBM-eucCN GB2312" echo "IBM-eucJP EUC-JP" echo "IBM-eucKR EUC-KR" echo "IBM-eucTW EUC-TW" @@ -132,6 +148,7 @@ case "$os" in echo "iso88597 ISO-8859-7" echo "iso88598 ISO-8859-8" echo "iso88599 ISO-8859-9" + echo "iso885915 ISO-8859-15" echo "roman8 HP-ROMAN8" echo "arabic8 HP-ARABIC8" echo "greek8 HP-GREEK8" @@ -143,7 +160,7 @@ case "$os" in echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" - echo "hp15CN EUC-CN" + echo "hp15CN GB2312" #echo "ccdc ?" # what is this? echo "SJIS SJIS" echo "utf8 UTF-8" @@ -154,6 +171,10 @@ case "$os" in echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-9 ISO-8859-9" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" ;; osf*) echo "ISO8859-1 ISO-8859-1" @@ -174,7 +195,7 @@ case "$os" in echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "BIG5 BIG5" - echo "gb2312 EUC-CN" + echo "gb2312 GB2312" echo "cns11643 EUC-TW" echo "5601 EUC-KR" echo "eucJP EUC-JP" @@ -183,4 +204,31 @@ case "$os" in #echo "sun_eu_greek ?" # what is this? echo "UTF-8 UTF-8" ;; + freebsd*) + # FreeBSD 3.3 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name + # from the environment variables. + echo "C ASCII" + echo "US-ASCII ASCII" + for l in lt_LN; do + echo "$l.ASCII ASCII" + done + for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT lt_LN \ + nl_BE nl_NL no_NO pt_PT sv_SE; do + echo "$l.ISO_8859-1 ISO-8859-1" + echo "$l.DIS_8859-15 ISO-8859-15" + done + for l in hr_HR hu_HU lt_LN pl_PL sl_SI; do + echo "$l.ISO_8859-2 ISO-8859-2" + done + for l in ru_RU ru_SU; do + echo "$l.KOI8-R KOI8-R" + echo "$l.CP866 CP866" + done + ;; + beos*) + # BeOS has a single locale, and it has UTF-8 encoding. + echo "C UTF-8" + ;; esac diff --git a/intl/localcharset.c b/intl/localcharset.c index 932473c..936d93d 100644 --- a/intl/localcharset.c +++ b/intl/localcharset.c @@ -37,12 +37,22 @@ # include <stdlib.h> #endif -#if HAVE_LANGINFO_CODESET -# include <langinfo.h> -#else -# if HAVE_SETLOCALE -# include <locale.h> +#if defined _WIN32 || defined __WIN32__ +# undef WIN32 /* avoid warning on mingw32 */ +# define WIN32 +#endif + +#ifndef WIN32 +# if HAVE_LANGINFO_CODESET +# include <langinfo.h> +# else +# if HAVE_SETLOCALE +# include <locale.h> +# endif # endif +#else /* WIN32 */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> #endif #ifndef DIRECTORY_SEPARATOR @@ -73,6 +83,7 @@ get_charset_aliases () cp = charset_aliases; if (cp == NULL) { +#ifndef WIN32 FILE *fp; const char *dir = LIBDIR; const char *base = "charset.alias"; @@ -157,9 +168,20 @@ get_charset_aliases () } } - charset_aliases = cp; if (file_name != NULL) free (file_name); + +#else /* WIN32 */ + + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ + + cp = "CP936" "\0" "GBK" "\0" + "CP1361" "\0" "JOHAB" "\0"; +#endif + + charset_aliases = cp; } return cp; @@ -180,19 +202,21 @@ locale_charset () const char *codeset; const char *aliases; -#if HAVE_LANGINFO_CODESET +#ifndef WIN32 + +# if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); -#else +# else /* On old systems which lack it, use setlocale and getenv. */ const char *locale = NULL; -# if HAVE_SETLOCALE +# if HAVE_SETLOCALE locale = setlocale (LC_CTYPE, NULL); -# endif +# endif if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_ALL"); @@ -209,6 +233,16 @@ locale_charset () through the charset.alias file. */ codeset = locale; +# endif + +#else /* WIN32 */ + + static char buf[2 + 10 + 1]; + + /* Win32 has a function returning the locale's codepage as a number. */ + sprintf (buf, "CP%u", GetACP ()); + codeset = buf; + #endif if (codeset != NULL && codeset[0] != '\0') |