localcharset.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /* Determine a canonical name for the current locale's character encoding.
  2. Copyright (C) 2000-2003, 2009-2021 Free Software Foundation, Inc.
  3. This file is part of the GNU CHARSET Library.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, see <https://www.gnu.org/licenses/>. */
  14. #ifndef _LOCALCHARSET_H
  15. #define _LOCALCHARSET_H
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* Same as above, but only look at environment variables, avoiding calls to
  20. `setlocale', `nl_langinfo', etc. See
  21. <http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00040.html> for
  22. the rationale. */
  23. extern const char * environ_locale_charset (void);
  24. /* Determine the current locale's character encoding, and canonicalize it
  25. into one of the canonical names listed below.
  26. The result must not be freed; it is statically allocated. The result
  27. becomes invalid when setlocale() is used to change the global locale, or
  28. when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
  29. is changed; threads in multithreaded programs should not do this.
  30. If the canonical name cannot be determined, the result is a non-canonical
  31. name. */
  32. extern const char * locale_charset (void);
  33. /* About GNU canonical names for character encodings:
  34. Every canonical name must be supported by GNU libiconv. Support by GNU libc
  35. is also desirable.
  36. The name is case insensitive. Usually an upper case MIME charset name is
  37. preferred.
  38. The current list of these GNU canonical names is:
  39. name MIME? used by which systems
  40. (darwin = Mac OS X, windows = native Windows)
  41. ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin
  42. ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
  43. ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
  44. ISO-8859-3 Y glibc solaris cygwin
  45. ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin
  46. ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
  47. ISO-8859-6 Y glibc aix hpux solaris cygwin
  48. ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
  49. ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos
  50. ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos
  51. ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin
  52. ISO-8859-14 glibc cygwin
  53. ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin
  54. KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin
  55. KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
  56. KOI8-T glibc
  57. CP437 dos
  58. CP775 dos
  59. CP850 aix osf dos
  60. CP852 dos
  61. CP855 dos
  62. CP856 aix
  63. CP857 dos
  64. CP861 dos
  65. CP862 dos
  66. CP864 dos
  67. CP865 dos
  68. CP866 freebsd netbsd openbsd darwin dos
  69. CP869 dos
  70. CP874 windows dos
  71. CP922 aix
  72. CP932 aix cygwin windows dos
  73. CP943 aix zos
  74. CP949 osf darwin windows dos
  75. CP950 windows dos
  76. CP1046 aix
  77. CP1124 aix
  78. CP1125 dos
  79. CP1129 aix
  80. CP1131 freebsd darwin
  81. CP1250 windows
  82. CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows
  83. CP1252 aix windows
  84. CP1253 windows
  85. CP1254 windows
  86. CP1255 glibc windows
  87. CP1256 windows
  88. CP1257 windows
  89. GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos
  90. EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
  91. EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos
  92. EUC-TW glibc aix hpux irix osf solaris netbsd
  93. BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos
  94. BIG5-HKSCS glibc hpux solaris netbsd darwin
  95. GBK glibc aix osf solaris freebsd darwin cygwin windows dos
  96. GB18030 glibc hpux solaris freebsd netbsd darwin
  97. SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
  98. JOHAB glibc solaris windows
  99. TIS-620 glibc aix hpux osf solaris cygwin zos
  100. VISCII Y glibc
  101. TCVN5712-1 glibc
  102. ARMSCII-8 glibc freebsd netbsd darwin
  103. GEORGIAN-PS glibc cygwin
  104. PT154 glibc netbsd cygwin
  105. HP-ROMAN8 hpux
  106. HP-ARABIC8 hpux
  107. HP-GREEK8 hpux
  108. HP-HEBREW8 hpux
  109. HP-TURKISH8 hpux
  110. HP-KANA8 hpux
  111. DEC-KANJI osf
  112. DEC-HANYU osf
  113. UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos
  114. Note: Names which are not marked as being a MIME name should not be used in
  115. Internet protocols for information interchange (mail, news, etc.).
  116. Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
  117. must understand both names and treat them as equivalent.
  118. */
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122. #endif /* _LOCALCHARSET_H */