YSTest: encoding.h 源文件

YSTest PreAlpha_b400_20130424 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
encoding.h
浏览该文件的文档.
1 ﻿/*
2 Copyright (C) by Franksoft 2009 - 2012.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef CHRLIB_INC_ENCODING_H_
29 #define CHRLIB_INC_ENCODING_H_ 1
30
31 #include "chrdef.h"
32
33 CHRLIB_BEGIN
34
35 CHRLIB_BEGIN_NAMESPACE(CharSet)
36
37 /*
38 \brief 字符流编码标识。
39
40 编码字符集：使用 IANA 官方字符集名称和 MIBenum（MIB 枚举）。
41 \note MIB(management information base) 是
42 SNMP(simple network management protocal ，简单网络管理协议) 和
43 OSI/ISO 网络管理模型上下文中的虚拟数据库，参见
44 http://en.wikipedia.org/wiki/Management_information_base 。
45 \note 由于历史原因， CharSet（字符集）和相关概念在此作为文本编码的同义词，
46 但不是确切的用法，参见 http://www.iana.org/assignments/ianacharset-mib 。
47 \note 完整枚举项的详细信息参见 http://www.iana.org/assignments/character-sets 。
48 */
49 typedef enum
50 {
51 //保留。
52 Null = 0,
53 Reserved_1 = 1,
54 Reserved_2 = 2,
55
56 csASCII = 3,
57 csISOLatin1 = 4,
58 csISOLatin2 = 5,
59 csISOLatin3 = 6,
60 csISOLatin4 = 7,
61 csISOLatinCyrillic = 8,
62 csISOLatinArabic = 9,
63 csISOLatinGreek = 10,
64 csISOLatinHebrew = 11,
65 csISOLatin5 = 12,
66 csISOLatin6 = 13,
67 csISOTextComm = 14,
68 csHalfWidthKatakana = 15,
69 csJISEncoding = 16,
70 csShiftJIS = 17,
71 csEUCPkdFmtJapanese = 18,
72 csEUCFixWidJapanese = 19,
73 csISO4UnitedKingdom = 20,
74 csISO11SwedishForNames = 21,
75 csISO15Italian = 22,
76 csISO17Spanish = 23,
77 csISO21German = 24,
78 csISO60DanishNorwegian = 25,
79 csISO69French = 26,
80 csISO10646UTF1 = 27,
81 csISO646basic1983 = 28,
82 csINVARIANT = 29,
83 csISO2IntlRefVersion = 30,
84 csNATSSEFI = 31,
85 csNATSSEFIADD = 32,
86 csNATSDANO = 33,
87 csNATSDANOADD = 34,
88 csISO10Swedish = 35,
89 csKSC56011987 = 36,
90 csISO2022KR = 37,
91 csEUCKR = 38,
92 csISO2022JP = 39,
93 csISO2022JP2 = 40,
94 csISO13JISC6220jp = 41,
95 csISO14JISC6220ro = 42,
96 csISO16Portuguese = 43,
97 csISO18Greek7Old = 44,
98 csISO19LatinGreek = 45,
99 csISO25French = 46,
100 csISO27LatinGreek1 = 47,
101 csISO5427Cyrillic = 48,
102 csISO42JISC62261978 = 49,
103 csISO47BSViewdata = 50,
104 csISO49INIS = 51,
105 csISO50INIS8 = 52,
106 csISO51INISCyrillic = 53,
107 csISO54271981 = 54,
108 csISO5428Greek = 55,
109 csISO57GB1988 = 56,
110 csISO58GB231280 = 57,
111 csISO61Norwegian2 = 58,
112 csISO70VideotexSupp1 = 59,
113 csISO84Portuguese2 = 60,
114 csISO85Spanish2 = 61,
115 csISO86Hungarian = 62,
116 csISO87JISX0208 = 63,
117 csISO88Greek7 = 64,
118 csISO89ASMO449 = 65,
119 csISO90 = 66,
120 csISO91JISC62291984a = 67,
121 csISO92JISC62991984b = 68,
122 csISO93JIS62291984badd = 69,
123 csISO94JIS62291984hand = 70,
124 csISO95JIS62291984handadd = 71,
125 csISO96JISC62291984kana = 72,
126 csISO2033 = 73,
127 csISO99NAPLPS = 74,
128 csISO102T617bit = 75,
129 csISO103T618bit = 76,
130 csISO111ECMACyrillic = 77,
131 csa71 = 78,
132 csa72 = 79,
133 csISO123CSAZ24341985gr = 80,
134 csISO88596E = 81,
135 csISO88596I = 82,
136 csISO128T101G2 = 83,
137 csISO88598E = 84,
138 csISO88598I = 85,
139 csISO139CSN369103 = 86,
140 csISO141JUSIB1002 = 87,
141 csISO143IECP271 = 88,
142 csISO146Serbian = 89,
143 csISO147Macedonian = 90,
144 csISO150 = 91,
145 csISO151Cuba = 92,
146 csISO6937Add = 93,
147 csISO153GOST1976874 = 94,
148 csISO8859Supp = 95,
149 csISO10367Box = 96,
150 csISO158Lap = 97,
151 csISO159JISX02121990 = 98,
152 csISO646Danish = 99,
153 csUSDK = 100,
154 csDKUS = 101,
155 csKSC5636 = 102,
156 csUnicode11UTF7 = 103,
157 csISO2022CN = 104,
158 csISO2022CNEXT = 105,
159 csUTF8 = 106,
160 csISO885913 = 109,
161 csISO885914 = 110,
162 csISO885915 = 111,
163 csISO885916 = 112,
164 csGBK = 113,
165 csGB18030 = 114,
166 csOSDEBCDICDF0415 = 115,
167 csOSDEBCDICDF03IRV = 116,
168 csOSDEBCDICDF041 = 117,
169 csISO115481 = 118,
170 csKZ1048 = 119,
171 csUnicode = 1000,
172 csUCS4 = 1001,
173 csUnicodeASCII = 1002,
174 csUnicodeLatin1 = 1003,
175 csUnicodeIBM1261 = 1005,
176 csUnicodeIBM1268 = 1006,
177 csUnicodeIBM1276 = 1007,
178 csUnicodeIBM1264 = 1008,
179 csUnicodeIBM1265 = 1009,
180 csUnicode11 = 1010,
181 csSCSU = 1011,
182 csUTF7 = 1012,
183 csUTF16BE = 1013,
184 csUTF16LE = 1014,
185 csUTF16 = 1015,
186 csCESU8 = 1016,
187 csUTF32 = 1017,
188 csUTF32BE = 1018,
189 csUTF32LE = 1019,
190 csBOCU1 = 1020,
191 csWindows30Latin1 = 2000,
192 csWindows31Latin1 = 2001,
193 csWindows31Latin2 = 2002,
194 csWindows31Latin5 = 2003,
195 csHPRoman8 = 2004,
196 csAdobeStandardEncoding = 2005,
197 csVenturaUS = 2006,
198 csVenturaInternational = 2007,
199 csDECMCS = 2008,
200 csPC850Multilingual = 2009,
201 csPCp852 = 2010,
202 csPC8CodePage437 = 2011,
203 csPC8DanishNorwegian = 2012,
204 csPC862LatinHebrew = 2013,
205 csPC8Turkish = 2014,
206 csIBMSymbols = 2015,
207 csIBMThai = 2016,
208 csHPLegal = 2017,
209 csHPPiFont = 2018,
210 csHPMath8 = 2019,
211 csHPPSMath = 2020,
212 csHPDesktop = 2021,
213 csVenturaMath = 2022,
214 csMicrosoftPublishing = 2023,
215 csWindows31J = 2024,
216 csGB2312 = 2025,
217 csBig5 = 2026,
218 csMacintosh = 2027,
219 csIBM037 = 2028,
220 csIBM038 = 2029,
221 csIBM273 = 2030,
222 csIBM274 = 2031,
223 csIBM275 = 2032,
224 csIBM277 = 2033,
225 csIBM278 = 2034,
226 csIBM280 = 2035,
227 csIBM281 = 2036,
228 csIBM284 = 2037,
229 csIBM285 = 2038,
230 csIBM290 = 2039,
231 csIBM297 = 2040,
232 csIBM420 = 2041,
233 csIBM423 = 2042,
234 csIBM424 = 2043,
235 csIBM500 = 2044,
236 csIBM851 = 2045,
237 csIBM855 = 2046,
238 csIBM857 = 2047,
239 csIBM860 = 2048,
240 csIBM861 = 2049,
241 csIBM863 = 2050,
242 csIBM864 = 2051,
243 csIBM865 = 2052,
244 csIBM868 = 2053,
245 csIBM869 = 2054,
246 csIBM870 = 2055,
247 csIBM871 = 2056,
248 csIBM880 = 2057,
249 csIBM891 = 2058,
250 csIBM903 = 2059,
251 csIBBM904 = 2060,
252 csIBM905 = 2061,
253 csIBM918 = 2062,
254 csIBM1026 = 2063,
255 csIBMEBCDICATDE = 2064,
256 csEBCDICATDEA = 2065,
257 csEBCDICCAFR = 2066,
258 csEBCDICDKNO = 2067,
259 csEBCDICDKNOA = 2068,
260 csEBCDICFISE = 2069,
261 csEBCDICFISEA = 2070,
262 csEBCDICFR = 2071,
263 csEBCDICIT = 2072,
264 csEBCDICPT = 2073,
265 csEBCDICES = 2074,
266 csEBCDICESA = 2075,
267 csEBCDICESS = 2076,
268 csEBCDICUK = 2077,
269 csEBCDICUS = 2078,
270 csUnknown8BiT = 2079,
271 csMnemonic = 2080,
272 csMnem = 2081,
273 csVISCII = 2082,
274 csVIQR = 2083,
275 csKOI8R = 2084,
276 csHZGB2312 = 2085,
277 csIBM866 = 2086,
278 csPC775Baltic = 2087,
279 csKOI8U = 2088,
280 csIBM00858 = 2089,
281 csIBM00924 = 2090,
282 csIBM01140 = 2091,
283 csIBM01141 = 2092,
284 csIBM01142 = 2093,
285 csIBM01143 = 2094,
286 csIBM01144 = 2095,
287 csIBM01145 = 2096,
288 csIBM01146 = 2097,
289 csIBM01147 = 2098,
290 csIBM01148 = 2099,
291 csIBM01149 = 2100,
292 csBig5HKSCS = 2101,
293 csIBM1047 = 2102,
294 csPTCP154 = 2103,
295 csAmiga1251 = 2104,
296 csKOI7switched = 2105,
297 csBRF = 2106,
298 csTSCII = 2107,
299 csCP51932 = 2108,
300 cswindows874 = 2109,
301 cswindows1250 = 2250,
302 cswindows1251 = 2251,
303 cswindows1252 = 2252,
304 cswindows1253 = 2253,
305 cswindows1254 = 2254,
306 cswindows1255 = 2255,
307 cswindows1256 = 2256,
308 cswindows1257 = 2257,
309 cswindows1258 = 2258,
310 csTIS620 = 2259,
311 cs50220 = 2260,
312 reserved = 3000
313 } Encoding;
314
315 //通用别名。
316 yconstexpr Encoding
317 US_ASCII(csASCII),
318 SHIFT_JIS(csShiftJIS),
319 KS_C_5601_1987(csKSC56011987),
320 EUC_KR(csEUCKR),
321 ASMO_449(csISO89ASMO449),
322 UTF_8(csUTF8),
323 GBK(csGBK),
324 GB18030(csGB18030),
325
326 ISO_10646_UCS_2(csUnicode),
327 ISO_10646_UCS_4(csUCS4),
328 ISO_10646_UCS_Basic(csUnicodeASCII),
329
330 UTF_7(csUTF7),
331 UTF_16BE(csUTF16BE),
332 UTF_16LE(csUTF16LE),
333 UTF_16(csUTF16),
334
335 UTF_32(csUTF32),
336 UTF_32BE(csUTF32BE),
337 UTF_32LE(csUTF32LE),
338
339 GB2312(csGB2312),
340 Big5(csBig5)//,
341 ;
342 //未归类在 MIB 枚举中。
343 /*
344 HZ_GB_2312 = 52396, //!< Chinese Simplified (HZ)，GB2312 的另一种实现。
345 MIK; //!< Supports Bulgarian and Russian as well
346 */
347
348 //其它别名。
349 yconstexpr Encoding
350 iso_ir_6(US_ASCII), ISO646_US(US_ASCII), ASCII(US_ASCII), us(US_ASCII),
351 IBM367(US_ASCII), cp367(US_ASCII),
352 MS_Kanji(SHIFT_JIS), windows_932_(SHIFT_JIS),
353 iso_ir_149(KS_C_5601_1987), KS_C_5601_1989(KS_C_5601_1987),
354 KSC_5601(KS_C_5601_1987), korean(KS_C_5601_1987),
355 windows_949_(KS_C_5601_1987),
356 windows_65001_(UTF_8),
357 CP936(GBK), MS936(GBK), windows_936(GBK),
358 windows_54936_(GB18030),
359
360 windows_1201_(UTF_16BE),
361 windows_1200_(UTF_16LE),
362
363 EUC_CN_(GB2312), windows_51936_(GB2312),
364 windows_950_(Big5);
365
366 CHRLIB_END_NAMESPACE(CharSet)
367
368 CHRLIB_END
369
370 #endif
371