mbfl_encoding.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. * "streamable kanji code filter and converter"
  3. * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved.
  4. *
  5. * LICENSE NOTICES
  6. *
  7. * This file is part of "streamable kanji code filter and converter",
  8. * which is distributed under the terms of GNU Lesser General Public
  9. * License (version 2) as published by the Free Software Foundation.
  10. *
  11. * This software is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with "streamable kanji code filter and converter";
  18. * if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  19. * Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. * The author of this file:
  22. *
  23. */
  24. /*
  25. * The source code included in this files was separated from mbfilter.h
  26. * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
  27. * mbfilter.h is included in this package .
  28. *
  29. */
  30. #ifndef MBFL_ENCODING_H
  31. #define MBFL_ENCODING_H
  32. #include "mbfl_defs.h"
  33. enum mbfl_no_encoding {
  34. mbfl_no_encoding_invalid = -1,
  35. mbfl_no_encoding_pass,
  36. mbfl_no_encoding_auto,
  37. mbfl_no_encoding_wchar,
  38. mbfl_no_encoding_byte2be,
  39. mbfl_no_encoding_byte2le,
  40. mbfl_no_encoding_byte4be,
  41. mbfl_no_encoding_byte4le,
  42. mbfl_no_encoding_base64,
  43. mbfl_no_encoding_uuencode,
  44. mbfl_no_encoding_html_ent,
  45. mbfl_no_encoding_qprint,
  46. mbfl_no_encoding_7bit,
  47. mbfl_no_encoding_8bit,
  48. mbfl_no_encoding_charset_min,
  49. mbfl_no_encoding_ucs4,
  50. mbfl_no_encoding_ucs4be,
  51. mbfl_no_encoding_ucs4le,
  52. mbfl_no_encoding_ucs2,
  53. mbfl_no_encoding_ucs2be,
  54. mbfl_no_encoding_ucs2le,
  55. mbfl_no_encoding_utf32,
  56. mbfl_no_encoding_utf32be,
  57. mbfl_no_encoding_utf32le,
  58. mbfl_no_encoding_utf16,
  59. mbfl_no_encoding_utf16be,
  60. mbfl_no_encoding_utf16le,
  61. mbfl_no_encoding_utf8,
  62. mbfl_no_encoding_utf8_docomo,
  63. mbfl_no_encoding_utf8_kddi_a,
  64. mbfl_no_encoding_utf8_kddi_b,
  65. mbfl_no_encoding_utf8_sb,
  66. mbfl_no_encoding_utf7,
  67. mbfl_no_encoding_utf7imap,
  68. mbfl_no_encoding_ascii,
  69. mbfl_no_encoding_euc_jp,
  70. mbfl_no_encoding_eucjp2004,
  71. mbfl_no_encoding_sjis,
  72. mbfl_no_encoding_eucjp_win,
  73. mbfl_no_encoding_sjis_open,
  74. mbfl_no_encoding_sjis_docomo,
  75. mbfl_no_encoding_sjis_kddi,
  76. mbfl_no_encoding_sjis_sb,
  77. mbfl_no_encoding_sjis_mac,
  78. mbfl_no_encoding_sjis2004,
  79. mbfl_no_encoding_cp932,
  80. mbfl_no_encoding_cp51932,
  81. mbfl_no_encoding_jis,
  82. mbfl_no_encoding_2022jp,
  83. mbfl_no_encoding_2022jp_2004,
  84. mbfl_no_encoding_2022jp_kddi,
  85. mbfl_no_encoding_2022jpms,
  86. mbfl_no_encoding_gb18030,
  87. mbfl_no_encoding_cp1252,
  88. mbfl_no_encoding_cp1254,
  89. mbfl_no_encoding_8859_1,
  90. mbfl_no_encoding_8859_2,
  91. mbfl_no_encoding_8859_3,
  92. mbfl_no_encoding_8859_4,
  93. mbfl_no_encoding_8859_5,
  94. mbfl_no_encoding_8859_6,
  95. mbfl_no_encoding_8859_7,
  96. mbfl_no_encoding_8859_8,
  97. mbfl_no_encoding_8859_9,
  98. mbfl_no_encoding_8859_10,
  99. mbfl_no_encoding_8859_13,
  100. mbfl_no_encoding_8859_14,
  101. mbfl_no_encoding_8859_15,
  102. mbfl_no_encoding_euc_cn,
  103. mbfl_no_encoding_cp936,
  104. mbfl_no_encoding_euc_tw,
  105. mbfl_no_encoding_big5,
  106. mbfl_no_encoding_cp950,
  107. mbfl_no_encoding_euc_kr,
  108. mbfl_no_encoding_2022kr,
  109. mbfl_no_encoding_uhc,
  110. mbfl_no_encoding_hz,
  111. mbfl_no_encoding_cp1251,
  112. mbfl_no_encoding_cp866,
  113. mbfl_no_encoding_koi8r,
  114. mbfl_no_encoding_koi8u,
  115. mbfl_no_encoding_8859_16,
  116. mbfl_no_encoding_armscii8,
  117. mbfl_no_encoding_cp850,
  118. mbfl_no_encoding_jis_ms,
  119. mbfl_no_encoding_cp50220,
  120. mbfl_no_encoding_cp50220raw,
  121. mbfl_no_encoding_cp50221,
  122. mbfl_no_encoding_cp50222,
  123. mbfl_no_encoding_charset_max
  124. };
  125. typedef enum mbfl_no_encoding mbfl_encoding_id;
  126. /*
  127. * encoding
  128. */
  129. typedef struct _mbfl_encoding {
  130. enum mbfl_no_encoding no_encoding;
  131. const char *name;
  132. const char *mime_name;
  133. const char *(*aliases)[];
  134. const unsigned char *mblen_table;
  135. unsigned int flag;
  136. } mbfl_encoding;
  137. MBFLAPI extern const mbfl_encoding * mbfl_name2encoding(const char *name);
  138. MBFLAPI extern const mbfl_encoding * mbfl_no2encoding(enum mbfl_no_encoding no_encoding);
  139. MBFLAPI extern enum mbfl_no_encoding mbfl_name2no_encoding(const char *name);
  140. MBFLAPI extern const mbfl_encoding ** mbfl_get_supported_encodings();
  141. MBFLAPI extern const char * mbfl_no_encoding2name(enum mbfl_no_encoding no_encoding);
  142. MBFLAPI extern const char * mbfl_no2preferred_mime_name(enum mbfl_no_encoding no_encoding);
  143. MBFLAPI extern int mbfl_is_support_encoding(const char *name);
  144. #endif /* MBFL_ENCODING_H */