1 /* Determine a canonical name for the current locale's character encoding.
2 Copyright (C) 2000-2003, 2009-2022 Free Software Foundation, Inc.
3 This file is part of the GNU CHARSET Library.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 #ifndef _LOCALCHARSET_H
19 #define _LOCALCHARSET_H
27 /* Determine the current locale's character encoding, and canonicalize it
28 into one of the canonical names listed below.
29 The result must not be freed; it is statically allocated. The result
30 becomes invalid when setlocale() is used to change the global locale, or
31 when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
32 is changed; threads in multithreaded programs should not do this.
33 If the canonical name cannot be determined, the result is a non-canonical
35 extern const char * locale_charset (void);
37 /* About GNU canonical names for character encodings:
39 Every canonical name must be supported by GNU libiconv. Support by GNU libc
42 The name is case insensitive. Usually an upper case MIME charset name is
45 The current list of these GNU canonical names is:
47 name MIME? used by which systems
48 (darwin = Mac OS X, windows = native Windows)
50 ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin
51 ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
52 ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
53 ISO-8859-3 Y glibc solaris cygwin
54 ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin
55 ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
56 ISO-8859-6 Y glibc aix hpux solaris cygwin
57 ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
58 ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos
59 ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos
60 ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin
61 ISO-8859-14 glibc cygwin
62 ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin
63 KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin
64 KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
77 CP866 freebsd netbsd openbsd darwin dos
81 CP932 aix cygwin windows dos
83 CP949 osf darwin windows dos
91 CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows
98 GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos
99 EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
100 EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos
101 EUC-TW glibc aix hpux irix osf solaris netbsd
102 BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos
103 BIG5-HKSCS glibc hpux solaris netbsd darwin
104 GBK glibc aix osf solaris freebsd darwin cygwin windows dos
105 GB18030 glibc hpux solaris freebsd netbsd darwin
106 SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
107 JOHAB glibc solaris windows
108 TIS-620 glibc aix hpux osf solaris cygwin zos
111 ARMSCII-8 glibc freebsd netbsd darwin
112 GEORGIAN-PS glibc cygwin
113 PT154 glibc netbsd cygwin
122 UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos
124 Note: Names which are not marked as being a MIME name should not be used in
125 Internet protocols for information interchange (mail, news, etc.).
127 Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
128 must understand both names and treat them as equivalent.
137 #endif /* _LOCALCHARSET_H */