diff options
author | Bruno Haible <bruno@clisp.org> | 2018-05-19 17:17:32 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2018-05-20 13:16:19 +0200 |
commit | bb5cc1c59c039836699b096a27a82b0d1abee038 (patch) | |
tree | ec8ce3face8adf24fbf720d01e2f4098b1acdfec /lib/localcharset.h | |
parent | 9d70137bfec6f93a90eb77f63536dda25672152d (diff) | |
download | gnulib-bb5cc1c59c039836699b096a27a82b0d1abee038.tar.gz |
localcharset: Move mapping tables into the code.
* lib/localcharset.h: Document the GNU canonical names for character
encodings here.
* lib/localcharset.c: Don't include <fcntl.h>, <unistd.h>,
relocatable.h, configmake.h.
(O_NOFOLLOW, ISSLASH, DIRECTORY_SEPARATOR, getc, volatile): Remove
macros.
(charset_aliases): Remove variable.
(get_charset_aliases): Remove function.
(struct table_entry): New type.
(alias_table, locale_table): New constants.
(locale_charset): Use the alias_table or locale_table to get the
canonicalized encoding name.
* lib/config.charset: Remove file.
* lib/ref-add.sin: Remove file.
* lib/ref-del.sin: Remove file.
* m4/localcharset.m4 (gl_LOCALCHARSET): Don't require gl_FCNTL_O_FLAGS,
AC_CANONICAL_HOST, gl_GLIBC21. Don't check for getc_unlocked.
* modules/localcharset (Notice): Remove.
(Files): Remove config.charset, ref-add.sin, ref-del.sin, fcntl-o.m4,
glibc21.m4.
(Depends-on): Remove configmake.
(configure.ac): Define LOCALCHARSET_TESTS_ENVIRONMENT to empty.
(Makefile.am): Simplify.
* build-aux/prefix-gnulib-mk: Remove special code for the removed files.
Diffstat (limited to 'lib/localcharset.h')
-rw-r--r-- | lib/localcharset.h | 96 |
1 files changed, 95 insertions, 1 deletions
diff --git a/lib/localcharset.h b/lib/localcharset.h index 917e473e8b..56d5aaa176 100644 --- a/lib/localcharset.h +++ b/lib/localcharset.h @@ -25,12 +25,106 @@ extern "C" { /* Determine the current locale's character encoding, and canonicalize it - into one of the canonical names listed in config.charset. + into one of the canonical names listed below. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ extern const char * locale_charset (void); +/* About GNU canonical names for character encodings: + + Every canonical name must be supported by GNU libiconv. Support by GNU libc + is also desirable. + + The name is case insensitive. Usually an upper case MIME charset name is + preferred. + + The current list of these GNU canonical names is: + + name MIME? used by which systems + (darwin = Mac OS X, windows = native Windows) + + ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin + ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-3 Y glibc solaris cygwin + ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin + ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-6 Y glibc aix hpux solaris cygwin + ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin + ISO-8859-8 Y glibc aix hpux osf solaris cygwin + ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin + ISO-8859-13 glibc netbsd openbsd darwin cygwin + ISO-8859-14 glibc cygwin + ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin + KOI8-R Y glibc solaris freebsd netbsd openbsd darwin + KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin + KOI8-T glibc + CP437 dos + CP775 dos + CP850 aix osf dos + CP852 dos + CP855 dos + CP856 aix + CP857 dos + CP861 dos + CP862 dos + CP864 dos + CP865 dos + CP866 freebsd netbsd openbsd darwin dos + CP869 dos + CP874 windows dos + CP922 aix + CP932 aix cygwin windows dos + CP943 aix + CP949 osf darwin windows dos + CP950 windows dos + CP1046 aix + CP1124 aix + CP1125 dos + CP1129 aix + CP1131 darwin + CP1250 windows + CP1251 glibc solaris netbsd openbsd darwin cygwin windows + CP1252 aix windows + CP1253 windows + CP1254 windows + CP1255 glibc windows + CP1256 windows + CP1257 windows + GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin + EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin + EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin + EUC-TW glibc aix hpux irix osf solaris netbsd + BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin + BIG5-HKSCS glibc solaris darwin + GBK glibc aix osf solaris darwin cygwin windows dos + GB18030 glibc solaris netbsd darwin + SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin + JOHAB glibc solaris windows + TIS-620 glibc aix hpux osf solaris cygwin + VISCII Y glibc + TCVN5712-1 glibc + ARMSCII-8 glibc darwin + GEORGIAN-PS glibc cygwin + PT154 glibc + HP-ROMAN8 hpux + HP-ARABIC8 hpux + HP-GREEK8 hpux + HP-HEBREW8 hpux + HP-TURKISH8 hpux + HP-KANA8 hpux + DEC-KANJI osf + DEC-HANYU osf + UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin + + Note: Names which are not marked as being a MIME name should not be used in + Internet protocols for information interchange (mail, news, etc.). + + Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications + must understand both names and treat them as equivalent. + */ + #ifdef __cplusplus } |