xref: /trunk/main/sal/inc/rtl/textenc.h (revision 9eab2a37)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _RTL_TEXTENC_H
25 #define _RTL_TEXTENC_H
26 
27 #ifdef _SOLAR_RSC_INVOKED
28 /* Enable resources to use these values, rsc can't handle casts */
29 #define RTL_TEXTENC_CAST( val ) (val)
30 
31 #else /* !_SOLAR_RSC_INVOKED */
32 
33 #ifndef _SAL_TYPES_H
34 #include <sal/types.h>
35 #endif
36 
37 /** The various supported text encodings.
38 
39     Possible values include a wide range of single- and multi-byte encodings
40     (ranging from RTL_TEXTENCODING_MS_1252 to RTL_TEXTENCODING_GB_18030),
41     the ISO 10646 (Unicode) specific encodings RTL_TEXTENCODING_UCS4 and
42     RTL_TEXTENCODING_UCS2 (aka RTL_TEXTENCODING_UNICODE), and
43     RTL_TEXTENCODING_DONTKNOW to indicate an unknown or missing encoding.
44  */
45 typedef sal_uInt16 rtl_TextEncoding;
46 
47 #define RTL_TEXTENC_CAST( val ) ((rtl_TextEncoding) val)
48 
49 #endif /* _SOLAR_RSC_INVOKED */
50 
51 #define RTL_TEXTENCODING_DONTKNOW               (RTL_TEXTENC_CAST( 0 ))
52 #define RTL_TEXTENCODING_MS_1252                (RTL_TEXTENC_CAST( 1 ))
53 #define RTL_TEXTENCODING_APPLE_ROMAN            (RTL_TEXTENC_CAST( 2 ))
54 #define RTL_TEXTENCODING_IBM_437                (RTL_TEXTENC_CAST( 3 ))
55 #define RTL_TEXTENCODING_IBM_850                (RTL_TEXTENC_CAST( 4 ))
56 #define RTL_TEXTENCODING_IBM_860                (RTL_TEXTENC_CAST( 5 ))
57 #define RTL_TEXTENCODING_IBM_861                (RTL_TEXTENC_CAST( 6 ))
58 #define RTL_TEXTENCODING_IBM_863                (RTL_TEXTENC_CAST( 7 ))
59 #define RTL_TEXTENCODING_IBM_865                (RTL_TEXTENC_CAST( 8 ))
60 /* Reserved: RTL_TEXTENCODING_SYSTEM            (RTL_TEXTENC_CAST( 9 )) */
61 #define RTL_TEXTENCODING_SYMBOL                 (RTL_TEXTENC_CAST( 10 ))
62 #define RTL_TEXTENCODING_ASCII_US               (RTL_TEXTENC_CAST( 11 ))
63 #define RTL_TEXTENCODING_ISO_8859_1             (RTL_TEXTENC_CAST( 12 ))
64 #define RTL_TEXTENCODING_ISO_8859_2             (RTL_TEXTENC_CAST( 13 ))
65 #define RTL_TEXTENCODING_ISO_8859_3             (RTL_TEXTENC_CAST( 14 ))
66 #define RTL_TEXTENCODING_ISO_8859_4             (RTL_TEXTENC_CAST( 15 ))
67 #define RTL_TEXTENCODING_ISO_8859_5             (RTL_TEXTENC_CAST( 16 ))
68 #define RTL_TEXTENCODING_ISO_8859_6             (RTL_TEXTENC_CAST( 17 ))
69 #define RTL_TEXTENCODING_ISO_8859_7             (RTL_TEXTENC_CAST( 18 ))
70 #define RTL_TEXTENCODING_ISO_8859_8             (RTL_TEXTENC_CAST( 19 ))
71 #define RTL_TEXTENCODING_ISO_8859_9             (RTL_TEXTENC_CAST( 20 ))
72 #define RTL_TEXTENCODING_ISO_8859_14            (RTL_TEXTENC_CAST( 21 ))
73 #define RTL_TEXTENCODING_ISO_8859_15            (RTL_TEXTENC_CAST( 22 ))
74 #define RTL_TEXTENCODING_IBM_737                (RTL_TEXTENC_CAST( 23 ))
75 #define RTL_TEXTENCODING_IBM_775                (RTL_TEXTENC_CAST( 24 ))
76 #define RTL_TEXTENCODING_IBM_852                (RTL_TEXTENC_CAST( 25 ))
77 #define RTL_TEXTENCODING_IBM_855                (RTL_TEXTENC_CAST( 26 ))
78 #define RTL_TEXTENCODING_IBM_857                (RTL_TEXTENC_CAST( 27 ))
79 #define RTL_TEXTENCODING_IBM_862                (RTL_TEXTENC_CAST( 28 ))
80 #define RTL_TEXTENCODING_IBM_864                (RTL_TEXTENC_CAST( 29 ))
81 #define RTL_TEXTENCODING_IBM_866                (RTL_TEXTENC_CAST( 30 ))
82 #define RTL_TEXTENCODING_IBM_869                (RTL_TEXTENC_CAST( 31 ))
83 #define RTL_TEXTENCODING_MS_874                 (RTL_TEXTENC_CAST( 32 ))
84 #define RTL_TEXTENCODING_MS_1250                (RTL_TEXTENC_CAST( 33 ))
85 #define RTL_TEXTENCODING_MS_1251                (RTL_TEXTENC_CAST( 34 ))
86 #define RTL_TEXTENCODING_MS_1253                (RTL_TEXTENC_CAST( 35 ))
87 #define RTL_TEXTENCODING_MS_1254                (RTL_TEXTENC_CAST( 36 ))
88 #define RTL_TEXTENCODING_MS_1255                (RTL_TEXTENC_CAST( 37 ))
89 #define RTL_TEXTENCODING_MS_1256                (RTL_TEXTENC_CAST( 38 ))
90 #define RTL_TEXTENCODING_MS_1257                (RTL_TEXTENC_CAST( 39 ))
91 #define RTL_TEXTENCODING_MS_1258                (RTL_TEXTENC_CAST( 40 ))
92 #define RTL_TEXTENCODING_APPLE_ARABIC           (RTL_TEXTENC_CAST( 41 ))
93 #define RTL_TEXTENCODING_APPLE_CENTEURO         (RTL_TEXTENC_CAST( 42 ))
94 #define RTL_TEXTENCODING_APPLE_CROATIAN         (RTL_TEXTENC_CAST( 43 ))
95 #define RTL_TEXTENCODING_APPLE_CYRILLIC         (RTL_TEXTENC_CAST( 44 ))
96 #define RTL_TEXTENCODING_APPLE_DEVANAGARI       (RTL_TEXTENC_CAST( 45 ))
97 #define RTL_TEXTENCODING_APPLE_FARSI            (RTL_TEXTENC_CAST( 46 ))
98 #define RTL_TEXTENCODING_APPLE_GREEK            (RTL_TEXTENC_CAST( 47 ))
99 #define RTL_TEXTENCODING_APPLE_GUJARATI         (RTL_TEXTENC_CAST( 48 ))
100 #define RTL_TEXTENCODING_APPLE_GURMUKHI         (RTL_TEXTENC_CAST( 49 ))
101 #define RTL_TEXTENCODING_APPLE_HEBREW           (RTL_TEXTENC_CAST( 50 ))
102 #define RTL_TEXTENCODING_APPLE_ICELAND          (RTL_TEXTENC_CAST( 51 ))
103 #define RTL_TEXTENCODING_APPLE_ROMANIAN         (RTL_TEXTENC_CAST( 52 ))
104 #define RTL_TEXTENCODING_APPLE_THAI             (RTL_TEXTENC_CAST( 53 ))
105 #define RTL_TEXTENCODING_APPLE_TURKISH          (RTL_TEXTENC_CAST( 54 ))
106 #define RTL_TEXTENCODING_APPLE_UKRAINIAN        (RTL_TEXTENC_CAST( 55 ))
107 #define RTL_TEXTENCODING_APPLE_CHINSIMP         (RTL_TEXTENC_CAST( 56 ))
108 #define RTL_TEXTENCODING_APPLE_CHINTRAD         (RTL_TEXTENC_CAST( 57 ))
109 #define RTL_TEXTENCODING_APPLE_JAPANESE         (RTL_TEXTENC_CAST( 58 ))
110 #define RTL_TEXTENCODING_APPLE_KOREAN           (RTL_TEXTENC_CAST( 59 ))
111 #define RTL_TEXTENCODING_MS_932                 (RTL_TEXTENC_CAST( 60 ))
112 #define RTL_TEXTENCODING_MS_936                 (RTL_TEXTENC_CAST( 61 ))
113 #define RTL_TEXTENCODING_MS_949                 (RTL_TEXTENC_CAST( 62 ))
114 #define RTL_TEXTENCODING_MS_950                 (RTL_TEXTENC_CAST( 63 ))
115 #define RTL_TEXTENCODING_SHIFT_JIS              (RTL_TEXTENC_CAST( 64 ))
116 #define RTL_TEXTENCODING_GB_2312                (RTL_TEXTENC_CAST( 65 ))
117 #define RTL_TEXTENCODING_GBT_12345              (RTL_TEXTENC_CAST( 66 ))
118 #define RTL_TEXTENCODING_GBK                    (RTL_TEXTENC_CAST( 67 ))
119 #define RTL_TEXTENCODING_BIG5                   (RTL_TEXTENC_CAST( 68 ))
120 #define RTL_TEXTENCODING_EUC_JP                 (RTL_TEXTENC_CAST( 69 ))
121 #define RTL_TEXTENCODING_EUC_CN                 (RTL_TEXTENC_CAST( 70 ))
122 #define RTL_TEXTENCODING_EUC_TW                 (RTL_TEXTENC_CAST( 71 ))
123 #define RTL_TEXTENCODING_ISO_2022_JP            (RTL_TEXTENC_CAST( 72 ))
124 #define RTL_TEXTENCODING_ISO_2022_CN            (RTL_TEXTENC_CAST( 73 ))
125 #define RTL_TEXTENCODING_KOI8_R                 (RTL_TEXTENC_CAST( 74 ))
126 #define RTL_TEXTENCODING_UTF7                   (RTL_TEXTENC_CAST( 75 ))
127 #define RTL_TEXTENCODING_UTF8                   (RTL_TEXTENC_CAST( 76 ))
128 #define RTL_TEXTENCODING_ISO_8859_10            (RTL_TEXTENC_CAST( 77 ))
129 #define RTL_TEXTENCODING_ISO_8859_13            (RTL_TEXTENC_CAST( 78 ))
130 #define RTL_TEXTENCODING_EUC_KR                 (RTL_TEXTENC_CAST( 79 ))
131 #define RTL_TEXTENCODING_ISO_2022_KR            (RTL_TEXTENC_CAST( 80 ))
132 #define RTL_TEXTENCODING_JIS_X_0201             (RTL_TEXTENC_CAST( 81 ))
133 #define RTL_TEXTENCODING_JIS_X_0208             (RTL_TEXTENC_CAST( 82 ))
134 #define RTL_TEXTENCODING_JIS_X_0212             (RTL_TEXTENC_CAST( 83 ))
135 #define RTL_TEXTENCODING_MS_1361                (RTL_TEXTENC_CAST( 84 ))
136 #define RTL_TEXTENCODING_GB_18030               (RTL_TEXTENC_CAST( 85 ))
137 #define RTL_TEXTENCODING_BIG5_HKSCS             (RTL_TEXTENC_CAST( 86 ))
138 #define RTL_TEXTENCODING_TIS_620                (RTL_TEXTENC_CAST( 87 ))
139 #define RTL_TEXTENCODING_KOI8_U                 (RTL_TEXTENC_CAST( 88 ))
140 #define RTL_TEXTENCODING_ISCII_DEVANAGARI       (RTL_TEXTENC_CAST( 89 ))
141 #define RTL_TEXTENCODING_JAVA_UTF8              (RTL_TEXTENC_CAST( 90 ))
142 #define RTL_TEXTENCODING_ADOBE_STANDARD         (RTL_TEXTENC_CAST( 91 ))
143 #define RTL_TEXTENCODING_ADOBE_SYMBOL           (RTL_TEXTENC_CAST( 92 ))
144 #define RTL_TEXTENCODING_PT154                  (RTL_TEXTENC_CAST( 93 ))
145 #define RTL_TEXTENCODING_ADOBE_DINGBATS         (RTL_TEXTENC_CAST( 94 ))
146 /* ATTENTION!  Whenever some encoding is added here, make sure to update
147  * rtl_isOctetTextEncoding in tencinfo.c.
148  */
149 
150 #define RTL_TEXTENCODING_USER_START             (RTL_TEXTENC_CAST( 0x8000 ))
151 #define RTL_TEXTENCODING_USER_END               (RTL_TEXTENC_CAST( 0xEFFF ))
152 
153 #define RTL_TEXTENCODING_UCS4                   (RTL_TEXTENC_CAST( 0xFFFE ))
154 #define RTL_TEXTENCODING_UCS2                   (RTL_TEXTENC_CAST( 0xFFFF ))
155 #define RTL_TEXTENCODING_UNICODE                RTL_TEXTENCODING_UCS2
156 
157 /****** Overview over the TextEncodings *****
158 # Arabic (Apple Macintosh)                        RTL_TEXTENCODING_APPLE_ARABIC
159 Arabic (DOS/OS2-864)                            RTL_TEXTENCODING_IBM_864
160 Arabic (ISO-8859-6)                             RTL_TEXTENCODING_ISO_8859_6
161 Arabic (Windows-1256)                           RTL_TEXTENCODING_MS_1256
162 
163 Baltic (DOS/OS2-775)                            RTL_TEXTENCODING_IBM_775
164 Baltic (ISO-8859-4)                             RTL_TEXTENCODING_ISO_8859_4
165 Baltic (Windows-1257)                           RTL_TEXTENCODING_MS_1257
166 
167 Central European (Apple Macintosh)              RTL_TEXTENCODING_APPLE_CENTEURO
168 Central European (Apple Macintosh/Croatian)     RTL_TEXTENCODING_APPLE_CROATIAN
169 Central European (Apple Macintosh/Romanian)     RTL_TEXTENCODING_APPLE_ROMANIAN
170 Central European (DOS/OS2-852)                  RTL_TEXTENCODING_IBM_852
171 Central European (ISO-8859-2)                   RTL_TEXTENCODING_ISO_8859_2
172 Central European (ISO-8859-10)                  RTL_TEXTENCODING_ISO_8859_10
173 Central European (ISO-8859-13)                  RTL_TEXTENCODING_ISO_8859_13
174 Central European (Windows-1250/WinLatin 2)      RTL_TEXTENCODING_MS_1250
175 
176 Chinese Simplified (Apple Macintosh)            RTL_TEXTENCODING_APPLE_CHINSIMP
177 Chinese Simplified (EUC-CN)                     RTL_TEXTENCODING_EUC_CN
178 Chinese Simplified (GB-2312)                    RTL_TEXTENCODING_GB_2312
179 Chinese Simplified (GBK/GB-2312-80)             RTL_TEXTENCODING_GBK
180 # Chinese Simplified (ISO-2022-CN)                RTL_TEXTENCODING_ISO_2022_CN
181 Chinese Simplified (Windows-936)                RTL_TEXTENCODING_MS_936
182 # Chinese Simplified (GB-18030)                   RTL_TEXTENCODING_GB_18030
183 
184 Chinese Traditional (Apple Macintosh)           RTL_TEXTENCODING_APPLE_CHINTRAD
185 Chinese Traditional (BIG5)                      RTL_TEXTENCODING_BIG5
186 # Chinese Traditional (EUC-TW)                    RTL_TEXTENCODING_EUC_TW
187 Chinese Traditional (GBT-12345)                 RTL_TEXTENCODING_GBT_12345
188 Chinese Traditional (Windows-950)               RTL_TEXTENCODING_MS_950
189 Chinese Traditional (BIG5-HKSCS)                RTL_TEXTENCODING_BIG5_HKSCS
190 
191 Cyrillic (Apple Macintosh)                      RTL_TEXTENCODING_APPLE_CYRILLIC
192 Cyrillic (Apple Macintosh/Ukrainian)            RTL_TEXTENCODING_APPLE_UKRAINIAN
193 Cyrillic (DOS/OS2-855)                          RTL_TEXTENCODING_IBM_855
194 Cyrillic (DOS/OS2-866/Russian)                  RTL_TEXTENCODING_IBM_866
195 Cyrillic (ISO-8859-5)                           RTL_TEXTENCODING_ISO_8859_5
196 Cyrillic (KOI8-R)                               RTL_TEXTENCODING_KOI8_R
197 Cyrillic (KOI8-U)                               RTL_TEXTENCODING_KOI8_U
198 Cyrillic (Windows-1251)                         RTL_TEXTENCODING_MS_1251
199 
200 Greek (Apple Macintosh)                         RTL_TEXTENCODING_APPLE_GREEK
201 Greek (DOS/OS2-737)                             RTL_TEXTENCODING_IBM_737
202 Greek (DOS/OS2-869/Modern)                      RTL_TEXTENCODING_IBM_869
203 Greek (ISO-8859-7)                              RTL_TEXTENCODING_ISO_8859_7
204 Greek (Windows-1253)                            RTL_TEXTENCODING_MS_1253
205 
206 # Hebrew (Apple Macintosh)                        RTL_TEXTENCODING_APPLE_HEBREW
207 Hebrew (DOS/OS2-862)                            RTL_TEXTENCODING_IBM_862
208 Hebrew (ISO-8859-8)                             RTL_TEXTENCODING_ISO_8859_8
209 Hebrew (Windows-1255)                           RTL_TEXTENCODING_MS_1255
210 
211 Korean (Apple Macintosh)                        RTL_TEXTENCODING_APPLE_KOREAN
212 Korean (EUC-KR)                                 RTL_TEXTENCODING_EUC_KR
213 # Korean (ISO-2022-KR)                            RTL_TEXTENCODING_ISO_2022_KR
214 Korean (Windows-Wansung-949)                    RTL_TEXTENCODING_MS_949
215 Korean (Windows-Johab-1361)                     RTL_TEXTENCODING_MS_1361
216 
217 Latin 3 (ISO-8859-3)                            RTL_TEXTENCODING_ISO_8859_3
218 
219 Indian (ISCII Devanagari)                      RTL_TEXTENCODING_ISCII_DEVANAGARI
220 
221 Japanese (Apple Macintosh)                      RTL_TEXTENCODING_APPLE_JAPANESE
222 Japanese (EUC-JP)                               RTL_TEXTENCODING_EUC_JP
223 # Japanese (ISO-2022-JP)                          RTL_TEXTENCODING_ISO_2022_JP
224 Japanese (Shift-JIS)                            RTL_TEXTENCODING_SHIFT_JIS
225 Japanese (Windows-932)                          RTL_TEXTENCODING_MS_932
226 
227 Symbol                                          RTL_TEXTENCODING_SYMBOL
228 
229 # Thai (Apple Macintosh)                          RTL_TEXTENCODING_APPLE_THAI
230 Thai (Dos/Windows-874)                          RTL_TEXTENCODING_MS_874
231 Thai (TIS 620)                                  RTL_TEXTENCODING_TIS_620
232 
233 Turkish (Apple Macintosh)                       RTL_TEXTENCODING_APPLE_TURKISH
234 Turkish (DOS/OS2-857)                           RTL_TEXTENCODING_IBM_857
235 Turkish (ISO-8859-9)                            RTL_TEXTENCODING_ISO_8859_9
236 Turkish (Windows-1254)                          RTL_TEXTENCODING_MS_1254
237 
238 Unicode (UTF-7)                                 RTL_TEXTENCODING_UTF7
239 Unicode (UTF-8)                                 RTL_TEXTENCODING_UTF8
240 Unicode (Java's modified UTF-8)                 RTL_TEXTENCODING_JAVA_UTF8
241 
242 Vietnamese (Windows-1258)                       RTL_TEXTENCODING_MS_1258
243 
244 Western (Apple Macintosh)                       RTL_TEXTENCODING_APPLE_ROMAN
245 Western (Apple Macintosh/Icelandic)             RTL_TEXTENCODING_APPLE_ICELAND
246 Western (ASCII/US)                              RTL_TEXTENCODING_ASCII_US
247 Western (DOS/OS2-437/US)                        RTL_TEXTENCODING_IBM_437
248 Western (DOS/OS2-850/International)             RTL_TEXTENCODING_IBM_850
249 Western (DOS/OS2-860/Portugese)                 RTL_TEXTENCODING_IBM_860
250 Western (DOS/OS2-861/Icelandic)                 RTL_TEXTENCODING_IBM_861
251 Western (DOS/OS2-863/Canadian-French)           RTL_TEXTENCODING_IBM_863
252 Western (DOS/OS2-865/Nordic)                    RTL_TEXTENCODING_IBM_865
253 Western (ISO-8859-1)                            RTL_TEXTENCODING_ISO_8859_1
254 Western (ISO-8859-14)                           RTL_TEXTENCODING_ISO_8859_14
255 Western (ISO-8859-15/EURO)                      RTL_TEXTENCODING_ISO_8859_15
256 Western (Window-1252/WinLatin 1)                RTL_TEXTENCODING_MS_1252
257 
258 Not known and currently not supported
259 # RTL_TEXTENCODING_APPLE_DEVANAGARI
260 # RTL_TEXTENCODING_APPLE_FARSI
261 # RTL_TEXTENCODING_APPLE_GUJARATI
262 # RTL_TEXTENCODING_APPLE_GURMUKHI
263 
264 Only for internal implementations and not useful for user interface.
265 These encodings are not used for text encodings, only used for
266 font-/textoutput encodings.
267 Japanese (JIS 0201)                             RTL_TEXTENCODING_JISX_0201
268 Japanese (JIS 0208)                             RTL_TEXTENCODING_JISX_0208
269 Japanese (JIS 0212)                             RTL_TEXTENCODING_JISX_0212
270 
271 # Currently not implemented
272 */
273 
274 #endif /* _RTL_TEXTENC_H */
275 
276