강현태

Fix Some

Showing 308 changed files with 4884 additions and 1 deletions
1 -35.05,35,17.5,1,137.85,137.85,137.85,137.85,73.5,89,20,52,75,0.2,100,134.5,83,134.5,83,36,20,0.75,50,15.5,144.5,31.5,9.3,140,3.45,102.5,13.5,13.5,13.5,13.5,2.239,2.239,2.239,1.6,1.4,6.85,1.65,1.24,0.15,0.25,1.4,0.25,3.5,8.75,100,85,2.4,99.9,300,10.75,1.36,0.5,25,88,90,85,5.5,50,44,14.5,1.5,223,50,267,1156,161.5,6.75,15.8,6.75,4.25,350.75,65,40.5,2.25,33.5,29,35,35,88.5,2.2,15,15,6.5,9.15,61.55,140,285,40,4,20,250,100,105,7.15,10.7,6.8,99.5,0.55,37.75,10.5,8.6,10,13.5,4.975,1.25,0.495,57,100,140,8.25,30,300,0.65,132.5,26,550,100,0.02,2.15,5.1,565,7,145
...\ No newline at end of file ...\ No newline at end of file
1 +"1.25-(OH)2 vit D3","ACTH(P)","ADA","Albumin","Aldosterone 0��","Aldosterone 3ȸ����","Aldosterone 30��","Aldosterone 60��","ALP-IU/L","ALP-U/L","ALT (GPT)","Ammonia","Amylase","Anti-thrombin ��-g/L","Anti-thrombin ��-%","Apolipoprotein A1","Apolipoprotein B","Apoliprotein A1","Apoliprotein B","a PTT","AST (GOT)","Basophil","BNP","BUN","C3","C4","Ca","CK","CK-MB","Cl","Cortisol 3ȸ����","Cortisol(S) 0��","Cortisol (S) 30��","Cortisol (S) 60��","Cpep- 0&6m","Cpep- 0m","Cpep- 6m","C-peptide 0��","C-peptide 0&30��","C-peptide 30��","Creatinine","Creatinine 24h (U)","CRP","D-dimer","Digoxin","Direct bilirubin","Eosinophil","ESR","Factor��","FBS(B)","FDP","Ferritin(S)","Fibrinogen","Folate(S)","Free-T4(S)","GAD-Ab","GGT","Glucose","Glucose(POCT)","Glucose pp2","HbA1C(B)","HDL-cholesterol","Hematocrit","Hemoglobin","hs-CRP","Ig A","Ig E","IGF-1(S)","Ig G","Ig M","Insulin 0��","Insulin 2ȸ����","Insulin 30��","K","LD","LDL-cholesterol","Lipase","LUC","Lymphocyte","MCH","MCHC-%","MCHC-g/dL","MCV","Mg","Micro-Alb(spot)","Micro-Alb(spot) new","Monocyte","MPV","Myoglobin","Na","Osmol(S)","Parathyroid hormone","Phosphorus","PIVKA-II","Platelet count","PP2Hr(B)","Prolactin (S)","Protein","PT %","PTH related peptide","PTH(S)","PT INR","PT sec","RA factor","% ratio","RBC","Reticulocyte count","RPR","Seg. neutrophil","s-iron","T3(S)","T4(S)","TG-Ab(S)","TIBC","Total bilirubin","Total cholesterol","Total CO2","Total lipid","Triglyceride","Troponin-I","TSH(S)","Uric acid","Vit-B12(S)","WBC","��1-Antitrypsin"
2 +35.05,35,17.5,1,137.85,137.85,137.85,137.85,73.5,89,20,52,75,0.2,100,134.5,83,134.5,83,36,20,0.75,50,15.5,144.5,31.5,9.3,140,3.45,102.5,13.5,13.5,13.5,13.5,2.239,2.239,2.239,1.6,1.4,6.85,1.65,1.24,0.15,0.25,1.4,0.25,3.5,8.75,100,85,2.4,99.9,300,10.75,1.36,0.5,25,88,90,85,5.5,50,44,14.5,1.5,223,50,267,1156,161.5,6.75,15.8,6.75,4.25,350.75,65,40.5,2.25,33.5,29,35,35,88.5,2.2,15,15,6.5,9.15,61.55,140,285,40,4,20,250,100,7.15,6.8,99.5,0.55,37.75,10.5,8.6,10,13.5,4.975,1.25,0.495,57,100,140,8.25,30,300,0.65,132.5,26,550,100,0.02,2.15,5.1,565,7,145
......
1 +deps/libiconv/tests
...\ No newline at end of file ...\ No newline at end of file
1 +node-iconv license
2 +==============================================================================
3 +Copyright (c) 2013, Ben Noordhuis <info@bnoordhuis.nl>
4 +
5 +Permission to use, copy, modify, and/or distribute this software for any
6 +purpose with or without fee is hereby granted, provided that the above
7 +copyright notice and this permission notice appear in all copies.
8 +
9 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 +
17 +
18 +GNU libiconv license
19 +==============================================================================
20 +Copyright (C) 2000-2009, 2011 Free Software Foundation, Inc.
21 +
22 +This program is free software: you can redistribute it and/or modify
23 +it under the terms of the GNU General Public License as published by
24 +the Free Software Foundation; either version 3 of the License, or
25 +(at your option) any later version.
26 +
27 +This program is distributed in the hope that it will be useful,
28 +but WITHOUT ANY WARRANTY; without even the implied warranty of
29 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 +GNU General Public License for more details.
31 +
32 +You should have received a copy of the GNU General Public License
33 +along with this program. If not, see <http://www.gnu.org/licenses/>.
1 +# node-iconv
2 +
3 +Text recoding in JavaScript for fun and profit!
4 +
5 +## Supported encodings
6 +
7 + European languages
8 + ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16},
9 + KOI8-R, KOI8-U, KOI8-RU,
10 + CP{437,737,775,850,852,853,855,857,858,860,861,863,865,866,869}
11 + CP{1125,1250,1251,1252,1253,1254,1257}
12 + Mac{Roman,CentralEurope,Iceland,Croatian,Romania},
13 + Mac{Cyrillic,Ukraine,Greek,Turkish},
14 + Macintosh
15 + Semitic languages
16 + ISO-8859-{6,8}, CP{1255,1256}, CP862, CP864, Mac{Hebrew,Arabic}
17 + Japanese
18 + EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-JP-1
19 + EUC-JISX0213, Shift_JISX0213, ISO-2022-JP-3
20 + Chinese
21 + EUC-CN, HZ, GBK, CP936, GB18030, EUC-TW, BIG5, CP950, BIG5-HKSCS,
22 + BIG5-HKSCS:2004, BIG5-HKSCS:2001, BIG5-HKSCS:1999, ISO-2022-CN,
23 + ISO-2022-CN-EXT, BIG5-2003 (experimental)
24 + Korean
25 + EUC-KR, CP949, ISO-2022-KR, JOHAB
26 + Turkmen
27 + TDS565
28 + Armenian
29 + ARMSCII-8
30 + Georgian
31 + Georgian-Academy, Georgian-PS
32 + Tajik
33 + KOI8-T
34 + Kazakh
35 + PT154, RK1048
36 + Thai
37 + ISO-8859-11, TIS-620, CP874, MacThai
38 + Laotian
39 + MuleLao-1, CP1133
40 + Vietnamese
41 + VISCII, TCVN, CP1258
42 + Platform specifics
43 + HP-ROMAN8, NEXTSTEP, ATARIST, RISCOS-LATIN1
44 + Full Unicode
45 + UTF-8
46 + UCS-2, UCS-2BE, UCS-2LE
47 + UCS-4, UCS-4BE, UCS-4LE
48 + UTF-16, UTF-16BE, UTF-16LE
49 + UTF-32, UTF-32BE, UTF-32LE
50 + UTF-7
51 + C99, JAVA
52 + Full Unicode, in terms of `uint16_t` or `uint32_t`
53 + (with machine dependent endianness and alignment)
54 + UCS-2-INTERNAL, UCS-4-INTERNAL
55 + Locale dependent, in terms of `char` or `wchar_t`
56 + (with machine dependent endianness and alignment, and with OS and
57 + locale dependent semantics)
58 + char, wchar_t
59 + The empty encoding name "" is equivalent to "char": it denotes the
60 + locale dependent character encoding.
61 +
62 +If you don't need the full gamut of encodings, consider using [iconv-lite][].
63 +It supports most common encodings and doesn't require a compiler to install.
64 +
65 +## Installing with [npm](http://npmjs.org/)
66 +
67 + $ npm install iconv
68 +
69 +Note that you do not need to have a copy of libiconv installed to use this
70 +module.
71 +
72 +## Compiling from source
73 +
74 + $ git clone git://github.com/bnoordhuis/node-iconv.git
75 + $ cd node-iconv
76 + $ npm install
77 +
78 +If you have a specific node.js source checkout that you want to build against,
79 +replace the last command with:
80 +
81 + $ npm install --nodedir=/path/to/node
82 +
83 +## Usage
84 +
85 +Encode from one character encoding to another:
86 +
87 + // convert from UTF-8 to ISO-8859-1
88 + var Buffer = require('buffer').Buffer;
89 + var Iconv = require('iconv').Iconv;
90 + var assert = require('assert');
91 +
92 + var iconv = new Iconv('UTF-8', 'ISO-8859-1');
93 + var buffer = iconv.convert('Hello, world!');
94 + var buffer2 = iconv.convert(new Buffer('Hello, world!'));
95 + assert.equals(buffer.inspect(), buffer2.inspect());
96 + // do something useful with the buffers
97 +
98 +A simple ISO-8859-1 to UTF-8 conversion TCP service:
99 +
100 + var net = require('net');
101 + var Iconv = require('iconv').Iconv;
102 + var server = net.createServer(function(conn) {
103 + var iconv = new Iconv('latin1', 'utf-8');
104 + conn.pipe(iconv).pipe(conn);
105 + });
106 + server.listen(8000);
107 + console.log('Listening on tcp://0.0.0.0:8000/');
108 +
109 +Look at test/test-basic.js and test/test-stream.js for more examples
110 +and node-iconv's behaviour under error conditions.
111 +
112 +## Notes
113 +
114 +Things to keep in mind when you work with node-iconv.
115 +
116 +### Chunked data
117 +
118 +Say you are reading data in chunks from a HTTP stream. The logical input is a
119 +single document (the full POST request data) but the physical input will be
120 +spread over several buffers (the request chunks).
121 +
122 +You must accumulate the small buffers into a single large buffer before
123 +performing the conversion. If you don't, you will get unexpected results with
124 +multi-byte and stateful character sets like UTF-8 and ISO-2022-JP.
125 +
126 +The above only applies when you are calling `Iconv#convert()` yourself.
127 +If you use the streaming interface, node-iconv takes care of stitching
128 +partial character sequences together again.
129 +
130 +### Dealing with untranslatable characters
131 +
132 +Characters are not always translatable to another encoding. The UTF-8 string
133 +"ça va が", for example, cannot be represented in plain 7-bits ASCII without
134 +some loss of fidelity.
135 +
136 +By default, node-iconv throws EILSEQ when untranslatabe characters are
137 +encountered but this can be customized. Quoting the `iconv_open(3)` man page:
138 +
139 + //TRANSLIT
140 + When the string "//TRANSLIT" is appended to tocode, transliteration is
141 + activated. This means that when a character cannot be represented in the
142 + target character set, it can be approximated through one or several
143 + similarly looking characters.
144 +
145 + //IGNORE
146 + When the string "//IGNORE" is appended to tocode, characters that cannot be
147 + represented in the target character set will be silently discarded.
148 +
149 +Example usage:
150 +
151 + var iconv = new Iconv('UTF-8', 'ASCII');
152 + iconv.convert('ça va'); // throws EILSEQ
153 +
154 + var iconv = new Iconv('UTF-8', 'ASCII//IGNORE');
155 + iconv.convert('ça va'); // returns "a va"
156 +
157 + var iconv = new Iconv('UTF-8', 'ASCII//TRANSLIT');
158 + iconv.convert('ça va'); // "ca va"
159 +
160 + var iconv = new Iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE');
161 + iconv.convert('ça va が'); // "ca va "
162 +
163 +### EINVAL
164 +
165 +EINVAL is raised when the input ends in a partial character sequence. This is a
166 +feature, not a bug.
167 +
168 +[iconv-lite]: https://www.npmjs.org/package/iconv-lite
1 +{
2 + 'variables': {
3 + 'node_iconv_use_system_libiconv%': 0,
4 + },
5 +
6 + 'targets': [
7 + {
8 + 'target_name': 'iconv',
9 + 'include_dirs': ['<!(node -e "require(\'nan\')")'],
10 + 'sources': ['src/binding.cc'],
11 + 'ccflags': [
12 + '-Wall',
13 + '-Wextra',
14 + '-Wno-unused-parameter', # Squelches warnings coming from v8.h.
15 + '-fno-exceptions',
16 + '-fno-rtti',
17 + ],
18 + # Have to repeat flags on mac because of gyp's xcode emulation "feature".
19 + 'xcode_settings': {
20 + 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
21 + 'GCC_ENABLE_CPP_RTTI': 'NO',
22 + 'WARNING_CFLAGS': ['-Wall', '-Wextra', '-Wno-unused-parameter'],
23 + },
24 + 'conditions': [
25 + ['node_iconv_use_system_libiconv==0', {
26 + 'defines': ['ICONV_CONST=const', 'ENABLE_EXTRA=1'],
27 + 'include_dirs': ['support'],
28 + 'sources': [
29 + 'deps/libiconv/lib/iconv.c',
30 + 'support/localcharset.c',
31 + ],
32 + 'cflags!': ['-W', '-Wall', '-Wextra'],
33 + 'msvs_settings': {
34 + 'VCCLCompilerTool': {
35 + 'DisableSpecificWarnings': [
36 + '4018', # Signed/unsigned comparison.
37 + '4090', # Const/non-const mismatch.
38 + '4244', # Narrowing cast.
39 + '4267', # Narrowing cast.
40 + ],
41 + },
42 + },
43 + 'xcode_settings': {
44 + 'WARNING_CFLAGS!': ['-W', '-Wall', '-Wextra'],
45 + 'WARNING_CFLAGS': [
46 + '-Wno-parentheses-equality',
47 + '-Wno-static-in-inline',
48 + '-Wno-tautological-compare',
49 + ],
50 + },
51 + }],
52 + ],
53 + },
54 + ],
55 +}
This diff is collapsed. Click to expand it.
1 +cmd_Release/iconv.node := rm -rf "Release/iconv.node" && cp -af "Release/obj.target/iconv.node" "Release/iconv.node"
1 +cmd_Release/obj.target/iconv.node := g++ -shared -pthread -rdynamic -m64 -Wl,-soname=iconv.node -o Release/obj.target/iconv.node -Wl,--start-group Release/obj.target/iconv/src/binding.o Release/obj.target/iconv/deps/libiconv/lib/iconv.o Release/obj.target/iconv/support/localcharset.o -Wl,--end-group
1 +cmd_Release/obj.target/iconv/src/binding.o := g++ '-DNODE_GYP_MODULE_NAME=iconv' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DICONV_CONST=const' '-DENABLE_EXTRA=1' '-DBUILDING_NODE_EXTENSION' -I/home/swc/.node-gyp/8.11.2/include/node -I/home/swc/.node-gyp/8.11.2/src -I/home/swc/.node-gyp/8.11.2/deps/uv/include -I/home/swc/.node-gyp/8.11.2/deps/v8/include -I../../nan -I../support -fPIC -pthread -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF ./Release/.deps/Release/obj.target/iconv/src/binding.o.d.raw -c -o Release/obj.target/iconv/src/binding.o ../src/binding.cc
2 +Release/obj.target/iconv/src/binding.o: ../src/binding.cc \
3 + ../support/iconv.h ../../nan/nan.h \
4 + /home/swc/.node-gyp/8.11.2/include/node/node_version.h \
5 + /home/swc/.node-gyp/8.11.2/include/node/uv.h \
6 + /home/swc/.node-gyp/8.11.2/include/node/uv-errno.h \
7 + /home/swc/.node-gyp/8.11.2/include/node/uv-version.h \
8 + /home/swc/.node-gyp/8.11.2/include/node/uv-unix.h \
9 + /home/swc/.node-gyp/8.11.2/include/node/uv-threadpool.h \
10 + /home/swc/.node-gyp/8.11.2/include/node/uv-linux.h \
11 + /home/swc/.node-gyp/8.11.2/include/node/node.h \
12 + /home/swc/.node-gyp/8.11.2/include/node/v8.h \
13 + /home/swc/.node-gyp/8.11.2/include/node/v8-version.h \
14 + /home/swc/.node-gyp/8.11.2/include/node/v8config.h \
15 + /home/swc/.node-gyp/8.11.2/include/node/node_version.h \
16 + /home/swc/.node-gyp/8.11.2/include/node/node_buffer.h \
17 + /home/swc/.node-gyp/8.11.2/include/node/node.h \
18 + /home/swc/.node-gyp/8.11.2/include/node/node_object_wrap.h \
19 + ../../nan/nan_callbacks.h ../../nan/nan_callbacks_12_inl.h \
20 + ../../nan/nan_maybe_43_inl.h ../../nan/nan_converters.h \
21 + ../../nan/nan_converters_43_inl.h ../../nan/nan_new.h \
22 + ../../nan/nan_implementation_12_inl.h ../../nan/nan_persistent_12_inl.h \
23 + ../../nan/nan_weak.h ../../nan/nan_object_wrap.h ../../nan/nan_private.h \
24 + ../../nan/nan_typedarray_contents.h ../../nan/nan_json.h
25 +../src/binding.cc:
26 +../support/iconv.h:
27 +../../nan/nan.h:
28 +/home/swc/.node-gyp/8.11.2/include/node/node_version.h:
29 +/home/swc/.node-gyp/8.11.2/include/node/uv.h:
30 +/home/swc/.node-gyp/8.11.2/include/node/uv-errno.h:
31 +/home/swc/.node-gyp/8.11.2/include/node/uv-version.h:
32 +/home/swc/.node-gyp/8.11.2/include/node/uv-unix.h:
33 +/home/swc/.node-gyp/8.11.2/include/node/uv-threadpool.h:
34 +/home/swc/.node-gyp/8.11.2/include/node/uv-linux.h:
35 +/home/swc/.node-gyp/8.11.2/include/node/node.h:
36 +/home/swc/.node-gyp/8.11.2/include/node/v8.h:
37 +/home/swc/.node-gyp/8.11.2/include/node/v8-version.h:
38 +/home/swc/.node-gyp/8.11.2/include/node/v8config.h:
39 +/home/swc/.node-gyp/8.11.2/include/node/node_version.h:
40 +/home/swc/.node-gyp/8.11.2/include/node/node_buffer.h:
41 +/home/swc/.node-gyp/8.11.2/include/node/node.h:
42 +/home/swc/.node-gyp/8.11.2/include/node/node_object_wrap.h:
43 +../../nan/nan_callbacks.h:
44 +../../nan/nan_callbacks_12_inl.h:
45 +../../nan/nan_maybe_43_inl.h:
46 +../../nan/nan_converters.h:
47 +../../nan/nan_converters_43_inl.h:
48 +../../nan/nan_new.h:
49 +../../nan/nan_implementation_12_inl.h:
50 +../../nan/nan_persistent_12_inl.h:
51 +../../nan/nan_weak.h:
52 +../../nan/nan_object_wrap.h:
53 +../../nan/nan_private.h:
54 +../../nan/nan_typedarray_contents.h:
55 +../../nan/nan_json.h:
1 +cmd_Release/obj.target/iconv/support/localcharset.o := cc '-DNODE_GYP_MODULE_NAME=iconv' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DICONV_CONST=const' '-DENABLE_EXTRA=1' '-DBUILDING_NODE_EXTENSION' -I/home/swc/.node-gyp/8.11.2/include/node -I/home/swc/.node-gyp/8.11.2/src -I/home/swc/.node-gyp/8.11.2/deps/uv/include -I/home/swc/.node-gyp/8.11.2/deps/v8/include -I../../nan -I../support -fPIC -pthread -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/iconv/support/localcharset.o.d.raw -c -o Release/obj.target/iconv/support/localcharset.o ../support/localcharset.c
2 +Release/obj.target/iconv/support/localcharset.o: \
3 + ../support/localcharset.c ../support/localcharset.h
4 +../support/localcharset.c:
5 +../support/localcharset.h:
No preview for this file type
1 +# This file is generated by gyp; do not edit.
2 +
3 +export builddir_name ?= ./build/.
4 +.PHONY: all
5 +all:
6 + $(MAKE) iconv
1 +# Do not edit. File was generated by node-gyp's "configure" step
2 +{
3 + "target_defaults": {
4 + "cflags": [],
5 + "default_configuration": "Release",
6 + "defines": [],
7 + "include_dirs": [],
8 + "libraries": []
9 + },
10 + "variables": {
11 + "asan": 0,
12 + "coverage": "false",
13 + "debug_devtools": "node",
14 + "debug_http2": "false",
15 + "debug_nghttp2": "false",
16 + "force_dynamic_crt": 0,
17 + "gas_version": "2.23",
18 + "host_arch": "x64",
19 + "icu_data_file": "icudt60l.dat",
20 + "icu_data_in": "../../deps/icu-small/source/data/in/icudt60l.dat",
21 + "icu_endianness": "l",
22 + "icu_gyp_path": "tools/icu/icu-generic.gyp",
23 + "icu_locales": "en,root",
24 + "icu_path": "deps/icu-small",
25 + "icu_small": "true",
26 + "icu_ver_major": "60",
27 + "llvm_version": 0,
28 + "node_byteorder": "little",
29 + "node_enable_d8": "false",
30 + "node_enable_v8_vtunejit": "false",
31 + "node_install_npm": "true",
32 + "node_module_version": 57,
33 + "node_no_browser_globals": "false",
34 + "node_prefix": "/",
35 + "node_release_urlbase": "https://nodejs.org/download/release/",
36 + "node_shared": "false",
37 + "node_shared_cares": "false",
38 + "node_shared_http_parser": "false",
39 + "node_shared_libuv": "false",
40 + "node_shared_nghttp2": "false",
41 + "node_shared_openssl": "false",
42 + "node_shared_zlib": "false",
43 + "node_tag": "",
44 + "node_target_type": "executable",
45 + "node_use_bundled_v8": "true",
46 + "node_use_dtrace": "false",
47 + "node_use_etw": "false",
48 + "node_use_lttng": "false",
49 + "node_use_openssl": "true",
50 + "node_use_perfctr": "false",
51 + "node_use_v8_platform": "true",
52 + "node_without_node_options": "false",
53 + "openssl_fips": "",
54 + "openssl_no_asm": 0,
55 + "shlib_suffix": "so.57",
56 + "target_arch": "x64",
57 + "uv_parent_path": "/deps/uv/",
58 + "uv_use_dtrace": "false",
59 + "v8_enable_gdbjit": 0,
60 + "v8_enable_i18n_support": 1,
61 + "v8_enable_inspector": 1,
62 + "v8_no_strict_aliasing": 1,
63 + "v8_optimized_debug": 0,
64 + "v8_promise_internal_field_count": 1,
65 + "v8_random_seed": 0,
66 + "v8_trace_maps": 0,
67 + "v8_use_snapshot": "true",
68 + "want_separate_host_toolset": 0,
69 + "nodedir": "/home/swc/.node-gyp/8.11.2",
70 + "standalone_static_library": 1,
71 + "cache_lock_stale": "60000",
72 + "ham_it_up": "",
73 + "legacy_bundling": "",
74 + "sign_git_tag": "",
75 + "user_agent": "npm/5.6.0 node/v8.11.2 linux x64",
76 + "always_auth": "",
77 + "bin_links": "true",
78 + "key": "",
79 + "allow_same_version": "",
80 + "description": "true",
81 + "fetch_retries": "2",
82 + "heading": "npm",
83 + "if_present": "",
84 + "init_version": "1.0.0",
85 + "user": "",
86 + "prefer_online": "",
87 + "force": "",
88 + "only": "",
89 + "read_only": "",
90 + "cache_min": "10",
91 + "init_license": "ISC",
92 + "editor": "vi",
93 + "rollback": "true",
94 + "tag_version_prefix": "v",
95 + "cache_max": "Infinity",
96 + "timing": "",
97 + "userconfig": "/home/swc/.npmrc",
98 + "engine_strict": "",
99 + "init_author_name": "",
100 + "init_author_url": "",
101 + "tmp": "/tmp",
102 + "depth": "Infinity",
103 + "package_lock_only": "",
104 + "save_dev": "",
105 + "usage": "",
106 + "metrics_registry": "https://registry.npmjs.org/",
107 + "otp": "",
108 + "package_lock": "true",
109 + "progress": "true",
110 + "https_proxy": "",
111 + "save_prod": "",
112 + "cidr": "",
113 + "onload_script": "",
114 + "sso_type": "oauth",
115 + "rebuild_bundle": "true",
116 + "save_bundle": "",
117 + "shell": "/bin/bash",
118 + "dry_run": "",
119 + "prefix": "/usr",
120 + "scope": "",
121 + "browser": "",
122 + "cache_lock_wait": "10000",
123 + "ignore_prepublish": "",
124 + "registry": "https://registry.npmjs.org/",
125 + "save_optional": "",
126 + "searchopts": "",
127 + "versions": "",
128 + "cache": "/home/swc/.npm",
129 + "send_metrics": "",
130 + "global_style": "",
131 + "ignore_scripts": "",
132 + "version": "",
133 + "local_address": "",
134 + "viewer": "man",
135 + "node_gyp": "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",
136 + "prefer_offline": "",
137 + "color": "true",
138 + "fetch_retry_mintimeout": "10000",
139 + "maxsockets": "50",
140 + "offline": "",
141 + "sso_poll_frequency": "500",
142 + "umask": "0002",
143 + "fetch_retry_maxtimeout": "60000",
144 + "logs_max": "10",
145 + "message": "%s",
146 + "ca": "",
147 + "cert": "",
148 + "global": "",
149 + "link": "",
150 + "access": "",
151 + "also": "",
152 + "save": "true",
153 + "unicode": "true",
154 + "long": "",
155 + "production": "",
156 + "searchlimit": "20",
157 + "unsafe_perm": "true",
158 + "auth_type": "legacy",
159 + "node_version": "8.11.2",
160 + "tag": "latest",
161 + "git_tag_version": "true",
162 + "commit_hooks": "true",
163 + "script_shell": "",
164 + "shrinkwrap": "true",
165 + "fetch_retry_factor": "10",
166 + "save_exact": "",
167 + "strict_ssl": "true",
168 + "dev": "",
169 + "globalconfig": "/usr/etc/npmrc",
170 + "init_module": "/home/swc/.npm-init.js",
171 + "parseable": "",
172 + "globalignorefile": "/usr/etc/npmignore",
173 + "cache_lock_retries": "10",
174 + "searchstaleness": "900",
175 + "node_options": "",
176 + "save_prefix": "^",
177 + "scripts_prepend_node_path": "warn-only",
178 + "group": "1002",
179 + "init_author_email": "",
180 + "searchexclude": "",
181 + "git": "git",
182 + "optional": "true",
183 + "json": ""
184 + }
185 +}
1 +# This file is generated by gyp; do not edit.
2 +
3 +TOOLSET := target
4 +TARGET := iconv
5 +DEFS_Debug := \
6 + '-DNODE_GYP_MODULE_NAME=iconv' \
7 + '-DUSING_UV_SHARED=1' \
8 + '-DUSING_V8_SHARED=1' \
9 + '-DV8_DEPRECATION_WARNINGS=1' \
10 + '-D_LARGEFILE_SOURCE' \
11 + '-D_FILE_OFFSET_BITS=64' \
12 + '-DICONV_CONST=const' \
13 + '-DENABLE_EXTRA=1' \
14 + '-DBUILDING_NODE_EXTENSION' \
15 + '-DDEBUG' \
16 + '-D_DEBUG' \
17 + '-DV8_ENABLE_CHECKS'
18 +
19 +# Flags passed to all source files.
20 +CFLAGS_Debug := \
21 + -fPIC \
22 + -pthread \
23 + -Wno-unused-parameter \
24 + -m64 \
25 + -g \
26 + -O0
27 +
28 +# Flags passed to only C files.
29 +CFLAGS_C_Debug :=
30 +
31 +# Flags passed to only C++ files.
32 +CFLAGS_CC_Debug := \
33 + -fno-rtti \
34 + -fno-exceptions \
35 + -std=gnu++0x
36 +
37 +INCS_Debug := \
38 + -I/home/swc/.node-gyp/8.11.2/include/node \
39 + -I/home/swc/.node-gyp/8.11.2/src \
40 + -I/home/swc/.node-gyp/8.11.2/deps/uv/include \
41 + -I/home/swc/.node-gyp/8.11.2/deps/v8/include \
42 + -I$(srcdir)/../nan \
43 + -I$(srcdir)/support
44 +
45 +DEFS_Release := \
46 + '-DNODE_GYP_MODULE_NAME=iconv' \
47 + '-DUSING_UV_SHARED=1' \
48 + '-DUSING_V8_SHARED=1' \
49 + '-DV8_DEPRECATION_WARNINGS=1' \
50 + '-D_LARGEFILE_SOURCE' \
51 + '-D_FILE_OFFSET_BITS=64' \
52 + '-DICONV_CONST=const' \
53 + '-DENABLE_EXTRA=1' \
54 + '-DBUILDING_NODE_EXTENSION'
55 +
56 +# Flags passed to all source files.
57 +CFLAGS_Release := \
58 + -fPIC \
59 + -pthread \
60 + -Wno-unused-parameter \
61 + -m64 \
62 + -O3 \
63 + -fno-omit-frame-pointer
64 +
65 +# Flags passed to only C files.
66 +CFLAGS_C_Release :=
67 +
68 +# Flags passed to only C++ files.
69 +CFLAGS_CC_Release := \
70 + -fno-rtti \
71 + -fno-exceptions \
72 + -std=gnu++0x
73 +
74 +INCS_Release := \
75 + -I/home/swc/.node-gyp/8.11.2/include/node \
76 + -I/home/swc/.node-gyp/8.11.2/src \
77 + -I/home/swc/.node-gyp/8.11.2/deps/uv/include \
78 + -I/home/swc/.node-gyp/8.11.2/deps/v8/include \
79 + -I$(srcdir)/../nan \
80 + -I$(srcdir)/support
81 +
82 +OBJS := \
83 + $(obj).target/$(TARGET)/src/binding.o \
84 + $(obj).target/$(TARGET)/deps/libiconv/lib/iconv.o \
85 + $(obj).target/$(TARGET)/support/localcharset.o
86 +
87 +# Add to the list of files we specially track dependencies for.
88 +all_deps += $(OBJS)
89 +
90 +# CFLAGS et al overrides must be target-local.
91 +# See "Target-specific Variable Values" in the GNU Make manual.
92 +$(OBJS): TOOLSET := $(TOOLSET)
93 +$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
94 +$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
95 +
96 +# Suffix rules, putting all outputs into $(obj).
97 +
98 +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
99 + @$(call do_cmd,cxx,1)
100 +
101 +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
102 + @$(call do_cmd,cc,1)
103 +
104 +# Try building from generated source, too.
105 +
106 +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
107 + @$(call do_cmd,cxx,1)
108 +
109 +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
110 + @$(call do_cmd,cc,1)
111 +
112 +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
113 + @$(call do_cmd,cxx,1)
114 +
115 +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD
116 + @$(call do_cmd,cc,1)
117 +
118 +# End of this set of suffix rules
119 +### Rules for final target.
120 +LDFLAGS_Debug := \
121 + -pthread \
122 + -rdynamic \
123 + -m64
124 +
125 +LDFLAGS_Release := \
126 + -pthread \
127 + -rdynamic \
128 + -m64
129 +
130 +LIBS :=
131 +
132 +$(obj).target/iconv.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
133 +$(obj).target/iconv.node: LIBS := $(LIBS)
134 +$(obj).target/iconv.node: TOOLSET := $(TOOLSET)
135 +$(obj).target/iconv.node: $(OBJS) FORCE_DO_CMD
136 + $(call do_cmd,solink_module)
137 +
138 +all_deps += $(obj).target/iconv.node
139 +# Add target alias
140 +.PHONY: iconv
141 +iconv: $(builddir)/iconv.node
142 +
143 +# Copy this to the executable output path.
144 +$(builddir)/iconv.node: TOOLSET := $(TOOLSET)
145 +$(builddir)/iconv.node: $(obj).target/iconv.node FORCE_DO_CMD
146 + $(call do_cmd,copy)
147 +
148 +all_deps += $(builddir)/iconv.node
149 +# Short alias for building this executable.
150 +.PHONY: iconv.node
151 +iconv.node: $(obj).target/iconv.node $(builddir)/iconv.node
152 +
153 +# Add executable to "all" target.
154 +.PHONY: all
155 +all: $(builddir)/iconv.node
156 +
This diff is collapsed. Click to expand it.
1 +/*
2 + * Copyright (C) 1999-2003, 2008 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +#ifdef USE_AIX
21 +# if defined _AIX
22 +# include "aliases_aix_sysaix.h"
23 +# else
24 +# include "aliases_aix.h"
25 +# endif
26 +#endif
27 +#ifdef USE_OSF1
28 +# if defined __osf__
29 +# include "aliases_osf1_sysosf1.h"
30 +# else
31 +# include "aliases_osf1.h"
32 +# endif
33 +#endif
34 +#ifdef USE_DOS
35 +# include "aliases_dos.h"
36 +#endif
37 +#ifdef USE_EXTRA
38 +# include "aliases_extra.h"
39 +#endif
1 + S(aix_0, "CP856", ei_cp856 )
2 + S(aix_1, "CP922", ei_cp922 )
3 + S(aix_2, "CP943", ei_cp943 )
4 + S(aix_3, "CP1046", ei_cp1046 )
5 + S(aix_4, "CP1124", ei_cp1124 )
6 + S(aix_5, "CP1129", ei_cp1129 )
7 + S(aix_6, "CP1161", ei_cp1161 )
8 + S(aix_7, "IBM1161", ei_cp1161 )
9 + S(aix_8, "IBM-1161", ei_cp1161 )
10 + S(aix_9, "CSIBM1161", ei_cp1161 )
11 + S(aix_10, "CP1162", ei_cp1162 )
12 + S(aix_11, "IBM1162", ei_cp1162 )
13 + S(aix_12, "IBM-1162", ei_cp1162 )
14 + S(aix_13, "CSIBM1162", ei_cp1162 )
15 + S(aix_14, "CP1163", ei_cp1163 )
16 + S(aix_15, "IBM1163", ei_cp1163 )
17 + S(aix_16, "IBM-1163", ei_cp1163 )
18 + S(aix_17, "CSIBM1163", ei_cp1163 )
1 + S(aix_0, "CP856", ei_cp856 )
2 + S(aix_1, "IBM-856", ei_cp856 )
3 + S(aix_2, "CP922", ei_cp922 )
4 + S(aix_3, "IBM-922", ei_cp922 )
5 + S(aix_4, "CP943", ei_cp943 )
6 + S(aix_5, "IBM-943", ei_cp943 )
7 + S(aix_6, "CP1046", ei_cp1046 )
8 + S(aix_7, "IBM-1046", ei_cp1046 )
9 + S(aix_8, "CP1124", ei_cp1124 )
10 + S(aix_9, "IBM-1124", ei_cp1124 )
11 + S(aix_10, "CP1129", ei_cp1129 )
12 + S(aix_11, "IBM-1129", ei_cp1129 )
13 + S(aix_12, "CP1161", ei_cp1161 )
14 + S(aix_13, "IBM1161", ei_cp1161 )
15 + S(aix_14, "IBM-1161", ei_cp1161 )
16 + S(aix_15, "CSIBM1161", ei_cp1161 )
17 + S(aix_16, "CP1162", ei_cp1162 )
18 + S(aix_17, "IBM1162", ei_cp1162 )
19 + S(aix_18, "IBM-1162", ei_cp1162 )
20 + S(aix_19, "CSIBM1162", ei_cp1162 )
21 + S(aix_20, "CP1163", ei_cp1163 )
22 + S(aix_21, "IBM1163", ei_cp1163 )
23 + S(aix_22, "IBM-1163", ei_cp1163 )
24 + S(aix_23, "CSIBM1163", ei_cp1163 )
1 + S(dos_0, "CP437", ei_cp437 )
2 + S(dos_1, "IBM437", ei_cp437 )
3 + S(dos_2, "437", ei_cp437 )
4 + S(dos_3, "CSPC8CODEPAGE437", ei_cp437 )
5 + S(dos_4, "CP737", ei_cp737 )
6 + S(dos_5, "CP775", ei_cp775 )
7 + S(dos_6, "IBM775", ei_cp775 )
8 + S(dos_7, "CSPC775BALTIC", ei_cp775 )
9 + S(dos_8, "CP852", ei_cp852 )
10 + S(dos_9, "IBM852", ei_cp852 )
11 + S(dos_10, "852", ei_cp852 )
12 + S(dos_11, "CSPCP852", ei_cp852 )
13 + S(dos_12, "CP853", ei_cp853 )
14 + S(dos_13, "CP855", ei_cp855 )
15 + S(dos_14, "IBM855", ei_cp855 )
16 + S(dos_15, "855", ei_cp855 )
17 + S(dos_16, "CSIBM855", ei_cp855 )
18 + S(dos_17, "CP857", ei_cp857 )
19 + S(dos_18, "IBM857", ei_cp857 )
20 + S(dos_19, "857", ei_cp857 )
21 + S(dos_20, "CSIBM857", ei_cp857 )
22 + S(dos_21, "CP858", ei_cp858 )
23 + S(dos_22, "CP860", ei_cp860 )
24 + S(dos_23, "IBM860", ei_cp860 )
25 + S(dos_24, "860", ei_cp860 )
26 + S(dos_25, "CSIBM860", ei_cp860 )
27 + S(dos_26, "CP861", ei_cp861 )
28 + S(dos_27, "IBM861", ei_cp861 )
29 + S(dos_28, "861", ei_cp861 )
30 + S(dos_29, "CP-IS", ei_cp861 )
31 + S(dos_30, "CSIBM861", ei_cp861 )
32 + S(dos_31, "CP863", ei_cp863 )
33 + S(dos_32, "IBM863", ei_cp863 )
34 + S(dos_33, "863", ei_cp863 )
35 + S(dos_34, "CSIBM863", ei_cp863 )
36 + S(dos_35, "CP864", ei_cp864 )
37 + S(dos_36, "IBM864", ei_cp864 )
38 + S(dos_37, "CSIBM864", ei_cp864 )
39 + S(dos_38, "CP865", ei_cp865 )
40 + S(dos_39, "IBM865", ei_cp865 )
41 + S(dos_40, "865", ei_cp865 )
42 + S(dos_41, "CSIBM865", ei_cp865 )
43 + S(dos_42, "CP869", ei_cp869 )
44 + S(dos_43, "IBM869", ei_cp869 )
45 + S(dos_44, "869", ei_cp869 )
46 + S(dos_45, "CP-GR", ei_cp869 )
47 + S(dos_46, "CSIBM869", ei_cp869 )
48 + S(dos_47, "CP1125", ei_cp1125 )
1 + S(extra_0, "EUC-JISX0213", ei_euc_jisx0213 )
2 + S(extra_1, "EUC-JIS-2004", ei_euc_jisx0213 )
3 + S(extra_2, "SHIFT_JISX0213", ei_shift_jisx0213 )
4 + S(extra_3, "SHIFT_JIS-2004", ei_shift_jisx0213 )
5 + S(extra_4, "ISO-2022-JP-3", ei_iso2022_jp3 )
6 + S(extra_5, "ISO-2022-JP-2004", ei_iso2022_jp3 )
7 + S(extra_6, "BIG5-2003", ei_big5_2003 )
8 + S(extra_7, "TDS565", ei_tds565 )
9 + S(extra_8, "ISO-IR-230", ei_tds565 )
10 + S(extra_9, "ATARIST", ei_atarist )
11 + S(extra_10, "ATARI", ei_atarist )
12 + S(extra_11, "RISCOS-LATIN1", ei_riscos1 )
1 + S(osf1_0, "DEC-KANJI", ei_dec_kanji )
2 + S(osf1_1, "DEC-HANYU", ei_dec_hanyu )
1 + S(osf1_0, "DEC-KANJI", ei_dec_kanji )
2 + S(osf1_1, "DECKANJI", ei_dec_kanji )
3 + S(osf1_2, "DEC-HANYU", ei_dec_hanyu )
4 + S(osf1_3, "DECHANYU", ei_dec_hanyu )
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*
2 + * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * ARMSCII-8
22 + */
23 +
24 +static const unsigned short armscii_8_2uni[96] = {
25 + /* 0xa0 */
26 + 0x00a0, 0xfffd, 0x0587, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,
27 + 0x2014, 0x002e, 0x055d, 0x002c, 0x002d, 0x058a, 0x2026, 0x055c,
28 + /* 0xb0 */
29 + 0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563,
30 + 0x0534, 0x0564, 0x0535, 0x0565, 0x0536, 0x0566, 0x0537, 0x0567,
31 + /* 0xc0 */
32 + 0x0538, 0x0568, 0x0539, 0x0569, 0x053a, 0x056a, 0x053b, 0x056b,
33 + 0x053c, 0x056c, 0x053d, 0x056d, 0x053e, 0x056e, 0x053f, 0x056f,
34 + /* 0xd0 */
35 + 0x0540, 0x0570, 0x0541, 0x0571, 0x0542, 0x0572, 0x0543, 0x0573,
36 + 0x0544, 0x0574, 0x0545, 0x0575, 0x0546, 0x0576, 0x0547, 0x0577,
37 + /* 0xe0 */
38 + 0x0548, 0x0578, 0x0549, 0x0579, 0x054a, 0x057a, 0x054b, 0x057b,
39 + 0x054c, 0x057c, 0x054d, 0x057d, 0x054e, 0x057e, 0x054f, 0x057f,
40 + /* 0xf0 */
41 + 0x0550, 0x0580, 0x0551, 0x0581, 0x0552, 0x0582, 0x0553, 0x0583,
42 + 0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0xfffd,
43 +};
44 +
45 +static int
46 +armscii_8_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
47 +{
48 + unsigned char c = *s;
49 + if (c < 0xa0) {
50 + *pwc = (ucs4_t) c;
51 + return 1;
52 + }
53 + else {
54 + unsigned short wc = armscii_8_2uni[c-0xa0];
55 + if (wc != 0xfffd) {
56 + *pwc = (ucs4_t) wc;
57 + return 1;
58 + }
59 + }
60 + return RET_ILSEQ;
61 +}
62 +
63 +static const unsigned char armscii_8_page00[8] = {
64 + 0xa5, 0xa4, 0x2a, 0x2b, 0xab, 0xac, 0xa9, 0x2f, /* 0x28-0x2f */
65 +};
66 +static const unsigned char armscii_8_page00_1[32] = {
67 + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
68 + 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
69 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
70 + 0x00, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
71 +};
72 +static const unsigned char armscii_8_page05[96] = {
73 + 0x00, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, /* 0x30-0x37 */
74 + 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, /* 0x38-0x3f */
75 + 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, /* 0x40-0x47 */
76 + 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, /* 0x48-0x4f */
77 + 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0x00, /* 0x50-0x57 */
78 + 0x00, 0x00, 0xfe, 0xb0, 0xaf, 0xaa, 0xb1, 0x00, /* 0x58-0x5f */
79 + 0x00, 0xb3, 0xb5, 0xb7, 0xb9, 0xbb, 0xbd, 0xbf, /* 0x60-0x67 */
80 + 0xc1, 0xc3, 0xc5, 0xc7, 0xc9, 0xcb, 0xcd, 0xcf, /* 0x68-0x6f */
81 + 0xd1, 0xd3, 0xd5, 0xd7, 0xd9, 0xdb, 0xdd, 0xdf, /* 0x70-0x77 */
82 + 0xe1, 0xe3, 0xe5, 0xe7, 0xe9, 0xeb, 0xed, 0xef, /* 0x78-0x7f */
83 + 0xf1, 0xf3, 0xf5, 0xf7, 0xf9, 0xfb, 0xfd, 0xa2, /* 0x80-0x87 */
84 + 0x00, 0xa3, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
85 +};
86 +static const unsigned char armscii_8_page20[24] = {
87 + 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, /* 0x10-0x17 */
88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
89 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x00, /* 0x20-0x27 */
90 +};
91 +
92 +static int
93 +armscii_8_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
94 +{
95 + unsigned char c = 0;
96 + if (wc < 0x0028) {
97 + *r = wc;
98 + return 1;
99 + }
100 + else if (wc >= 0x0028 && wc < 0x0030)
101 + c = armscii_8_page00[wc-0x0028];
102 + else if (wc >= 0x0030 && wc < 0x00a0)
103 + c = wc;
104 + else if (wc >= 0x00a0 && wc < 0x00c0)
105 + c = armscii_8_page00_1[wc-0x00a0];
106 + else if (wc >= 0x0530 && wc < 0x0590)
107 + c = armscii_8_page05[wc-0x0530];
108 + else if (wc >= 0x2010 && wc < 0x2028)
109 + c = armscii_8_page20[wc-0x2010];
110 + if (c != 0) {
111 + *r = c;
112 + return 1;
113 + }
114 + return RET_ILUNI;
115 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * ASCII
22 + */
23 +
24 +static int
25 +ascii_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
26 +{
27 + unsigned char c = *s;
28 + if (c < 0x80) {
29 + *pwc = (ucs4_t) c;
30 + return 1;
31 + }
32 + return RET_ILSEQ;
33 +}
34 +
35 +static int
36 +ascii_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
37 +{
38 + if (wc < 0x0080) {
39 + *r = wc;
40 + return 1;
41 + }
42 + return RET_ILUNI;
43 +}
1 +/*
2 + * Copyright (C) 1999-2005, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * Atari ST
22 + */
23 +
24 +static const unsigned short atarist_2uni[128] = {
25 + /* 0x80 */
26 + 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7,
27 + 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
28 + /* 0x90 */
29 + 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
30 + 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x00df, 0x0192,
31 + /* 0xa0 */
32 + 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba,
33 + 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb,
34 + /* 0xb0 */
35 + 0x00e3, 0x00f5, 0x00d8, 0x00f8, 0x0153, 0x0152, 0x00c0, 0x00c3,
36 + 0x00d5, 0x00a8, 0x00b4, 0x2020, 0x00b6, 0x00a9, 0x00ae, 0x2122,
37 + /* 0xc0 */
38 + 0x0133, 0x0132, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5,
39 + 0x05d6, 0x05d7, 0x05d8, 0x05d9, 0x05db, 0x05dc, 0x05de, 0x05e0,
40 + /* 0xd0 */
41 + 0x05e1, 0x05e2, 0x05e4, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea,
42 + 0x05df, 0x05da, 0x05dd, 0x05e3, 0x05e5, 0x00a7, 0x2227, 0x221e,
43 + /* 0xe0 */
44 + 0x03b1, 0x03b2, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4,
45 + 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x222e, 0x03c6, 0x2208, 0x2229,
46 + /* 0xf0 */
47 + 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248,
48 + 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x00b3, 0x00af,
49 +};
50 +
51 +static int
52 +atarist_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
53 +{
54 + unsigned char c = *s;
55 + if (c < 0x80)
56 + *pwc = (ucs4_t) c;
57 + else
58 + *pwc = (ucs4_t) atarist_2uni[c-0x80];
59 + return 1;
60 +}
61 +
62 +static const unsigned char atarist_page00[96] = {
63 + 0x00, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0xdd, /* 0xa0-0xa7 */
64 + 0xb9, 0xbd, 0xa6, 0xae, 0xaa, 0x00, 0xbe, 0xff, /* 0xa8-0xaf */
65 + 0xf8, 0xf1, 0xfd, 0xfe, 0xba, 0xe6, 0xbc, 0xfa, /* 0xb0-0xb7 */
66 + 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
67 + 0xb6, 0x00, 0x00, 0xb7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
68 + 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
69 + 0x00, 0xa5, 0x00, 0x00, 0x00, 0xb8, 0x99, 0x00, /* 0xd0-0xd7 */
70 + 0xb2, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x9e, /* 0xd8-0xdf */
71 + 0x85, 0xa0, 0x83, 0xb0, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
72 + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
73 + 0x00, 0xa4, 0x95, 0xa2, 0x93, 0xb1, 0x94, 0xf6, /* 0xf0-0xf7 */
74 + 0xb3, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */
75 +};
76 +static const unsigned char atarist_page01[104] = {
77 + 0x00, 0x00, 0xc1, 0xc0, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
78 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
79 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
81 + 0x00, 0x00, 0xb5, 0xb4, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
82 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
83 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
84 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
85 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
86 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
87 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
89 + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
90 +};
91 +static const unsigned char atarist_page03[56] = {
92 + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
93 + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
94 + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
95 + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
96 + 0x00, 0xe0, 0xe1, 0x00, 0xeb, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
98 + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
99 +};
100 +static const unsigned char atarist_page05[32] = {
101 + 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* 0xd0-0xd7 */
102 + 0xca, 0xcb, 0xd9, 0xcc, 0xcd, 0xda, 0xce, 0xd8, /* 0xd8-0xdf */
103 + 0xcf, 0xd0, 0xd1, 0xdb, 0xd2, 0xdc, 0xd3, 0xd4, /* 0xe0-0xe7 */
104 + 0xd5, 0xd6, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
105 +};
106 +static const unsigned char atarist_page22[96] = {
107 + 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
108 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
109 + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xdf, 0x00, /* 0x18-0x1f */
110 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, /* 0x20-0x27 */
111 + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x28-0x2f */
112 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
113 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
114 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
115 + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
116 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
117 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
118 + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
119 +};
120 +static const unsigned char atarist_page23[24] = {
121 + 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
122 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
123 + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
124 +};
125 +
126 +static int
127 +atarist_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
128 +{
129 + unsigned char c = 0;
130 + if (wc < 0x0080) {
131 + *r = wc;
132 + return 1;
133 + }
134 + else if (wc >= 0x00a0 && wc < 0x0100)
135 + c = atarist_page00[wc-0x00a0];
136 + else if (wc >= 0x0130 && wc < 0x0198)
137 + c = atarist_page01[wc-0x0130];
138 + else if (wc >= 0x0390 && wc < 0x03c8)
139 + c = atarist_page03[wc-0x0390];
140 + else if (wc >= 0x05d0 && wc < 0x05f0)
141 + c = atarist_page05[wc-0x05d0];
142 + else if (wc == 0x2020)
143 + c = 0xbb;
144 + else if (wc == 0x207f)
145 + c = 0xfc;
146 + else if (wc == 0x2122)
147 + c = 0xbf;
148 + else if (wc >= 0x2208 && wc < 0x2268)
149 + c = atarist_page22[wc-0x2208];
150 + else if (wc >= 0x2310 && wc < 0x2328)
151 + c = atarist_page23[wc-0x2310];
152 + if (c != 0) {
153 + *r = c;
154 + return 1;
155 + }
156 + return RET_ILUNI;
157 +}
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 +/*
2 + * Copyright (C) 1999-2002, 2006, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * BIG5-HKSCS:1999
22 + */
23 +
24 +/*
25 + * BIG5-HKSCS:1999 can be downloaded from
26 + * http://www.info.gov.hk/digital21/eng/hkscs/download.html
27 + * http://www.info.gov.hk/digital21/eng/hkscs/index.html
28 + *
29 + * It extends BIG5 (without the rows 0xC6..0xC7) through the ranges
30 + *
31 + * 0x{88..8D}{40..7E,A1..FE} 641 characters
32 + * 0x{8E..A0}{40..7E,A1..FE} 2898 characters
33 + * 0x{C6..C8}{40..7E,A1..FE} 359 characters
34 + * 0xF9{D6..FE} 41 characters
35 + * 0x{FA..FE}{40..7E,A1..FE} 763 characters
36 + *
37 + * Note that some HKSCS characters are not contained in Unicode 3.2
38 + * and are therefore best represented as sequences of Unicode characters:
39 + * 0x8862 U+00CA U+0304 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND MACRON
40 + * 0x8864 U+00CA U+030C LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND CARON
41 + * 0x88A3 U+00EA U+0304 LATIN SMALL LETTER E WITH CIRCUMFLEX AND MACRON
42 + * 0x88A5 U+00EA U+030C LATIN SMALL LETTER E WITH CIRCUMFLEX AND CARON
43 + */
44 +
45 +#include "hkscs1999.h"
46 +#include "flushwc.h"
47 +
48 +static int
49 +big5hkscs1999_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
50 +{
51 + ucs4_t last_wc = conv->istate;
52 + if (last_wc) {
53 + /* Output the buffered character. */
54 + conv->istate = 0;
55 + *pwc = last_wc;
56 + return 0; /* Don't advance the input pointer. */
57 + } else {
58 + unsigned char c = *s;
59 + /* Code set 0 (ASCII) */
60 + if (c < 0x80)
61 + return ascii_mbtowc(conv,pwc,s,n);
62 + /* Code set 1 (BIG5 extended) */
63 + if (c >= 0xa1 && c < 0xff) {
64 + if (n < 2)
65 + return RET_TOOFEW(0);
66 + {
67 + unsigned char c2 = s[1];
68 + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {
69 + if (!((c == 0xc6 && c2 >= 0xa1) || c == 0xc7)) {
70 + int ret = big5_mbtowc(conv,pwc,s,2);
71 + if (ret != RET_ILSEQ)
72 + return ret;
73 + }
74 + }
75 + }
76 + }
77 + {
78 + int ret = hkscs1999_mbtowc(conv,pwc,s,n);
79 + if (ret != RET_ILSEQ)
80 + return ret;
81 + }
82 + if (c == 0x88) {
83 + if (n < 2)
84 + return RET_TOOFEW(0);
85 + {
86 + unsigned char c2 = s[1];
87 + if (c2 == 0x62 || c2 == 0x64 || c2 == 0xa3 || c2 == 0xa5) {
88 + /* It's a composed character. */
89 + ucs4_t wc1 = ((c2 >> 3) << 2) + 0x009a; /* = 0x00ca or 0x00ea */
90 + ucs4_t wc2 = ((c2 & 6) << 2) + 0x02fc; /* = 0x0304 or 0x030c */
91 + /* We cannot output two Unicode characters at once. So,
92 + output the first character and buffer the second one. */
93 + *pwc = wc1;
94 + conv->istate = wc2;
95 + return 2;
96 + }
97 + }
98 + }
99 + return RET_ILSEQ;
100 + }
101 +}
102 +
103 +#define big5hkscs1999_flushwc normal_flushwc
104 +
105 +static int
106 +big5hkscs1999_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
107 +{
108 + int count = 0;
109 + unsigned char last = conv->ostate;
110 +
111 + if (last) {
112 + /* last is = 0x66 or = 0xa7. */
113 + if (wc == 0x0304 || wc == 0x030c) {
114 + /* Output the combined character. */
115 + if (n >= 2) {
116 + r[0] = 0x88;
117 + r[1] = last + ((wc & 24) >> 2) - 4; /* = 0x62 or 0x64 or 0xa3 or 0xa5 */
118 + conv->ostate = 0;
119 + return 2;
120 + } else
121 + return RET_TOOSMALL;
122 + }
123 +
124 + /* Output the buffered character. */
125 + if (n < 2)
126 + return RET_TOOSMALL;
127 + r[0] = 0x88;
128 + r[1] = last;
129 + r += 2;
130 + count = 2;
131 + }
132 +
133 + /* Code set 0 (ASCII) */
134 + if (wc < 0x0080) {
135 + /* Plain ASCII character. */
136 + if (n > count) {
137 + r[0] = (unsigned char) wc;
138 + conv->ostate = 0;
139 + return count+1;
140 + } else
141 + return RET_TOOSMALL;
142 + } else {
143 + unsigned char buf[2];
144 + int ret;
145 +
146 + /* Code set 1 (BIG5 extended) */
147 + ret = big5_wctomb(conv,buf,wc,2);
148 + if (ret != RET_ILUNI) {
149 + if (ret != 2) abort();
150 + if (!((buf[0] == 0xc6 && buf[1] >= 0xa1) || buf[0] == 0xc7)) {
151 + if (n >= count+2) {
152 + r[0] = buf[0];
153 + r[1] = buf[1];
154 + conv->ostate = 0;
155 + return count+2;
156 + } else
157 + return RET_TOOSMALL;
158 + }
159 + }
160 + ret = hkscs1999_wctomb(conv,buf,wc,2);
161 + if (ret != RET_ILUNI) {
162 + if (ret != 2) abort();
163 + if ((wc & ~0x0020) == 0x00ca) {
164 + /* A possible first character of a multi-character sequence. We have to
165 + buffer it. */
166 + if (!(buf[0] == 0x88 && (buf[1] == 0x66 || buf[1] == 0xa7))) abort();
167 + conv->ostate = buf[1]; /* = 0x66 or = 0xa7 */
168 + return count+0;
169 + }
170 + if (n >= count+2) {
171 + r[0] = buf[0];
172 + r[1] = buf[1];
173 + conv->ostate = 0;
174 + return count+2;
175 + } else
176 + return RET_TOOSMALL;
177 + }
178 + return RET_ILUNI;
179 + }
180 +}
181 +
182 +static int
183 +big5hkscs1999_reset (conv_t conv, unsigned char *r, size_t n)
184 +{
185 + unsigned char last = conv->ostate;
186 +
187 + if (last) {
188 + if (n < 2)
189 + return RET_TOOSMALL;
190 + r[0] = 0x88;
191 + r[1] = last;
192 + /* conv->ostate = 0; will be done by the caller */
193 + return 2;
194 + } else
195 + return 0;
196 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2006, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * BIG5-HKSCS:2001
22 + */
23 +
24 +/*
25 + * BIG5-HKSCS:2001 can be downloaded from
26 + * http://www.info.gov.hk/digital21/eng/hkscs/download.html
27 + * http://www.info.gov.hk/digital21/eng/hkscs/index.html
28 + *
29 + * It extends BIG5-HKSCS:1999 through 116 characters.
30 + *
31 + * It extends BIG5 (without the rows 0xC6..0xC7) through the ranges
32 + *
33 + * 0x{88..8D}{40..7E,A1..FE} 757 characters
34 + * 0x{8E..A0}{40..7E,A1..FE} 2898 characters
35 + * 0x{C6..C8}{40..7E,A1..FE} 359 characters
36 + * 0xF9{D6..FE} 41 characters
37 + * 0x{FA..FE}{40..7E,A1..FE} 763 characters
38 + *
39 + * Note that some HKSCS characters are not contained in Unicode 3.2
40 + * and are therefore best represented as sequences of Unicode characters:
41 + * 0x8862 U+00CA U+0304 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND MACRON
42 + * 0x8864 U+00CA U+030C LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND CARON
43 + * 0x88A3 U+00EA U+0304 LATIN SMALL LETTER E WITH CIRCUMFLEX AND MACRON
44 + * 0x88A5 U+00EA U+030C LATIN SMALL LETTER E WITH CIRCUMFLEX AND CARON
45 + */
46 +
47 +#include "hkscs2001.h"
48 +#include "flushwc.h"
49 +
50 +static int
51 +big5hkscs2001_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
52 +{
53 + ucs4_t last_wc = conv->istate;
54 + if (last_wc) {
55 + /* Output the buffered character. */
56 + conv->istate = 0;
57 + *pwc = last_wc;
58 + return 0; /* Don't advance the input pointer. */
59 + } else {
60 + unsigned char c = *s;
61 + /* Code set 0 (ASCII) */
62 + if (c < 0x80)
63 + return ascii_mbtowc(conv,pwc,s,n);
64 + /* Code set 1 (BIG5 extended) */
65 + if (c >= 0xa1 && c < 0xff) {
66 + if (n < 2)
67 + return RET_TOOFEW(0);
68 + {
69 + unsigned char c2 = s[1];
70 + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {
71 + if (!((c == 0xc6 && c2 >= 0xa1) || c == 0xc7)) {
72 + int ret = big5_mbtowc(conv,pwc,s,2);
73 + if (ret != RET_ILSEQ)
74 + return ret;
75 + }
76 + }
77 + }
78 + }
79 + {
80 + int ret = hkscs1999_mbtowc(conv,pwc,s,n);
81 + if (ret != RET_ILSEQ)
82 + return ret;
83 + }
84 + {
85 + int ret = hkscs2001_mbtowc(conv,pwc,s,n);
86 + if (ret != RET_ILSEQ)
87 + return ret;
88 + }
89 + if (c == 0x88) {
90 + if (n < 2)
91 + return RET_TOOFEW(0);
92 + {
93 + unsigned char c2 = s[1];
94 + if (c2 == 0x62 || c2 == 0x64 || c2 == 0xa3 || c2 == 0xa5) {
95 + /* It's a composed character. */
96 + ucs4_t wc1 = ((c2 >> 3) << 2) + 0x009a; /* = 0x00ca or 0x00ea */
97 + ucs4_t wc2 = ((c2 & 6) << 2) + 0x02fc; /* = 0x0304 or 0x030c */
98 + /* We cannot output two Unicode characters at once. So,
99 + output the first character and buffer the second one. */
100 + *pwc = wc1;
101 + conv->istate = wc2;
102 + return 2;
103 + }
104 + }
105 + }
106 + return RET_ILSEQ;
107 + }
108 +}
109 +
110 +#define big5hkscs2001_flushwc normal_flushwc
111 +
112 +static int
113 +big5hkscs2001_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
114 +{
115 + int count = 0;
116 + unsigned char last = conv->ostate;
117 +
118 + if (last) {
119 + /* last is = 0x66 or = 0xa7. */
120 + if (wc == 0x0304 || wc == 0x030c) {
121 + /* Output the combined character. */
122 + if (n >= 2) {
123 + r[0] = 0x88;
124 + r[1] = last + ((wc & 24) >> 2) - 4; /* = 0x62 or 0x64 or 0xa3 or 0xa5 */
125 + conv->ostate = 0;
126 + return 2;
127 + } else
128 + return RET_TOOSMALL;
129 + }
130 +
131 + /* Output the buffered character. */
132 + if (n < 2)
133 + return RET_TOOSMALL;
134 + r[0] = 0x88;
135 + r[1] = last;
136 + r += 2;
137 + count = 2;
138 + }
139 +
140 + /* Code set 0 (ASCII) */
141 + if (wc < 0x0080) {
142 + /* Plain ASCII character. */
143 + if (n > count) {
144 + r[0] = (unsigned char) wc;
145 + conv->ostate = 0;
146 + return count+1;
147 + } else
148 + return RET_TOOSMALL;
149 + } else {
150 + unsigned char buf[2];
151 + int ret;
152 +
153 + /* Code set 1 (BIG5 extended) */
154 + ret = big5_wctomb(conv,buf,wc,2);
155 + if (ret != RET_ILUNI) {
156 + if (ret != 2) abort();
157 + if (!((buf[0] == 0xc6 && buf[1] >= 0xa1) || buf[0] == 0xc7)) {
158 + if (n >= count+2) {
159 + r[0] = buf[0];
160 + r[1] = buf[1];
161 + conv->ostate = 0;
162 + return count+2;
163 + } else
164 + return RET_TOOSMALL;
165 + }
166 + }
167 + ret = hkscs1999_wctomb(conv,buf,wc,2);
168 + if (ret != RET_ILUNI) {
169 + if (ret != 2) abort();
170 + if ((wc & ~0x0020) == 0x00ca) {
171 + /* A possible first character of a multi-character sequence. We have to
172 + buffer it. */
173 + if (!(buf[0] == 0x88 && (buf[1] == 0x66 || buf[1] == 0xa7))) abort();
174 + conv->ostate = buf[1]; /* = 0x66 or = 0xa7 */
175 + return count+0;
176 + }
177 + if (n >= count+2) {
178 + r[0] = buf[0];
179 + r[1] = buf[1];
180 + conv->ostate = 0;
181 + return count+2;
182 + } else
183 + return RET_TOOSMALL;
184 + }
185 + ret = hkscs2001_wctomb(conv,buf,wc,2);
186 + if (ret != RET_ILUNI) {
187 + if (ret != 2) abort();
188 + if (n >= count+2) {
189 + r[0] = buf[0];
190 + r[1] = buf[1];
191 + conv->ostate = 0;
192 + return count+2;
193 + } else
194 + return RET_TOOSMALL;
195 + }
196 + return RET_ILUNI;
197 + }
198 +}
199 +
200 +static int
201 +big5hkscs2001_reset (conv_t conv, unsigned char *r, size_t n)
202 +{
203 + unsigned char last = conv->ostate;
204 +
205 + if (last) {
206 + if (n < 2)
207 + return RET_TOOSMALL;
208 + r[0] = 0x88;
209 + r[1] = last;
210 + /* conv->ostate = 0; will be done by the caller */
211 + return 2;
212 + } else
213 + return 0;
214 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2006, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * BIG5-HKSCS:2004
22 + */
23 +
24 +/*
25 + * BIG5-HKSCS:2004 can be downloaded from
26 + * http://www.info.gov.hk/digital21/eng/hkscs/download.html
27 + * http://www.info.gov.hk/digital21/eng/hkscs/index.html
28 + *
29 + * It extends BIG5-HKSCS:2001 through 123 characters.
30 + *
31 + * It extends BIG5 (without the rows 0xC6..0xC7) through the ranges
32 + *
33 + * 0x{87..8D}{40..7E,A1..FE} 880 characters
34 + * 0x{8E..A0}{40..7E,A1..FE} 2898 characters
35 + * 0x{C6..C8}{40..7E,A1..FE} 359 characters
36 + * 0xF9{D6..FE} 41 characters
37 + * 0x{FA..FE}{40..7E,A1..FE} 763 characters
38 + *
39 + * Note that some HKSCS characters are not contained in Unicode 3.2
40 + * and are therefore best represented as sequences of Unicode characters:
41 + * 0x8862 U+00CA U+0304 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND MACRON
42 + * 0x8864 U+00CA U+030C LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND CARON
43 + * 0x88A3 U+00EA U+0304 LATIN SMALL LETTER E WITH CIRCUMFLEX AND MACRON
44 + * 0x88A5 U+00EA U+030C LATIN SMALL LETTER E WITH CIRCUMFLEX AND CARON
45 + */
46 +
47 +#include "hkscs2004.h"
48 +#include "flushwc.h"
49 +
50 +static int
51 +big5hkscs2004_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
52 +{
53 + ucs4_t last_wc = conv->istate;
54 + if (last_wc) {
55 + /* Output the buffered character. */
56 + conv->istate = 0;
57 + *pwc = last_wc;
58 + return 0; /* Don't advance the input pointer. */
59 + } else {
60 + unsigned char c = *s;
61 + /* Code set 0 (ASCII) */
62 + if (c < 0x80)
63 + return ascii_mbtowc(conv,pwc,s,n);
64 + /* Code set 1 (BIG5 extended) */
65 + if (c >= 0xa1 && c < 0xff) {
66 + if (n < 2)
67 + return RET_TOOFEW(0);
68 + {
69 + unsigned char c2 = s[1];
70 + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {
71 + if (!((c == 0xc6 && c2 >= 0xa1) || c == 0xc7)) {
72 + int ret = big5_mbtowc(conv,pwc,s,2);
73 + if (ret != RET_ILSEQ)
74 + return ret;
75 + }
76 + }
77 + }
78 + }
79 + {
80 + int ret = hkscs1999_mbtowc(conv,pwc,s,n);
81 + if (ret != RET_ILSEQ)
82 + return ret;
83 + }
84 + {
85 + int ret = hkscs2001_mbtowc(conv,pwc,s,n);
86 + if (ret != RET_ILSEQ)
87 + return ret;
88 + }
89 + {
90 + int ret = hkscs2004_mbtowc(conv,pwc,s,n);
91 + if (ret != RET_ILSEQ)
92 + return ret;
93 + }
94 + if (c == 0x88) {
95 + if (n < 2)
96 + return RET_TOOFEW(0);
97 + {
98 + unsigned char c2 = s[1];
99 + if (c2 == 0x62 || c2 == 0x64 || c2 == 0xa3 || c2 == 0xa5) {
100 + /* It's a composed character. */
101 + ucs4_t wc1 = ((c2 >> 3) << 2) + 0x009a; /* = 0x00ca or 0x00ea */
102 + ucs4_t wc2 = ((c2 & 6) << 2) + 0x02fc; /* = 0x0304 or 0x030c */
103 + /* We cannot output two Unicode characters at once. So,
104 + output the first character and buffer the second one. */
105 + *pwc = wc1;
106 + conv->istate = wc2;
107 + return 2;
108 + }
109 + }
110 + }
111 + return RET_ILSEQ;
112 + }
113 +}
114 +
115 +#define big5hkscs2004_flushwc normal_flushwc
116 +
117 +static int
118 +big5hkscs2004_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
119 +{
120 + int count = 0;
121 + unsigned char last = conv->ostate;
122 +
123 + if (last) {
124 + /* last is = 0x66 or = 0xa7. */
125 + if (wc == 0x0304 || wc == 0x030c) {
126 + /* Output the combined character. */
127 + if (n >= 2) {
128 + r[0] = 0x88;
129 + r[1] = last + ((wc & 24) >> 2) - 4; /* = 0x62 or 0x64 or 0xa3 or 0xa5 */
130 + conv->ostate = 0;
131 + return 2;
132 + } else
133 + return RET_TOOSMALL;
134 + }
135 +
136 + /* Output the buffered character. */
137 + if (n < 2)
138 + return RET_TOOSMALL;
139 + r[0] = 0x88;
140 + r[1] = last;
141 + r += 2;
142 + count = 2;
143 + }
144 +
145 + /* Code set 0 (ASCII) */
146 + if (wc < 0x0080) {
147 + /* Plain ASCII character. */
148 + if (n > count) {
149 + r[0] = (unsigned char) wc;
150 + conv->ostate = 0;
151 + return count+1;
152 + } else
153 + return RET_TOOSMALL;
154 + } else {
155 + unsigned char buf[2];
156 + int ret;
157 +
158 + /* Code set 1 (BIG5 extended) */
159 + ret = big5_wctomb(conv,buf,wc,2);
160 + if (ret != RET_ILUNI) {
161 + if (ret != 2) abort();
162 + if (!((buf[0] == 0xc6 && buf[1] >= 0xa1) || buf[0] == 0xc7)) {
163 + if (n >= count+2) {
164 + r[0] = buf[0];
165 + r[1] = buf[1];
166 + conv->ostate = 0;
167 + return count+2;
168 + } else
169 + return RET_TOOSMALL;
170 + }
171 + }
172 + ret = hkscs1999_wctomb(conv,buf,wc,2);
173 + if (ret != RET_ILUNI) {
174 + if (ret != 2) abort();
175 + if ((wc & ~0x0020) == 0x00ca) {
176 + /* A possible first character of a multi-character sequence. We have to
177 + buffer it. */
178 + if (!(buf[0] == 0x88 && (buf[1] == 0x66 || buf[1] == 0xa7))) abort();
179 + conv->ostate = buf[1]; /* = 0x66 or = 0xa7 */
180 + return count+0;
181 + }
182 + if (n >= count+2) {
183 + r[0] = buf[0];
184 + r[1] = buf[1];
185 + conv->ostate = 0;
186 + return count+2;
187 + } else
188 + return RET_TOOSMALL;
189 + }
190 + ret = hkscs2001_wctomb(conv,buf,wc,2);
191 + if (ret != RET_ILUNI) {
192 + if (ret != 2) abort();
193 + if (n >= count+2) {
194 + r[0] = buf[0];
195 + r[1] = buf[1];
196 + conv->ostate = 0;
197 + return count+2;
198 + } else
199 + return RET_TOOSMALL;
200 + }
201 + ret = hkscs2004_wctomb(conv,buf,wc,2);
202 + if (ret != RET_ILUNI) {
203 + if (ret != 2) abort();
204 + if (n >= count+2) {
205 + r[0] = buf[0];
206 + r[1] = buf[1];
207 + conv->ostate = 0;
208 + return count+2;
209 + } else
210 + return RET_TOOSMALL;
211 + }
212 + return RET_ILUNI;
213 + }
214 +}
215 +
216 +static int
217 +big5hkscs2004_reset (conv_t conv, unsigned char *r, size_t n)
218 +{
219 + unsigned char last = conv->ostate;
220 +
221 + if (last) {
222 + if (n < 2)
223 + return RET_TOOSMALL;
224 + r[0] = 0x88;
225 + r[1] = last;
226 + /* conv->ostate = 0; will be done by the caller */
227 + return 2;
228 + } else
229 + return 0;
230 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2006, 2010 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * BIG5-HKSCS:2008
22 + */
23 +
24 +/*
25 + * BIG5-HKSCS:2008 can be downloaded from
26 + * http://www.ogcio.gov.hk/ccli/eng/hkscs/download.html
27 + * http://www.ogcio.gov.hk/ccli/eng/hkscs/introduction.html
28 + *
29 + * It extends BIG5-HKSCS:2004 through 68 characters.
30 + *
31 + * It extends BIG5 (without the rows 0xC6..0xC7) through the ranges
32 + *
33 + * 0x{87..8D}{40..7E,A1..FE} 880 characters
34 + * 0x{8E..A0}{40..7E,A1..FE} 2898 characters
35 + * 0x{C6..C8}{40..7E,A1..FE} 359 characters
36 + * 0xF9{D6..FE} 41 characters
37 + * 0x{FA..FE}{40..7E,A1..FE} 763 characters
38 + *
39 + * Note that some HKSCS characters are not contained in Unicode 3.2
40 + * and are therefore best represented as sequences of Unicode characters:
41 + * 0x8862 U+00CA U+0304 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND MACRON
42 + * 0x8864 U+00CA U+030C LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND CARON
43 + * 0x88A3 U+00EA U+0304 LATIN SMALL LETTER E WITH CIRCUMFLEX AND MACRON
44 + * 0x88A5 U+00EA U+030C LATIN SMALL LETTER E WITH CIRCUMFLEX AND CARON
45 + */
46 +
47 +#include "hkscs2008.h"
48 +#include "flushwc.h"
49 +
50 +static int
51 +big5hkscs2008_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
52 +{
53 + ucs4_t last_wc = conv->istate;
54 + if (last_wc) {
55 + /* Output the buffered character. */
56 + conv->istate = 0;
57 + *pwc = last_wc;
58 + return 0; /* Don't advance the input pointer. */
59 + } else {
60 + unsigned char c = *s;
61 + /* Code set 0 (ASCII) */
62 + if (c < 0x80)
63 + return ascii_mbtowc(conv,pwc,s,n);
64 + /* Code set 1 (BIG5 extended) */
65 + if (c >= 0xa1 && c < 0xff) {
66 + if (n < 2)
67 + return RET_TOOFEW(0);
68 + {
69 + unsigned char c2 = s[1];
70 + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {
71 + if (!((c == 0xc6 && c2 >= 0xa1) || c == 0xc7)) {
72 + int ret = big5_mbtowc(conv,pwc,s,2);
73 + if (ret != RET_ILSEQ)
74 + return ret;
75 + }
76 + }
77 + }
78 + }
79 + {
80 + int ret = hkscs1999_mbtowc(conv,pwc,s,n);
81 + if (ret != RET_ILSEQ)
82 + return ret;
83 + }
84 + {
85 + int ret = hkscs2001_mbtowc(conv,pwc,s,n);
86 + if (ret != RET_ILSEQ)
87 + return ret;
88 + }
89 + {
90 + int ret = hkscs2004_mbtowc(conv,pwc,s,n);
91 + if (ret != RET_ILSEQ)
92 + return ret;
93 + }
94 + {
95 + int ret = hkscs2008_mbtowc(conv,pwc,s,n);
96 + if (ret != RET_ILSEQ)
97 + return ret;
98 + }
99 + if (c == 0x88) {
100 + if (n < 2)
101 + return RET_TOOFEW(0);
102 + {
103 + unsigned char c2 = s[1];
104 + if (c2 == 0x62 || c2 == 0x64 || c2 == 0xa3 || c2 == 0xa5) {
105 + /* It's a composed character. */
106 + ucs4_t wc1 = ((c2 >> 3) << 2) + 0x009a; /* = 0x00ca or 0x00ea */
107 + ucs4_t wc2 = ((c2 & 6) << 2) + 0x02fc; /* = 0x0304 or 0x030c */
108 + /* We cannot output two Unicode characters at once. So,
109 + output the first character and buffer the second one. */
110 + *pwc = wc1;
111 + conv->istate = wc2;
112 + return 2;
113 + }
114 + }
115 + }
116 + return RET_ILSEQ;
117 + }
118 +}
119 +
120 +#define big5hkscs2008_flushwc normal_flushwc
121 +
122 +static int
123 +big5hkscs2008_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
124 +{
125 + int count = 0;
126 + unsigned char last = conv->ostate;
127 +
128 + if (last) {
129 + /* last is = 0x66 or = 0xa7. */
130 + if (wc == 0x0304 || wc == 0x030c) {
131 + /* Output the combined character. */
132 + if (n >= 2) {
133 + r[0] = 0x88;
134 + r[1] = last + ((wc & 24) >> 2) - 4; /* = 0x62 or 0x64 or 0xa3 or 0xa5 */
135 + conv->ostate = 0;
136 + return 2;
137 + } else
138 + return RET_TOOSMALL;
139 + }
140 +
141 + /* Output the buffered character. */
142 + if (n < 2)
143 + return RET_TOOSMALL;
144 + r[0] = 0x88;
145 + r[1] = last;
146 + r += 2;
147 + count = 2;
148 + }
149 +
150 + /* Code set 0 (ASCII) */
151 + if (wc < 0x0080) {
152 + /* Plain ASCII character. */
153 + if (n > count) {
154 + r[0] = (unsigned char) wc;
155 + conv->ostate = 0;
156 + return count+1;
157 + } else
158 + return RET_TOOSMALL;
159 + } else {
160 + unsigned char buf[2];
161 + int ret;
162 +
163 + /* Code set 1 (BIG5 extended) */
164 + ret = big5_wctomb(conv,buf,wc,2);
165 + if (ret != RET_ILUNI) {
166 + if (ret != 2) abort();
167 + if (!((buf[0] == 0xc6 && buf[1] >= 0xa1) || buf[0] == 0xc7)) {
168 + if (n >= count+2) {
169 + r[0] = buf[0];
170 + r[1] = buf[1];
171 + conv->ostate = 0;
172 + return count+2;
173 + } else
174 + return RET_TOOSMALL;
175 + }
176 + }
177 + ret = hkscs1999_wctomb(conv,buf,wc,2);
178 + if (ret != RET_ILUNI) {
179 + if (ret != 2) abort();
180 + if ((wc & ~0x0020) == 0x00ca) {
181 + /* A possible first character of a multi-character sequence. We have to
182 + buffer it. */
183 + if (!(buf[0] == 0x88 && (buf[1] == 0x66 || buf[1] == 0xa7))) abort();
184 + conv->ostate = buf[1]; /* = 0x66 or = 0xa7 */
185 + return count+0;
186 + }
187 + if (n >= count+2) {
188 + r[0] = buf[0];
189 + r[1] = buf[1];
190 + conv->ostate = 0;
191 + return count+2;
192 + } else
193 + return RET_TOOSMALL;
194 + }
195 + ret = hkscs2001_wctomb(conv,buf,wc,2);
196 + if (ret != RET_ILUNI) {
197 + if (ret != 2) abort();
198 + if (n >= count+2) {
199 + r[0] = buf[0];
200 + r[1] = buf[1];
201 + conv->ostate = 0;
202 + return count+2;
203 + } else
204 + return RET_TOOSMALL;
205 + }
206 + ret = hkscs2004_wctomb(conv,buf,wc,2);
207 + if (ret != RET_ILUNI) {
208 + if (ret != 2) abort();
209 + if (n >= count+2) {
210 + r[0] = buf[0];
211 + r[1] = buf[1];
212 + conv->ostate = 0;
213 + return count+2;
214 + } else
215 + return RET_TOOSMALL;
216 + }
217 + ret = hkscs2008_wctomb(conv,buf,wc,2);
218 + if (ret != RET_ILUNI) {
219 + if (ret != 2) abort();
220 + if (n >= count+2) {
221 + r[0] = buf[0];
222 + r[1] = buf[1];
223 + conv->ostate = 0;
224 + return count+2;
225 + } else
226 + return RET_TOOSMALL;
227 + }
228 + return RET_ILUNI;
229 + }
230 +}
231 +
232 +static int
233 +big5hkscs2008_reset (conv_t conv, unsigned char *r, size_t n)
234 +{
235 + unsigned char last = conv->ostate;
236 +
237 + if (last) {
238 + if (n < 2)
239 + return RET_TOOSMALL;
240 + r[0] = 0x88;
241 + r[1] = last;
242 + /* conv->ostate = 0; will be done by the caller */
243 + return 2;
244 + } else
245 + return 0;
246 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * C99
22 + * This is ASCII with \uXXXX and \UXXXXXXXX escape sequences, denoting Unicode
23 + * characters. See ISO/IEC 9899:1999, section 6.4.3.
24 + * The treatment of control characters in the range U+0080..U+009F is not
25 + * specified; we pass them through unmodified.
26 + */
27 +
28 +static int
29 +c99_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
30 +{
31 + unsigned char c;
32 + ucs4_t wc;
33 + int i;
34 +
35 + c = s[0];
36 + if (c < 0xa0) {
37 + if (c != '\\') {
38 + *pwc = c;
39 + return 1;
40 + }
41 + if (n < 2)
42 + return RET_TOOFEW(0);
43 + c = s[1];
44 + if (c == 'u') {
45 + wc = 0;
46 + for (i = 2; i < 6; i++) {
47 + if (n <= i)
48 + return RET_TOOFEW(0);
49 + c = s[i];
50 + if (c >= '0' && c <= '9')
51 + c -= '0';
52 + else if (c >= 'A' && c <= 'Z')
53 + c -= 'A'-10;
54 + else if (c >= 'a' && c <= 'z')
55 + c -= 'a'-10;
56 + else
57 + goto simply_backslash;
58 + wc |= (ucs4_t) c << (4 * (5-i));
59 + }
60 + if ((wc >= 0x00a0 && !(wc >= 0xd800 && wc < 0xe000))
61 + || wc == 0x0024 || wc == 0x0040 || wc == 0x0060) {
62 + *pwc = wc;
63 + return 6;
64 + }
65 + } else if (c == 'U') {
66 + wc = 0;
67 + for (i = 2; i < 10; i++) {
68 + if (n <= i)
69 + return RET_TOOFEW(0);
70 + c = s[i];
71 + if (c >= '0' && c <= '9')
72 + c -= '0';
73 + else if (c >= 'A' && c <= 'Z')
74 + c -= 'A'-10;
75 + else if (c >= 'a' && c <= 'z')
76 + c -= 'a'-10;
77 + else
78 + goto simply_backslash;
79 + wc |= (ucs4_t) c << (4 * (9-i));
80 + }
81 + if ((wc >= 0x00a0 && !(wc >= 0xd800 && wc < 0xe000))
82 + || wc == 0x0024 || wc == 0x0040 || wc == 0x0060) {
83 + *pwc = wc;
84 + return 10;
85 + }
86 + } else
87 + goto simply_backslash;
88 + }
89 + return RET_ILSEQ;
90 +simply_backslash:
91 + *pwc = '\\';
92 + return 1;
93 +}
94 +
95 +static int
96 +c99_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
97 +{
98 + if (wc < 0xa0) {
99 + *r = wc;
100 + return 1;
101 + } else {
102 + int result;
103 + unsigned char u;
104 + if (wc < 0x10000) {
105 + result = 6;
106 + u = 'u';
107 + } else {
108 + result = 10;
109 + u = 'U';
110 + }
111 + if (n >= result) {
112 + int count;
113 + r[0] = '\\';
114 + r[1] = u;
115 + r += 2;
116 + for (count = result-3; count >= 0; count--) {
117 + unsigned int i = (wc >> (4*count)) & 0x0f;
118 + *r++ = (i < 10 ? '0'+i : 'a'-10+i);
119 + }
120 + return result;
121 + } else
122 + return RET_TOOSMALL;
123 + }
124 +}
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str392,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str389,
3 + (int)(long)&((struct stringpool_t *)0)->stringpool_str258,
4 + (int)(long)&((struct stringpool_t *)0)->stringpool_str436,
5 + (int)(long)&((struct stringpool_t *)0)->stringpool_str285,
6 + (int)(long)&((struct stringpool_t *)0)->stringpool_str222,
7 + (int)(long)&((struct stringpool_t *)0)->stringpool_str418,
8 + (int)(long)&((struct stringpool_t *)0)->stringpool_str267,
9 + (int)(long)&((struct stringpool_t *)0)->stringpool_str361,
10 + (int)(long)&((struct stringpool_t *)0)->stringpool_str567,
11 + (int)(long)&((struct stringpool_t *)0)->stringpool_str416,
12 + (int)(long)&((struct stringpool_t *)0)->stringpool_str512,
13 + (int)(long)&((struct stringpool_t *)0)->stringpool_str690,
14 + (int)(long)&((struct stringpool_t *)0)->stringpool_str539,
15 + (int)(long)&((struct stringpool_t *)0)->stringpool_str689,
16 + (int)(long)&((struct stringpool_t *)0)->stringpool_str320,
17 + (int)(long)&((struct stringpool_t *)0)->stringpool_str750,
18 + (int)(long)&((struct stringpool_t *)0)->stringpool_str302,
19 + (int)(long)&((struct stringpool_t *)0)->stringpool_str732,
20 + (int)(long)&((struct stringpool_t *)0)->stringpool_str64,
21 + (int)(long)&((struct stringpool_t *)0)->stringpool_str811,
22 + (int)(long)&((struct stringpool_t *)0)->stringpool_str134,
23 + (int)(long)&((struct stringpool_t *)0)->stringpool_str186,
24 + (int)(long)&((struct stringpool_t *)0)->stringpool_str324,
25 + (int)(long)&((struct stringpool_t *)0)->stringpool_str150,
26 + (int)(long)&((struct stringpool_t *)0)->stringpool_str154,
27 + (int)(long)&((struct stringpool_t *)0)->stringpool_str130,
28 + (int)(long)&((struct stringpool_t *)0)->stringpool_str466,
29 + (int)(long)&((struct stringpool_t *)0)->stringpool_str166,
30 + (int)(long)&((struct stringpool_t *)0)->stringpool_str170,
31 + (int)(long)&((struct stringpool_t *)0)->stringpool_str322,
32 + (int)(long)&((struct stringpool_t *)0)->stringpool_str142,
33 + (int)(long)&((struct stringpool_t *)0)->stringpool_str332,
34 + (int)(long)&((struct stringpool_t *)0)->stringpool_str158,
35 + (int)(long)&((struct stringpool_t *)0)->stringpool_str162,
36 + (int)(long)&((struct stringpool_t *)0)->stringpool_str138,
37 + (int)(long)&((struct stringpool_t *)0)->stringpool_str236,
38 + (int)(long)&((struct stringpool_t *)0)->stringpool_str574,
39 + (int)(long)&((struct stringpool_t *)0)->stringpool_str580,
40 + (int)(long)&((struct stringpool_t *)0)->stringpool_str268,
41 + (int)(long)&((struct stringpool_t *)0)->stringpool_str88,
42 + (int)(long)&((struct stringpool_t *)0)->stringpool_str140,
43 + (int)(long)&((struct stringpool_t *)0)->stringpool_str278,
44 + (int)(long)&((struct stringpool_t *)0)->stringpool_str104,
45 + (int)(long)&((struct stringpool_t *)0)->stringpool_str108,
46 + (int)(long)&((struct stringpool_t *)0)->stringpool_str84,
47 + (int)(long)&((struct stringpool_t *)0)->stringpool_str420,
48 + (int)(long)&((struct stringpool_t *)0)->stringpool_str120,
49 + (int)(long)&((struct stringpool_t *)0)->stringpool_str250,
50 + (int)(long)&((struct stringpool_t *)0)->stringpool_str110,
51 + (int)(long)&((struct stringpool_t *)0)->stringpool_str54,
52 + (int)(long)&((struct stringpool_t *)0)->stringpool_str147,
53 + (int)(long)&((struct stringpool_t *)0)->stringpool_str476,
54 + (int)(long)&((struct stringpool_t *)0)->stringpool_str463,
55 + (int)(long)&((struct stringpool_t *)0)->stringpool_str442,
56 + (int)(long)&((struct stringpool_t *)0)->stringpool_str562,
57 + (int)(long)&((struct stringpool_t *)0)->stringpool_str813,
58 + (int)(long)&((struct stringpool_t *)0)->stringpool_str248,
59 + (int)(long)&((struct stringpool_t *)0)->stringpool_str749,
60 + (int)(long)&((struct stringpool_t *)0)->stringpool_str591,
61 + (int)(long)&((struct stringpool_t *)0)->stringpool_str702,
62 + (int)(long)&((struct stringpool_t *)0)->stringpool_str796,
63 + (int)(long)&((struct stringpool_t *)0)->stringpool_str680,
64 + (int)(long)&((struct stringpool_t *)0)->stringpool_str430,
65 + (int)(long)&((struct stringpool_t *)0)->stringpool_str448,
66 + (int)(long)&((struct stringpool_t *)0)->stringpool_str311,
67 + (int)(long)&((struct stringpool_t *)0)->stringpool_str391,
68 + (int)(long)&((struct stringpool_t *)0)->stringpool_str446,
69 + (int)(long)&((struct stringpool_t *)0)->stringpool_str312,
70 + (int)(long)&((struct stringpool_t *)0)->stringpool_str286,
71 + (int)(long)&((struct stringpool_t *)0)->stringpool_str121,
72 + (int)(long)&((struct stringpool_t *)0)->stringpool_str176,
73 + (int)(long)&((struct stringpool_t *)0)->stringpool_str375,
74 + (int)(long)&((struct stringpool_t *)0)->stringpool_str337,
75 + (int)(long)&((struct stringpool_t *)0)->stringpool_str282,
76 + (int)(long)&((struct stringpool_t *)0)->stringpool_str242,
77 + (int)(long)&((struct stringpool_t *)0)->stringpool_str206,
78 + (int)(long)&((struct stringpool_t *)0)->stringpool_str211,
79 + (int)(long)&((struct stringpool_t *)0)->stringpool_str536,
80 + (int)(long)&((struct stringpool_t *)0)->stringpool_str651,
81 + (int)(long)&((struct stringpool_t *)0)->stringpool_str683,
82 + (int)(long)&((struct stringpool_t *)0)->stringpool_str613,
83 + (int)(long)&((struct stringpool_t *)0)->stringpool_str329,
84 + (int)(long)&((struct stringpool_t *)0)->stringpool_str426,
85 + (int)(long)&((struct stringpool_t *)0)->stringpool_str89,
86 + (int)(long)&((struct stringpool_t *)0)->stringpool_str344,
87 + (int)(long)&((struct stringpool_t *)0)->stringpool_str479,
88 + (int)(long)&((struct stringpool_t *)0)->stringpool_str548,
89 + (int)(long)&((struct stringpool_t *)0)->stringpool_str209,
90 + (int)(long)&((struct stringpool_t *)0)->stringpool_str661,
91 + (int)(long)&((struct stringpool_t *)0)->stringpool_str608,
92 + (int)(long)&((struct stringpool_t *)0)->stringpool_str634,
93 + (int)(long)&((struct stringpool_t *)0)->stringpool_str610,
94 + (int)(long)&((struct stringpool_t *)0)->stringpool_str72,
95 + (int)(long)&((struct stringpool_t *)0)->stringpool_str388,
96 + (int)(long)&((struct stringpool_t *)0)->stringpool_str153,
97 + (int)(long)&((struct stringpool_t *)0)->stringpool_str443,
98 + (int)(long)&((struct stringpool_t *)0)->stringpool_str254,
99 + (int)(long)&((struct stringpool_t *)0)->stringpool_str281,
100 + (int)(long)&((struct stringpool_t *)0)->stringpool_str78,
101 + (int)(long)&((struct stringpool_t *)0)->stringpool_str437,
102 + (int)(long)&((struct stringpool_t *)0)->stringpool_str210,
103 + (int)(long)&((struct stringpool_t *)0)->stringpool_str252,
104 + (int)(long)&((struct stringpool_t *)0)->stringpool_str710,
105 + (int)(long)&((struct stringpool_t *)0)->stringpool_str692,
106 + (int)(long)&((struct stringpool_t *)0)->stringpool_str700,
107 + (int)(long)&((struct stringpool_t *)0)->stringpool_str495,
108 + (int)(long)&((struct stringpool_t *)0)->stringpool_str243,
109 + (int)(long)&((struct stringpool_t *)0)->stringpool_str106,
110 + (int)(long)&((struct stringpool_t *)0)->stringpool_str869,
111 + (int)(long)&((struct stringpool_t *)0)->stringpool_str425,
1 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_0,
2 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_1,
3 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_2,
4 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_3,
5 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_4,
6 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_5,
7 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_6,
8 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_10,
9 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_14,
1 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_0,
2 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_2,
3 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_4,
4 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_6,
5 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_8,
6 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_10,
7 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_12,
8 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_16,
9 + (int)(long)&((struct stringpool2_t *)0)->stringpool_aix_20,
1 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_0,
2 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_4,
3 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_5,
4 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_8,
5 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_12,
6 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_13,
7 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_17,
8 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_21,
9 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_22,
10 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_26,
11 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_31,
12 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_35,
13 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_38,
14 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_42,
15 + (int)(long)&((struct stringpool2_t *)0)->stringpool_dos_47,
1 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_0,
2 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_2,
3 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_4,
4 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_6,
5 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_7,
6 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_9,
7 + (int)(long)&((struct stringpool2_t *)0)->stringpool_extra_11,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str193,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str496,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str15,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str484,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str171,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str723,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str193,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str457,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str112,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str491,
1 + (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_0,
2 + (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_1,
1 + (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_0,
2 + (int)(long)&((struct stringpool2_t *)0)->stringpool_osf1_2,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str391,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str282,
3 + (int)(long)&((struct stringpool_t *)0)->stringpool_str145,
4 + (int)(long)&((struct stringpool_t *)0)->stringpool_str452,
5 + (int)(long)&((struct stringpool_t *)0)->stringpool_str267,
6 + (int)(long)&((struct stringpool_t *)0)->stringpool_str131,
7 + (int)(long)&((struct stringpool_t *)0)->stringpool_str445,
8 + (int)(long)&((struct stringpool_t *)0)->stringpool_str260,
9 + (int)(long)&((struct stringpool_t *)0)->stringpool_str255,
10 + (int)(long)&((struct stringpool_t *)0)->stringpool_str573,
11 + (int)(long)&((struct stringpool_t *)0)->stringpool_str388,
12 + (int)(long)&((struct stringpool_t *)0)->stringpool_str303,
13 + (int)(long)&((struct stringpool_t *)0)->stringpool_str610,
14 + (int)(long)&((struct stringpool_t *)0)->stringpool_str425,
15 + (int)(long)&((struct stringpool_t *)0)->stringpool_str618,
16 + (int)(long)&((struct stringpool_t *)0)->stringpool_str418,
17 + (int)(long)&((struct stringpool_t *)0)->stringpool_str469,
18 + (int)(long)&((struct stringpool_t *)0)->stringpool_str411,
19 + (int)(long)&((struct stringpool_t *)0)->stringpool_str462,
20 + (int)(long)&((struct stringpool_t *)0)->stringpool_str5,
21 + (int)(long)&((struct stringpool_t *)0)->stringpool_str457,
22 + (int)(long)&((struct stringpool_t *)0)->stringpool_str155,
23 + (int)(long)&((struct stringpool_t *)0)->stringpool_str183,
24 + (int)(long)&((struct stringpool_t *)0)->stringpool_str207,
25 + (int)(long)&((struct stringpool_t *)0)->stringpool_str169,
26 + (int)(long)&((struct stringpool_t *)0)->stringpool_str177,
27 + (int)(long)&((struct stringpool_t *)0)->stringpool_str161,
28 + (int)(long)&((struct stringpool_t *)0)->stringpool_str527,
29 + (int)(long)&((struct stringpool_t *)0)->stringpool_str191,
30 + (int)(long)&((struct stringpool_t *)0)->stringpool_str151,
31 + (int)(long)&((struct stringpool_t *)0)->stringpool_str242,
32 + (int)(long)&((struct stringpool_t *)0)->stringpool_str158,
33 + (int)(long)&((struct stringpool_t *)0)->stringpool_str210,
34 + (int)(long)&((struct stringpool_t *)0)->stringpool_str172,
35 + (int)(long)&((struct stringpool_t *)0)->stringpool_str180,
36 + (int)(long)&((struct stringpool_t *)0)->stringpool_str164,
37 + (int)(long)&((struct stringpool_t *)0)->stringpool_str313,
38 + (int)(long)&((struct stringpool_t *)0)->stringpool_str507,
39 + (int)(long)&((struct stringpool_t *)0)->stringpool_str508,
40 + (int)(long)&((struct stringpool_t *)0)->stringpool_str127,
41 + (int)(long)&((struct stringpool_t *)0)->stringpool_str43,
42 + (int)(long)&((struct stringpool_t *)0)->stringpool_str71,
43 + (int)(long)&((struct stringpool_t *)0)->stringpool_str95,
44 + (int)(long)&((struct stringpool_t *)0)->stringpool_str57,
45 + (int)(long)&((struct stringpool_t *)0)->stringpool_str65,
46 + (int)(long)&((struct stringpool_t *)0)->stringpool_str49,
47 + (int)(long)&((struct stringpool_t *)0)->stringpool_str415,
48 + (int)(long)&((struct stringpool_t *)0)->stringpool_str79,
49 + (int)(long)&((struct stringpool_t *)0)->stringpool_str128,
50 + (int)(long)&((struct stringpool_t *)0)->stringpool_str64,
51 + (int)(long)&((struct stringpool_t *)0)->stringpool_str42,
52 + (int)(long)&((struct stringpool_t *)0)->stringpool_str44,
53 + (int)(long)&((struct stringpool_t *)0)->stringpool_str437,
54 + (int)(long)&((struct stringpool_t *)0)->stringpool_str557,
55 + (int)(long)&((struct stringpool_t *)0)->stringpool_str429,
56 + (int)(long)&((struct stringpool_t *)0)->stringpool_str451,
57 + (int)(long)&((struct stringpool_t *)0)->stringpool_str542,
58 + (int)(long)&((struct stringpool_t *)0)->stringpool_str426,
59 + (int)(long)&((struct stringpool_t *)0)->stringpool_str744,
60 + (int)(long)&((struct stringpool_t *)0)->stringpool_str809,
61 + (int)(long)&((struct stringpool_t *)0)->stringpool_str815,
62 + (int)(long)&((struct stringpool_t *)0)->stringpool_str958,
63 + (int)(long)&((struct stringpool_t *)0)->stringpool_str518,
64 + (int)(long)&((struct stringpool_t *)0)->stringpool_str560,
65 + (int)(long)&((struct stringpool_t *)0)->stringpool_str309,
66 + (int)(long)&((struct stringpool_t *)0)->stringpool_str647,
67 + (int)(long)&((struct stringpool_t *)0)->stringpool_str453,
68 + (int)(long)&((struct stringpool_t *)0)->stringpool_str270,
69 + (int)(long)&((struct stringpool_t *)0)->stringpool_str315,
70 + (int)(long)&((struct stringpool_t *)0)->stringpool_str549,
71 + (int)(long)&((struct stringpool_t *)0)->stringpool_str90,
72 + (int)(long)&((struct stringpool_t *)0)->stringpool_str101,
73 + (int)(long)&((struct stringpool_t *)0)->stringpool_str305,
74 + (int)(long)&((struct stringpool_t *)0)->stringpool_str96,
75 + (int)(long)&((struct stringpool_t *)0)->stringpool_str245,
76 + (int)(long)&((struct stringpool_t *)0)->stringpool_str233,
77 + (int)(long)&((struct stringpool_t *)0)->stringpool_str342,
78 + (int)(long)&((struct stringpool_t *)0)->stringpool_str187,
79 + (int)(long)&((struct stringpool_t *)0)->stringpool_str490,
80 + (int)(long)&((struct stringpool_t *)0)->stringpool_str725,
81 + (int)(long)&((struct stringpool_t *)0)->stringpool_str761,
82 + (int)(long)&((struct stringpool_t *)0)->stringpool_str711,
83 + (int)(long)&((struct stringpool_t *)0)->stringpool_str226,
84 + (int)(long)&((struct stringpool_t *)0)->stringpool_str246,
85 + (int)(long)&((struct stringpool_t *)0)->stringpool_str219,
86 + (int)(long)&((struct stringpool_t *)0)->stringpool_str276,
87 + (int)(long)&((struct stringpool_t *)0)->stringpool_str553,
88 + (int)(long)&((struct stringpool_t *)0)->stringpool_str853,
89 + (int)(long)&((struct stringpool_t *)0)->stringpool_str67,
90 + (int)(long)&((struct stringpool_t *)0)->stringpool_str671,
91 + (int)(long)&((struct stringpool_t *)0)->stringpool_str623,
92 + (int)(long)&((struct stringpool_t *)0)->stringpool_str637,
93 + (int)(long)&((struct stringpool_t *)0)->stringpool_str633,
94 + (int)(long)&((struct stringpool_t *)0)->stringpool_str81,
95 + (int)(long)&((struct stringpool_t *)0)->stringpool_str466,
96 + (int)(long)&((struct stringpool_t *)0)->stringpool_str45,
97 + (int)(long)&((struct stringpool_t *)0)->stringpool_str254,
98 + (int)(long)&((struct stringpool_t *)0)->stringpool_str199,
99 + (int)(long)&((struct stringpool_t *)0)->stringpool_str318,
100 + (int)(long)&((struct stringpool_t *)0)->stringpool_str48,
101 + (int)(long)&((struct stringpool_t *)0)->stringpool_str569,
102 + (int)(long)&((struct stringpool_t *)0)->stringpool_str286,
103 + (int)(long)&((struct stringpool_t *)0)->stringpool_str108,
104 + (int)(long)&((struct stringpool_t *)0)->stringpool_str719,
105 + (int)(long)&((struct stringpool_t *)0)->stringpool_str721,
106 + (int)(long)&((struct stringpool_t *)0)->stringpool_str728,
107 + (int)(long)&((struct stringpool_t *)0)->stringpool_str555,
108 + (int)(long)&((struct stringpool_t *)0)->stringpool_str272,
109 + (int)(long)&((struct stringpool_t *)0)->stringpool_str16,
110 + (int)(long)&((struct stringpool_t *)0)->stringpool_str814,
111 + (int)(long)&((struct stringpool_t *)0)->stringpool_str390,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str396,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str355,
3 + (int)(long)&((struct stringpool_t *)0)->stringpool_str293,
4 + (int)(long)&((struct stringpool_t *)0)->stringpool_str499,
5 + (int)(long)&((struct stringpool_t *)0)->stringpool_str345,
6 + (int)(long)&((struct stringpool_t *)0)->stringpool_str267,
7 + (int)(long)&((struct stringpool_t *)0)->stringpool_str486,
8 + (int)(long)&((struct stringpool_t *)0)->stringpool_str332,
9 + (int)(long)&((struct stringpool_t *)0)->stringpool_str322,
10 + (int)(long)&((struct stringpool_t *)0)->stringpool_str553,
11 + (int)(long)&((struct stringpool_t *)0)->stringpool_str399,
12 + (int)(long)&((struct stringpool_t *)0)->stringpool_str430,
13 + (int)(long)&((struct stringpool_t *)0)->stringpool_str636,
14 + (int)(long)&((struct stringpool_t *)0)->stringpool_str482,
15 + (int)(long)&((struct stringpool_t *)0)->stringpool_str495,
16 + (int)(long)&((struct stringpool_t *)0)->stringpool_str503,
17 + (int)(long)&((struct stringpool_t *)0)->stringpool_str500,
18 + (int)(long)&((struct stringpool_t *)0)->stringpool_str490,
19 + (int)(long)&((struct stringpool_t *)0)->stringpool_str487,
20 + (int)(long)&((struct stringpool_t *)0)->stringpool_str110,
21 + (int)(long)&((struct stringpool_t *)0)->stringpool_str639,
22 + (int)(long)&((struct stringpool_t *)0)->stringpool_str114,
23 + (int)(long)&((struct stringpool_t *)0)->stringpool_str178,
24 + (int)(long)&((struct stringpool_t *)0)->stringpool_str230,
25 + (int)(long)&((struct stringpool_t *)0)->stringpool_str152,
26 + (int)(long)&((struct stringpool_t *)0)->stringpool_str142,
27 + (int)(long)&((struct stringpool_t *)0)->stringpool_str128,
28 + (int)(long)&((struct stringpool_t *)0)->stringpool_str306,
29 + (int)(long)&((struct stringpool_t *)0)->stringpool_str166,
30 + (int)(long)&((struct stringpool_t *)0)->stringpool_str112,
31 + (int)(long)&((struct stringpool_t *)0)->stringpool_str223,
32 + (int)(long)&((struct stringpool_t *)0)->stringpool_str119,
33 + (int)(long)&((struct stringpool_t *)0)->stringpool_str235,
34 + (int)(long)&((struct stringpool_t *)0)->stringpool_str157,
35 + (int)(long)&((struct stringpool_t *)0)->stringpool_str147,
36 + (int)(long)&((struct stringpool_t *)0)->stringpool_str133,
37 + (int)(long)&((struct stringpool_t *)0)->stringpool_str100,
38 + (int)(long)&((struct stringpool_t *)0)->stringpool_str516,
39 + (int)(long)&((struct stringpool_t *)0)->stringpool_str519,
40 + (int)(long)&((struct stringpool_t *)0)->stringpool_str277,
41 + (int)(long)&((struct stringpool_t *)0)->stringpool_str173,
42 + (int)(long)&((struct stringpool_t *)0)->stringpool_str237,
43 + (int)(long)&((struct stringpool_t *)0)->stringpool_str289,
44 + (int)(long)&((struct stringpool_t *)0)->stringpool_str211,
45 + (int)(long)&((struct stringpool_t *)0)->stringpool_str201,
46 + (int)(long)&((struct stringpool_t *)0)->stringpool_str187,
47 + (int)(long)&((struct stringpool_t *)0)->stringpool_str365,
48 + (int)(long)&((struct stringpool_t *)0)->stringpool_str225,
49 + (int)(long)&((struct stringpool_t *)0)->stringpool_str266,
50 + (int)(long)&((struct stringpool_t *)0)->stringpool_str219,
51 + (int)(long)&((struct stringpool_t *)0)->stringpool_str169,
52 + (int)(long)&((struct stringpool_t *)0)->stringpool_str185,
53 + (int)(long)&((struct stringpool_t *)0)->stringpool_str515,
54 + (int)(long)&((struct stringpool_t *)0)->stringpool_str731,
55 + (int)(long)&((struct stringpool_t *)0)->stringpool_str501,
56 + (int)(long)&((struct stringpool_t *)0)->stringpool_str696,
57 + (int)(long)&((struct stringpool_t *)0)->stringpool_str626,
58 + (int)(long)&((struct stringpool_t *)0)->stringpool_str610,
59 + (int)(long)&((struct stringpool_t *)0)->stringpool_str680,
60 + (int)(long)&((struct stringpool_t *)0)->stringpool_str518,
61 + (int)(long)&((struct stringpool_t *)0)->stringpool_str1033,
62 + (int)(long)&((struct stringpool_t *)0)->stringpool_str986,
63 + (int)(long)&((struct stringpool_t *)0)->stringpool_str760,
64 + (int)(long)&((struct stringpool_t *)0)->stringpool_str655,
65 + (int)(long)&((struct stringpool_t *)0)->stringpool_str479,
66 + (int)(long)&((struct stringpool_t *)0)->stringpool_str584,
67 + (int)(long)&((struct stringpool_t *)0)->stringpool_str393,
68 + (int)(long)&((struct stringpool_t *)0)->stringpool_str436,
69 + (int)(long)&((struct stringpool_t *)0)->stringpool_str273,
70 + (int)(long)&((struct stringpool_t *)0)->stringpool_str418,
71 + (int)(long)&((struct stringpool_t *)0)->stringpool_str76,
72 + (int)(long)&((struct stringpool_t *)0)->stringpool_str151,
73 + (int)(long)&((struct stringpool_t *)0)->stringpool_str305,
74 + (int)(long)&((struct stringpool_t *)0)->stringpool_str301,
75 + (int)(long)&((struct stringpool_t *)0)->stringpool_str333,
76 + (int)(long)&((struct stringpool_t *)0)->stringpool_str282,
77 + (int)(long)&((struct stringpool_t *)0)->stringpool_str256,
78 + (int)(long)&((struct stringpool_t *)0)->stringpool_str337,
79 + (int)(long)&((struct stringpool_t *)0)->stringpool_str653,
80 + (int)(long)&((struct stringpool_t *)0)->stringpool_str738,
81 + (int)(long)&((struct stringpool_t *)0)->stringpool_str790,
82 + (int)(long)&((struct stringpool_t *)0)->stringpool_str750,
83 + (int)(long)&((struct stringpool_t *)0)->stringpool_str302,
84 + (int)(long)&((struct stringpool_t *)0)->stringpool_str373,
85 + (int)(long)&((struct stringpool_t *)0)->stringpool_str81,
86 + (int)(long)&((struct stringpool_t *)0)->stringpool_str260,
87 + (int)(long)&((struct stringpool_t *)0)->stringpool_str525,
88 + (int)(long)&((struct stringpool_t *)0)->stringpool_str644,
89 + (int)(long)&((struct stringpool_t *)0)->stringpool_str243,
90 + (int)(long)&((struct stringpool_t *)0)->stringpool_str571,
91 + (int)(long)&((struct stringpool_t *)0)->stringpool_str574,
92 + (int)(long)&((struct stringpool_t *)0)->stringpool_str606,
93 + (int)(long)&((struct stringpool_t *)0)->stringpool_str575,
94 + (int)(long)&((struct stringpool_t *)0)->stringpool_str281,
95 + (int)(long)&((struct stringpool_t *)0)->stringpool_str191,
96 + (int)(long)&((struct stringpool_t *)0)->stringpool_str193,
97 + (int)(long)&((struct stringpool_t *)0)->stringpool_str349,
98 + (int)(long)&((struct stringpool_t *)0)->stringpool_str327,
99 + (int)(long)&((struct stringpool_t *)0)->stringpool_str474,
100 + (int)(long)&((struct stringpool_t *)0)->stringpool_str176,
101 + (int)(long)&((struct stringpool_t *)0)->stringpool_str621,
102 + (int)(long)&((struct stringpool_t *)0)->stringpool_str288,
103 + (int)(long)&((struct stringpool_t *)0)->stringpool_str239,
104 + (int)(long)&((struct stringpool_t *)0)->stringpool_str734,
105 + (int)(long)&((struct stringpool_t *)0)->stringpool_str735,
106 + (int)(long)&((struct stringpool_t *)0)->stringpool_str754,
107 + (int)(long)&((struct stringpool_t *)0)->stringpool_str615,
108 + (int)(long)&((struct stringpool_t *)0)->stringpool_str203,
109 + (int)(long)&((struct stringpool_t *)0)->stringpool_str138,
110 + (int)(long)&((struct stringpool_t *)0)->stringpool_str951,
111 + (int)(long)&((struct stringpool_t *)0)->stringpool_str249,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str453,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str308,
3 + (int)(long)&((struct stringpool_t *)0)->stringpool_str319,
4 + (int)(long)&((struct stringpool_t *)0)->stringpool_str586,
5 + (int)(long)&((struct stringpool_t *)0)->stringpool_str346,
6 + (int)(long)&((struct stringpool_t *)0)->stringpool_str283,
7 + (int)(long)&((struct stringpool_t *)0)->stringpool_str568,
8 + (int)(long)&((struct stringpool_t *)0)->stringpool_str328,
9 + (int)(long)&((struct stringpool_t *)0)->stringpool_str280,
10 + (int)(long)&((struct stringpool_t *)0)->stringpool_str575,
11 + (int)(long)&((struct stringpool_t *)0)->stringpool_str335,
12 + (int)(long)&((struct stringpool_t *)0)->stringpool_str431,
13 + (int)(long)&((struct stringpool_t *)0)->stringpool_str698,
14 + (int)(long)&((struct stringpool_t *)0)->stringpool_str458,
15 + (int)(long)&((struct stringpool_t *)0)->stringpool_str608,
16 + (int)(long)&((struct stringpool_t *)0)->stringpool_str381,
17 + (int)(long)&((struct stringpool_t *)0)->stringpool_str911,
18 + (int)(long)&((struct stringpool_t *)0)->stringpool_str363,
19 + (int)(long)&((struct stringpool_t *)0)->stringpool_str893,
20 + (int)(long)&((struct stringpool_t *)0)->stringpool_str64,
21 + (int)(long)&((struct stringpool_t *)0)->stringpool_str664,
22 + (int)(long)&((struct stringpool_t *)0)->stringpool_str134,
23 + (int)(long)&((struct stringpool_t *)0)->stringpool_str186,
24 + (int)(long)&((struct stringpool_t *)0)->stringpool_str324,
25 + (int)(long)&((struct stringpool_t *)0)->stringpool_str150,
26 + (int)(long)&((struct stringpool_t *)0)->stringpool_str154,
27 + (int)(long)&((struct stringpool_t *)0)->stringpool_str130,
28 + (int)(long)&((struct stringpool_t *)0)->stringpool_str466,
29 + (int)(long)&((struct stringpool_t *)0)->stringpool_str166,
30 + (int)(long)&((struct stringpool_t *)0)->stringpool_str170,
31 + (int)(long)&((struct stringpool_t *)0)->stringpool_str322,
32 + (int)(long)&((struct stringpool_t *)0)->stringpool_str142,
33 + (int)(long)&((struct stringpool_t *)0)->stringpool_str332,
34 + (int)(long)&((struct stringpool_t *)0)->stringpool_str158,
35 + (int)(long)&((struct stringpool_t *)0)->stringpool_str162,
36 + (int)(long)&((struct stringpool_t *)0)->stringpool_str138,
37 + (int)(long)&((struct stringpool_t *)0)->stringpool_str203,
38 + (int)(long)&((struct stringpool_t *)0)->stringpool_str663,
39 + (int)(long)&((struct stringpool_t *)0)->stringpool_str669,
40 + (int)(long)&((struct stringpool_t *)0)->stringpool_str268,
41 + (int)(long)&((struct stringpool_t *)0)->stringpool_str88,
42 + (int)(long)&((struct stringpool_t *)0)->stringpool_str140,
43 + (int)(long)&((struct stringpool_t *)0)->stringpool_str278,
44 + (int)(long)&((struct stringpool_t *)0)->stringpool_str104,
45 + (int)(long)&((struct stringpool_t *)0)->stringpool_str108,
46 + (int)(long)&((struct stringpool_t *)0)->stringpool_str84,
47 + (int)(long)&((struct stringpool_t *)0)->stringpool_str420,
48 + (int)(long)&((struct stringpool_t *)0)->stringpool_str120,
49 + (int)(long)&((struct stringpool_t *)0)->stringpool_str250,
50 + (int)(long)&((struct stringpool_t *)0)->stringpool_str110,
51 + (int)(long)&((struct stringpool_t *)0)->stringpool_str54,
52 + (int)(long)&((struct stringpool_t *)0)->stringpool_str147,
53 + (int)(long)&((struct stringpool_t *)0)->stringpool_str476,
54 + (int)(long)&((struct stringpool_t *)0)->stringpool_str463,
55 + (int)(long)&((struct stringpool_t *)0)->stringpool_str430,
56 + (int)(long)&((struct stringpool_t *)0)->stringpool_str562,
57 + (int)(long)&((struct stringpool_t *)0)->stringpool_str813,
58 + (int)(long)&((struct stringpool_t *)0)->stringpool_str225,
59 + (int)(long)&((struct stringpool_t *)0)->stringpool_str777,
60 + (int)(long)&((struct stringpool_t *)0)->stringpool_str541,
61 + (int)(long)&((struct stringpool_t *)0)->stringpool_str648,
62 + (int)(long)&((struct stringpool_t *)0)->stringpool_str848,
63 + (int)(long)&((struct stringpool_t *)0)->stringpool_str769,
64 + (int)(long)&((struct stringpool_t *)0)->stringpool_str389,
65 + (int)(long)&((struct stringpool_t *)0)->stringpool_str407,
66 + (int)(long)&((struct stringpool_t *)0)->stringpool_str561,
67 + (int)(long)&((struct stringpool_t *)0)->stringpool_str391,
68 + (int)(long)&((struct stringpool_t *)0)->stringpool_str455,
69 + (int)(long)&((struct stringpool_t *)0)->stringpool_str396,
70 + (int)(long)&((struct stringpool_t *)0)->stringpool_str253,
71 + (int)(long)&((struct stringpool_t *)0)->stringpool_str173,
72 + (int)(long)&((struct stringpool_t *)0)->stringpool_str176,
73 + (int)(long)&((struct stringpool_t *)0)->stringpool_str375,
74 + (int)(long)&((struct stringpool_t *)0)->stringpool_str337,
75 + (int)(long)&((struct stringpool_t *)0)->stringpool_str282,
76 + (int)(long)&((struct stringpool_t *)0)->stringpool_str242,
77 + (int)(long)&((struct stringpool_t *)0)->stringpool_str228,
78 + (int)(long)&((struct stringpool_t *)0)->stringpool_str233,
79 + (int)(long)&((struct stringpool_t *)0)->stringpool_str367,
80 + (int)(long)&((struct stringpool_t *)0)->stringpool_str628,
81 + (int)(long)&((struct stringpool_t *)0)->stringpool_str660,
82 + (int)(long)&((struct stringpool_t *)0)->stringpool_str590,
83 + (int)(long)&((struct stringpool_t *)0)->stringpool_str345,
84 + (int)(long)&((struct stringpool_t *)0)->stringpool_str442,
85 + (int)(long)&((struct stringpool_t *)0)->stringpool_str89,
86 + (int)(long)&((struct stringpool_t *)0)->stringpool_str311,
87 + (int)(long)&((struct stringpool_t *)0)->stringpool_str414,
88 + (int)(long)&((struct stringpool_t *)0)->stringpool_str237,
89 + (int)(long)&((struct stringpool_t *)0)->stringpool_str209,
90 + (int)(long)&((struct stringpool_t *)0)->stringpool_str596,
91 + (int)(long)&((struct stringpool_t *)0)->stringpool_str491,
92 + (int)(long)&((struct stringpool_t *)0)->stringpool_str517,
93 + (int)(long)&((struct stringpool_t *)0)->stringpool_str493,
94 + (int)(long)&((struct stringpool_t *)0)->stringpool_str72,
95 + (int)(long)&((struct stringpool_t *)0)->stringpool_str338,
96 + (int)(long)&((struct stringpool_t *)0)->stringpool_str153,
97 + (int)(long)&((struct stringpool_t *)0)->stringpool_str459,
98 + (int)(long)&((struct stringpool_t *)0)->stringpool_str254,
99 + (int)(long)&((struct stringpool_t *)0)->stringpool_str281,
100 + (int)(long)&((struct stringpool_t *)0)->stringpool_str49,
101 + (int)(long)&((struct stringpool_t *)0)->stringpool_str441,
102 + (int)(long)&((struct stringpool_t *)0)->stringpool_str315,
103 + (int)(long)&((struct stringpool_t *)0)->stringpool_str252,
104 + (int)(long)&((struct stringpool_t *)0)->stringpool_str846,
105 + (int)(long)&((struct stringpool_t *)0)->stringpool_str828,
106 + (int)(long)&((struct stringpool_t *)0)->stringpool_str836,
107 + (int)(long)&((struct stringpool_t *)0)->stringpool_str526,
108 + (int)(long)&((struct stringpool_t *)0)->stringpool_str210,
109 + (int)(long)&((struct stringpool_t *)0)->stringpool_str106,
110 + (int)(long)&((struct stringpool_t *)0)->stringpool_str837,
111 + (int)(long)&((struct stringpool_t *)0)->stringpool_str392,
1 + (int)(long)&((struct stringpool_t *)0)->stringpool_str239,
2 + (int)(long)&((struct stringpool_t *)0)->stringpool_str275,
3 + (int)(long)&((struct stringpool_t *)0)->stringpool_str218,
4 + (int)(long)&((struct stringpool_t *)0)->stringpool_str532,
5 + (int)(long)&((struct stringpool_t *)0)->stringpool_str517,
6 + (int)(long)&((struct stringpool_t *)0)->stringpool_str264,
7 + (int)(long)&((struct stringpool_t *)0)->stringpool_str555,
8 + (int)(long)&((struct stringpool_t *)0)->stringpool_str540,
9 + (int)(long)&((struct stringpool_t *)0)->stringpool_str272,
10 + (int)(long)&((struct stringpool_t *)0)->stringpool_str591,
11 + (int)(long)&((struct stringpool_t *)0)->stringpool_str576,
12 + (int)(long)&((struct stringpool_t *)0)->stringpool_str365,
13 + (int)(long)&((struct stringpool_t *)0)->stringpool_str679,
14 + (int)(long)&((struct stringpool_t *)0)->stringpool_str664,
15 + (int)(long)&((struct stringpool_t *)0)->stringpool_str603,
16 + (int)(long)&((struct stringpool_t *)0)->stringpool_str530,
17 + (int)(long)&((struct stringpool_t *)0)->stringpool_str797,
18 + (int)(long)&((struct stringpool_t *)0)->stringpool_str553,
19 + (int)(long)&((struct stringpool_t *)0)->stringpool_str820,
20 + (int)(long)&((struct stringpool_t *)0)->stringpool_str19,
21 + (int)(long)&((struct stringpool_t *)0)->stringpool_str330,
22 + (int)(long)&((struct stringpool_t *)0)->stringpool_str61,
23 + (int)(long)&((struct stringpool_t *)0)->stringpool_str73,
24 + (int)(long)&((struct stringpool_t *)0)->stringpool_str227,
25 + (int)(long)&((struct stringpool_t *)0)->stringpool_str119,
26 + (int)(long)&((struct stringpool_t *)0)->stringpool_str65,
27 + (int)(long)&((struct stringpool_t *)0)->stringpool_str63,
28 + (int)(long)&((struct stringpool_t *)0)->stringpool_str397,
29 + (int)(long)&((struct stringpool_t *)0)->stringpool_str69,
30 + (int)(long)&((struct stringpool_t *)0)->stringpool_str71,
31 + (int)(long)&((struct stringpool_t *)0)->stringpool_str128,
32 + (int)(long)&((struct stringpool_t *)0)->stringpool_str64,
33 + (int)(long)&((struct stringpool_t *)0)->stringpool_str230,
34 + (int)(long)&((struct stringpool_t *)0)->stringpool_str122,
35 + (int)(long)&((struct stringpool_t *)0)->stringpool_str68,
36 + (int)(long)&((struct stringpool_t *)0)->stringpool_str66,
37 + (int)(long)&((struct stringpool_t *)0)->stringpool_str207,
38 + (int)(long)&((struct stringpool_t *)0)->stringpool_str373,
39 + (int)(long)&((struct stringpool_t *)0)->stringpool_str414,
40 + (int)(long)&((struct stringpool_t *)0)->stringpool_str90,
41 + (int)(long)&((struct stringpool_t *)0)->stringpool_str26,
42 + (int)(long)&((struct stringpool_t *)0)->stringpool_str38,
43 + (int)(long)&((struct stringpool_t *)0)->stringpool_str192,
44 + (int)(long)&((struct stringpool_t *)0)->stringpool_str84,
45 + (int)(long)&((struct stringpool_t *)0)->stringpool_str30,
46 + (int)(long)&((struct stringpool_t *)0)->stringpool_str28,
47 + (int)(long)&((struct stringpool_t *)0)->stringpool_str362,
48 + (int)(long)&((struct stringpool_t *)0)->stringpool_str34,
49 + (int)(long)&((struct stringpool_t *)0)->stringpool_str85,
50 + (int)(long)&((struct stringpool_t *)0)->stringpool_str32,
51 + (int)(long)&((struct stringpool_t *)0)->stringpool_str22,
52 + (int)(long)&((struct stringpool_t *)0)->stringpool_str101,
53 + (int)(long)&((struct stringpool_t *)0)->stringpool_str372,
54 + (int)(long)&((struct stringpool_t *)0)->stringpool_str644,
55 + (int)(long)&((struct stringpool_t *)0)->stringpool_str494,
56 + (int)(long)&((struct stringpool_t *)0)->stringpool_str290,
57 + (int)(long)&((struct stringpool_t *)0)->stringpool_str424,
58 + (int)(long)&((struct stringpool_t *)0)->stringpool_str509,
59 + (int)(long)&((struct stringpool_t *)0)->stringpool_str609,
60 + (int)(long)&((struct stringpool_t *)0)->stringpool_str653,
61 + (int)(long)&((struct stringpool_t *)0)->stringpool_str751,
62 + (int)(long)&((struct stringpool_t *)0)->stringpool_str956,
63 + (int)(long)&((struct stringpool_t *)0)->stringpool_str416,
64 + (int)(long)&((struct stringpool_t *)0)->stringpool_str328,
65 + (int)(long)&((struct stringpool_t *)0)->stringpool_str364,
66 + (int)(long)&((struct stringpool_t *)0)->stringpool_str678,
67 + (int)(long)&((struct stringpool_t *)0)->stringpool_str270,
68 + (int)(long)&((struct stringpool_t *)0)->stringpool_str329,
69 + (int)(long)&((struct stringpool_t *)0)->stringpool_str558,
70 + (int)(long)&((struct stringpool_t *)0)->stringpool_str183,
71 + (int)(long)&((struct stringpool_t *)0)->stringpool_str212,
72 + (int)(long)&((struct stringpool_t *)0)->stringpool_str125,
73 + (int)(long)&((struct stringpool_t *)0)->stringpool_str570,
74 + (int)(long)&((struct stringpool_t *)0)->stringpool_str267,
75 + (int)(long)&((struct stringpool_t *)0)->stringpool_str188,
76 + (int)(long)&((struct stringpool_t *)0)->stringpool_str245,
77 + (int)(long)&((struct stringpool_t *)0)->stringpool_str184,
78 + (int)(long)&((struct stringpool_t *)0)->stringpool_str146,
79 + (int)(long)&((struct stringpool_t *)0)->stringpool_str400,
80 + (int)(long)&((struct stringpool_t *)0)->stringpool_str593,
81 + (int)(long)&((struct stringpool_t *)0)->stringpool_str601,
82 + (int)(long)&((struct stringpool_t *)0)->stringpool_str573,
83 + (int)(long)&((struct stringpool_t *)0)->stringpool_str295,
84 + (int)(long)&((struct stringpool_t *)0)->stringpool_str377,
85 + (int)(long)&((struct stringpool_t *)0)->stringpool_str89,
86 + (int)(long)&((struct stringpool_t *)0)->stringpool_str240,
87 + (int)(long)&((struct stringpool_t *)0)->stringpool_str542,
88 + (int)(long)&((struct stringpool_t *)0)->stringpool_str608,
89 + (int)(long)&((struct stringpool_t *)0)->stringpool_str115,
90 + (int)(long)&((struct stringpool_t *)0)->stringpool_str539,
91 + (int)(long)&((struct stringpool_t *)0)->stringpool_str404,
92 + (int)(long)&((struct stringpool_t *)0)->stringpool_str410,
93 + (int)(long)&((struct stringpool_t *)0)->stringpool_str467,
94 + (int)(long)&((struct stringpool_t *)0)->stringpool_str106,
95 + (int)(long)&((struct stringpool_t *)0)->stringpool_str307,
96 + (int)(long)&((struct stringpool_t *)0)->stringpool_str105,
97 + (int)(long)&((struct stringpool_t *)0)->stringpool_str300,
98 + (int)(long)&((struct stringpool_t *)0)->stringpool_str103,
99 + (int)(long)&((struct stringpool_t *)0)->stringpool_str131,
100 + (int)(long)&((struct stringpool_t *)0)->stringpool_str124,
101 + (int)(long)&((struct stringpool_t *)0)->stringpool_str448,
102 + (int)(long)&((struct stringpool_t *)0)->stringpool_str274,
103 + (int)(long)&((struct stringpool_t *)0)->stringpool_str86,
104 + (int)(long)&((struct stringpool_t *)0)->stringpool_str841,
105 + (int)(long)&((struct stringpool_t *)0)->stringpool_str836,
106 + (int)(long)&((struct stringpool_t *)0)->stringpool_str865,
107 + (int)(long)&((struct stringpool_t *)0)->stringpool_str701,
108 + (int)(long)&((struct stringpool_t *)0)->stringpool_str279,
109 + (int)(long)&((struct stringpool_t *)0)->stringpool_str59,
110 + (int)(long)&((struct stringpool_t *)0)->stringpool_str645,
111 + (int)(long)&((struct stringpool_t *)0)->stringpool_str276,
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * BIG-5
22 + */
23 +
24 +static int
25 +ces_big5_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
26 +{
27 + unsigned char c = *s;
28 + /* Code set 0 (ASCII) */
29 + if (c < 0x80)
30 + return ascii_mbtowc(conv,pwc,s,n);
31 + /* Code set 1 (BIG5) */
32 + if (c >= 0xa1 && c < 0xff) {
33 + if (n < 2)
34 + return RET_TOOFEW(0);
35 + {
36 + unsigned char c2 = s[1];
37 + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff))
38 + return big5_mbtowc(conv,pwc,s,2);
39 + else
40 + return RET_ILSEQ;
41 + }
42 + }
43 + return RET_ILSEQ;
44 +}
45 +
46 +static int
47 +ces_big5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
48 +{
49 + unsigned char buf[2];
50 + int ret;
51 +
52 + /* Code set 0 (ASCII) */
53 + ret = ascii_wctomb(conv,r,wc,n);
54 + if (ret != RET_ILUNI)
55 + return ret;
56 +
57 + /* Code set 1 (BIG5) */
58 + ret = big5_wctomb(conv,buf,wc,2);
59 + if (ret != RET_ILUNI) {
60 + if (ret != 2) abort();
61 + if (n < 2)
62 + return RET_TOOSMALL;
63 + r[0] = buf[0];
64 + r[1] = buf[1];
65 + return 2;
66 + }
67 +
68 + return RET_ILUNI;
69 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2005, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * GBK
22 + */
23 +
24 +static int
25 +ces_gbk_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
26 +{
27 + unsigned char c = *s;
28 +
29 + /* Code set 0 (ASCII or GB 1988-89) */
30 + if (c < 0x80)
31 + return ascii_mbtowc(conv,pwc,s,n);
32 + /* Code set 1 (GBK) */
33 + if (c >= 0x81 && c < 0xff) {
34 + if (n < 2)
35 + return RET_TOOFEW(0);
36 + return gbk_mbtowc(conv,pwc,s,2);
37 + }
38 + return RET_ILSEQ;
39 +}
40 +
41 +static int
42 +ces_gbk_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
43 +{
44 + unsigned char buf[2];
45 + int ret;
46 +
47 + /* Code set 0 (ASCII or GB 1988-89) */
48 + ret = ascii_wctomb(conv,r,wc,n);
49 + if (ret != RET_ILUNI)
50 + return ret;
51 +
52 + /* Code set 1 (GBK) */
53 + ret = gbk_wctomb(conv,buf,wc,2);
54 + if (ret != RET_ILUNI) {
55 + if (ret != 2) abort();
56 + if (n < 2)
57 + return RET_TOOSMALL;
58 + r[0] = buf[0];
59 + r[1] = buf[1];
60 + return 2;
61 + }
62 +
63 + return RET_ILUNI;
64 +}
This diff could not be displayed because it is too large.
1 +/*
2 + * Copyright (C) 1999-2001 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CNS 11643-1992
22 + */
23 +
24 +/* ISO-2022-CN and EUC-TW use CNS 11643-1992 planes 1 to 7. We also
25 + * have a table for the older plane 15. We use a trick to keep the
26 + * Unicode -> CNS 11643 table as small as possible (see cns11643_inv.h).
27 + */
28 +
29 +#include "cns11643_1.h"
30 +#include "cns11643_2.h"
31 +#include "cns11643_3.h"
32 +#include "cns11643_4.h"
33 +#include "cns11643_5.h"
34 +#include "cns11643_6.h"
35 +#include "cns11643_7.h"
36 +#include "cns11643_15.h"
37 +#include "cns11643_inv.h"
38 +
39 +/* Returns the plane number (1,...,7,15) in r[0], the two bytes in r[1],r[2]. */
40 +#define cns11643_wctomb cns11643_inv_wctomb
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CNS 11643-1992 plane 4
22 + */
23 +
24 +/*
25 + * The table has been split into two parts. Each part's entries fit it 16 bits.
26 + * But the combined table would need 17 bits per entry.
27 + */
28 +#include "cns11643_4a.h"
29 +#include "cns11643_4b.h"
30 +
31 +static int
32 +cns11643_4_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
33 +{
34 + unsigned char c1 = s[0];
35 + if ((c1 >= 0x21 && c1 <= 0x6e)) {
36 + if (n >= 2) {
37 + unsigned char c2 = s[1];
38 + if (c2 >= 0x21 && c2 < 0x7f) {
39 + unsigned int i = 94 * (c1 - 0x21) + (c2 - 0x21);
40 + ucs4_t wc = 0xfffd;
41 + unsigned short swc;
42 + {
43 + if (i < 2914)
44 + swc = cns11643_4a_2uni_page21[i],
45 + wc = cns11643_4a_2uni_upages[swc>>8] | (swc & 0xff);
46 + else if (i < 7298)
47 + swc = cns11643_4b_2uni_page40[i-2914],
48 + wc = cns11643_4b_2uni_upages[swc>>8] | (swc & 0xff);
49 + }
50 + if (wc != 0xfffd) {
51 + *pwc = wc;
52 + return 2;
53 + }
54 + }
55 + return RET_ILSEQ;
56 + }
57 + return RET_TOOFEW(0);
58 + }
59 + return RET_ILSEQ;
60 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
1 +/*
2 + * Copyright (C) 1999-2002, 2004-2011, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/* This file defines all the converters. */
21 +
22 +
23 +/* Our own notion of wide character, as UCS-4, according to ISO-10646-1. */
24 +typedef unsigned int ucs4_t;
25 +
26 +/* State used by a conversion. 0 denotes the initial state. */
27 +typedef unsigned int state_t;
28 +
29 +/* iconv_t is an opaque type. This is the real iconv_t type. */
30 +typedef struct conv_struct * conv_t;
31 +
32 +/*
33 + * Data type for conversion multibyte -> unicode
34 + */
35 +struct mbtowc_funcs {
36 + int (*xxx_mbtowc) (conv_t conv, ucs4_t *pwc, unsigned char const *s, size_t n);
37 + /*
38 + * int xxx_mbtowc (conv_t conv, ucs4_t *pwc, unsigned char const *s, size_t n)
39 + * converts the byte sequence starting at s to a wide character. Up to n bytes
40 + * are available at s. n is >= 1.
41 + * Result is number of bytes consumed (if a wide character was read),
42 + * or -1 if invalid, or -2 if n too small,
43 + * or RET_SHIFT_ILSEQ(number of bytes consumed) if invalid input after a shift
44 + * sequence was read,
45 + * or RET_TOOFEW(number of bytes consumed) if only a shift sequence was read.
46 + */
47 + int (*xxx_flushwc) (conv_t conv, ucs4_t *pwc);
48 + /*
49 + * int xxx_flushwc (conv_t conv, ucs4_t *pwc)
50 + * returns to the initial state and stores the pending wide character, if any.
51 + * Result is 1 (if a wide character was read) or 0 if none was pending.
52 + */
53 +};
54 +
55 +/* Return code if invalid input after a shift sequence of n bytes was read.
56 + (xxx_mbtowc) */
57 +#define RET_SHIFT_ILSEQ(n) (-1-2*(n))
58 +/* Return code if invalid. (xxx_mbtowc) */
59 +#define RET_ILSEQ RET_SHIFT_ILSEQ(0)
60 +/* Return code if only a shift sequence of n bytes was read. (xxx_mbtowc) */
61 +#define RET_TOOFEW(n) (-2-2*(n))
62 +/* Retrieve the n from the encoded RET_... value. */
63 +#define DECODE_SHIFT_ILSEQ(r) ((unsigned int)(RET_SHIFT_ILSEQ(0) - (r)) / 2)
64 +#define DECODE_TOOFEW(r) ((unsigned int)(RET_TOOFEW(0) - (r)) / 2)
65 +/* Maximum value of n that may be used as argument to RET_SHIFT_ILSEQ or RET_TOOFEW. */
66 +#define RET_COUNT_MAX ((INT_MAX / 2) - 1)
67 +
68 +/*
69 + * Data type for conversion unicode -> multibyte
70 + */
71 +struct wctomb_funcs {
72 + int (*xxx_wctomb) (conv_t conv, unsigned char *r, ucs4_t wc, size_t n);
73 + /*
74 + * int xxx_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
75 + * converts the wide character wc to the character set xxx, and stores the
76 + * result beginning at r. Up to n bytes may be written at r. n is >= 1.
77 + * Result is number of bytes written, or -1 if invalid, or -2 if n too small.
78 + */
79 + int (*xxx_reset) (conv_t conv, unsigned char *r, size_t n);
80 + /*
81 + * int xxx_reset (conv_t conv, unsigned char *r, size_t n)
82 + * stores a shift sequences returning to the initial state beginning at r.
83 + * Up to n bytes may be written at r. n is >= 0.
84 + * Result is number of bytes written, or -2 if n too small.
85 + */
86 +};
87 +
88 +/* Return code if invalid. (xxx_wctomb) */
89 +#define RET_ILUNI -1
90 +/* Return code if output buffer is too small. (xxx_wctomb, xxx_reset) */
91 +#define RET_TOOSMALL -2
92 +
93 +/*
94 + * Contents of a conversion descriptor.
95 + */
96 +struct conv_struct {
97 + struct loop_funcs lfuncs;
98 + /* Input (conversion multibyte -> unicode) */
99 + int iindex;
100 + struct mbtowc_funcs ifuncs;
101 + state_t istate;
102 + /* Output (conversion unicode -> multibyte) */
103 + int oindex;
104 + struct wctomb_funcs ofuncs;
105 + int oflags;
106 + state_t ostate;
107 + /* Operation flags */
108 + int transliterate;
109 + int discard_ilseq;
110 + #ifndef LIBICONV_PLUG
111 + struct iconv_fallbacks fallbacks;
112 + struct iconv_hooks hooks;
113 + #endif
114 +};
115 +
116 +/*
117 + * Include all the converters.
118 + */
119 +
120 +#include "ascii.h"
121 +
122 +/* General multi-byte encodings */
123 +#include "utf8.h"
124 +#include "ucs2.h"
125 +#include "ucs2be.h"
126 +#include "ucs2le.h"
127 +#include "ucs4.h"
128 +#include "ucs4be.h"
129 +#include "ucs4le.h"
130 +#include "utf16.h"
131 +#include "utf16be.h"
132 +#include "utf16le.h"
133 +#include "utf32.h"
134 +#include "utf32be.h"
135 +#include "utf32le.h"
136 +#include "utf7.h"
137 +#include "ucs2internal.h"
138 +#include "ucs2swapped.h"
139 +#include "ucs4internal.h"
140 +#include "ucs4swapped.h"
141 +#include "c99.h"
142 +#include "java.h"
143 +
144 +/* 8-bit encodings */
145 +#include "iso8859_1.h"
146 +#include "iso8859_2.h"
147 +#include "iso8859_3.h"
148 +#include "iso8859_4.h"
149 +#include "iso8859_5.h"
150 +#include "iso8859_6.h"
151 +#include "iso8859_7.h"
152 +#include "iso8859_8.h"
153 +#include "iso8859_9.h"
154 +#include "iso8859_10.h"
155 +#include "iso8859_11.h"
156 +#include "iso8859_13.h"
157 +#include "iso8859_14.h"
158 +#include "iso8859_15.h"
159 +#include "iso8859_16.h"
160 +#include "koi8_r.h"
161 +#include "koi8_u.h"
162 +#include "koi8_ru.h"
163 +#include "cp1250.h"
164 +#include "cp1251.h"
165 +#include "cp1252.h"
166 +#include "cp1253.h"
167 +#include "cp1254.h"
168 +#include "cp1255.h"
169 +#include "cp1256.h"
170 +#include "cp1257.h"
171 +#include "cp1258.h"
172 +#include "cp850.h"
173 +#include "cp862.h"
174 +#include "cp866.h"
175 +#include "cp1131.h"
176 +#include "mac_roman.h"
177 +#include "mac_centraleurope.h"
178 +#include "mac_iceland.h"
179 +#include "mac_croatian.h"
180 +#include "mac_romania.h"
181 +#include "mac_cyrillic.h"
182 +#include "mac_ukraine.h"
183 +#include "mac_greek.h"
184 +#include "mac_turkish.h"
185 +#include "mac_hebrew.h"
186 +#include "mac_arabic.h"
187 +#include "mac_thai.h"
188 +#include "hp_roman8.h"
189 +#include "nextstep.h"
190 +#include "armscii_8.h"
191 +#include "georgian_academy.h"
192 +#include "georgian_ps.h"
193 +#include "koi8_t.h"
194 +#include "pt154.h"
195 +#include "rk1048.h"
196 +#include "mulelao.h"
197 +#include "cp1133.h"
198 +#include "tis620.h"
199 +#include "cp874.h"
200 +#include "viscii.h"
201 +#include "tcvn.h"
202 +
203 +/* CJK character sets [CCS = coded character set] [CJKV.INF chapter 3] */
204 +
205 +typedef struct {
206 + unsigned short indx; /* index into big table */
207 + unsigned short used; /* bitmask of used entries */
208 +} Summary16;
209 +
210 +#include "iso646_jp.h"
211 +#include "jisx0201.h"
212 +#include "jisx0208.h"
213 +#include "jisx0212.h"
214 +
215 +#include "iso646_cn.h"
216 +#include "gb2312.h"
217 +#include "isoir165.h"
218 +/*#include "gb12345.h"*/
219 +#include "gbk.h"
220 +#include "cns11643.h"
221 +#include "big5.h"
222 +
223 +#include "ksc5601.h"
224 +#include "johab_hangul.h"
225 +
226 +/* CJK encodings [CES = character encoding scheme] [CJKV.INF chapter 4] */
227 +
228 +#include "euc_jp.h"
229 +#include "sjis.h"
230 +#include "cp932.h"
231 +#include "iso2022_jp.h"
232 +#include "iso2022_jp1.h"
233 +#include "iso2022_jp2.h"
234 +#include "iso2022_jpms.h"
235 +
236 +#include "euc_cn.h"
237 +#include "ces_gbk.h"
238 +#include "cp936.h"
239 +#include "gb18030.h"
240 +#include "iso2022_cn.h"
241 +#include "iso2022_cnext.h"
242 +#include "hz.h"
243 +#include "euc_tw.h"
244 +#include "ces_big5.h"
245 +#include "cp950.h"
246 +#include "big5hkscs1999.h"
247 +#include "big5hkscs2001.h"
248 +#include "big5hkscs2004.h"
249 +#include "big5hkscs2008.h"
250 +
251 +#include "euc_kr.h"
252 +#include "cp949.h"
253 +#include "johab.h"
254 +#include "iso2022_kr.h"
255 +
256 +/* Encodings used by system dependent locales. */
257 +
258 +#ifdef USE_AIX
259 +#include "cp856.h"
260 +#include "cp922.h"
261 +#include "cp943.h"
262 +#include "cp1046.h"
263 +#include "cp1124.h"
264 +#include "cp1129.h"
265 +#include "cp1161.h"
266 +#include "cp1162.h"
267 +#include "cp1163.h"
268 +#endif
269 +
270 +#ifdef USE_OSF1
271 +#include "dec_kanji.h"
272 +#include "dec_hanyu.h"
273 +#endif
274 +
275 +#ifdef USE_DOS
276 +#include "cp437.h"
277 +#include "cp737.h"
278 +#include "cp775.h"
279 +#include "cp852.h"
280 +#include "cp853.h"
281 +#include "cp855.h"
282 +#include "cp857.h"
283 +#include "cp858.h"
284 +#include "cp860.h"
285 +#include "cp861.h"
286 +#include "cp863.h"
287 +#include "cp864.h"
288 +#include "cp865.h"
289 +#include "cp869.h"
290 +#include "cp1125.h"
291 +#endif
292 +
293 +#ifdef USE_EXTRA
294 +#include "euc_jisx0213.h"
295 +#include "shift_jisx0213.h"
296 +#include "iso2022_jp3.h"
297 +#include "big5_2003.h"
298 +#include "tds565.h"
299 +#include "atarist.h"
300 +#include "riscos1.h"
301 +#endif
302 +
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1046
22 + */
23 +
24 +static const unsigned short cp1046_2uni[128] = {
25 + /* 0x80 */
26 + 0xfe88, 0x00d7, 0x00f7, 0xf8f6, 0xf8f5, 0xf8f4, 0xf8f7, 0xfe71,
27 + 0x0088, 0x25a0, 0x2502, 0x2500, 0x2510, 0x250c, 0x2514, 0x2518,
28 + /* 0x90 */
29 + 0xfe79, 0xfe7b, 0xfe7d, 0xfe7f, 0xfe77, 0xfe8a, 0xfef0, 0xfef3,
30 + 0xfef2, 0xfece, 0xfecf, 0xfed0, 0xfef6, 0xfef8, 0xfefa, 0xfefc,
31 + /* 0xa0 */
32 + 0x00a0, 0xf8fa, 0xf8f9, 0xf8f8, 0x00a4, 0xf8fb, 0xfe8b, 0xfe91,
33 + 0xfe97, 0xfe9b, 0xfe9f, 0xfea3, 0x060c, 0x00ad, 0xfea7, 0xfeb3,
34 + /* 0xb0 */
35 + 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667,
36 + 0x0668, 0x0669, 0xfeb7, 0x061b, 0xfebb, 0xfebf, 0xfeca, 0x061f,
37 + /* 0xc0 */
38 + 0xfecb, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
39 + 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
40 + /* 0xd0 */
41 + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
42 + 0xfec7, 0x0639, 0x063a, 0xfecc, 0xfe82, 0xfe84, 0xfe8e, 0xfed3,
43 + /* 0xe0 */
44 + 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
45 + 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
46 + /* 0xf0 */
47 + 0x0650, 0x0651, 0x0652, 0xfed7, 0xfedb, 0xfedf, 0xf8fc, 0xfef5,
48 + 0xfef7, 0xfef9, 0xfefb, 0xfee3, 0xfee7, 0xfeec, 0xfee9, 0xfffd,
49 +};
50 +
51 +static int
52 +cp1046_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
53 +{
54 + unsigned char c = *s;
55 + if (c < 0x80) {
56 + *pwc = (ucs4_t) c;
57 + return 1;
58 + }
59 + else {
60 + unsigned short wc = cp1046_2uni[c-0x80];
61 + if (wc != 0xfffd) {
62 + *pwc = (ucs4_t) wc;
63 + return 1;
64 + }
65 + }
66 + return RET_ILSEQ;
67 +}
68 +
69 +static const unsigned char cp1046_page00[112] = {
70 + 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
71 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
72 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
73 + 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
74 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
75 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
76 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
77 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
78 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
79 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, /* 0xd0-0xd7 */
80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
81 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
82 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
83 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, /* 0xf0-0xf7 */
84 +};
85 +static const unsigned char cp1046_page06[104] = {
86 + 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */
87 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
88 + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */
89 + 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
90 + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
91 + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
92 + 0x00, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
93 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
94 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
95 + 0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
96 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
97 + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x60-0x67 */
98 + 0xb8, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
99 +};
100 +static const unsigned char cp1046_page25[32] = {
101 + 0x8b, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
102 + 0x00, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, /* 0x08-0x0f */
103 + 0x8c, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x10-0x17 */
104 + 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
105 +};
106 +static const unsigned char cp1046_pagef8[16] = {
107 + 0x00, 0x00, 0x00, 0x00, 0x85, 0x84, 0x83, 0x86, /* 0xf0-0xf7 */
108 + 0xa3, 0xa2, 0xa1, 0xa5, 0xf6, 0x00, 0x00, 0x00, /* 0xf8-0xff */
109 +};
110 +static const unsigned char cp1046_pagefe[144] = {
111 + 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, /* 0x70-0x77 */
112 + 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00, 0x93, /* 0x78-0x7f */
113 + 0x00, 0x00, 0xdc, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x80-0x87 */
114 + 0x80, 0x00, 0x95, 0xa6, 0x00, 0x00, 0xde, 0x00, /* 0x88-0x8f */
115 + 0x00, 0xa7, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, /* 0x90-0x97 */
116 + 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0xaa, /* 0x98-0x9f */
117 + 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0xae, /* 0xa0-0xa7 */
118 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
119 + 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xba, /* 0xb0-0xb7 */
120 + 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0xbd, /* 0xb8-0xbf */
121 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, /* 0xc0-0xc7 */
122 + 0x00, 0x00, 0xbe, 0xc0, 0xdb, 0x00, 0x99, 0x9a, /* 0xc8-0xcf */
123 + 0x9b, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0xf3, /* 0xd0-0xd7 */
124 + 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0xf5, /* 0xd8-0xdf */
125 + 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0xfc, /* 0xe0-0xe7 */
126 + 0x00, 0xfe, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xe8-0xef */
127 + 0x96, 0x00, 0x98, 0x97, 0x00, 0xf7, 0x9c, 0xf8, /* 0xf0-0xf7 */
128 + 0x9d, 0xf9, 0x9e, 0xfa, 0x9f, 0x00, 0x00, 0x00, /* 0xf8-0xff */
129 +};
130 +
131 +static int
132 +cp1046_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
133 +{
134 + unsigned char c = 0;
135 + if (wc < 0x0080) {
136 + *r = wc;
137 + return 1;
138 + }
139 + else if (wc >= 0x0088 && wc < 0x00f8)
140 + c = cp1046_page00[wc-0x0088];
141 + else if (wc >= 0x0608 && wc < 0x0670)
142 + c = cp1046_page06[wc-0x0608];
143 + else if (wc >= 0x2500 && wc < 0x2520)
144 + c = cp1046_page25[wc-0x2500];
145 + else if (wc == 0x25a0)
146 + c = 0x89;
147 + else if (wc >= 0xf8f0 && wc < 0xf900)
148 + c = cp1046_pagef8[wc-0xf8f0];
149 + else if (wc >= 0xfe70 && wc < 0xff00)
150 + c = cp1046_pagefe[wc-0xfe70];
151 + if (c != 0) {
152 + *r = c;
153 + return 1;
154 + }
155 + return RET_ILUNI;
156 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1124
22 + */
23 +
24 +static const unsigned short cp1124_2uni[96] = {
25 + /* 0xa0 */
26 + 0x00a0, 0x0401, 0x0402, 0x0490, 0x0404, 0x0405, 0x0406, 0x0407,
27 + 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f,
28 + /* 0xb0 */
29 + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
30 + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
31 + /* 0xc0 */
32 + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
33 + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
34 + /* 0xd0 */
35 + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
36 + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
37 + /* 0xe0 */
38 + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
39 + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
40 + /* 0xf0 */
41 + 0x2116, 0x0451, 0x0452, 0x0491, 0x0454, 0x0455, 0x0456, 0x0457,
42 + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f,
43 +};
44 +
45 +static int
46 +cp1124_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
47 +{
48 + unsigned char c = *s;
49 + if (c < 0xa0)
50 + *pwc = (ucs4_t) c;
51 + else
52 + *pwc = (ucs4_t) cp1124_2uni[c-0xa0];
53 + return 1;
54 +}
55 +
56 +static const unsigned char cp1124_page00[16] = {
57 + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */
58 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
59 +};
60 +static const unsigned char cp1124_page04[152] = {
61 + 0x00, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */
62 + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x00, 0xae, 0xaf, /* 0x08-0x0f */
63 + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */
64 + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */
65 + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
66 + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
67 + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
68 + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x38-0x3f */
69 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
70 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
71 + 0x00, 0xf1, 0xf2, 0x00, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */
72 + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0xfe, 0xff, /* 0x58-0x5f */
73 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
74 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
75 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
76 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
77 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
78 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
79 + 0xa3, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
80 +};
81 +
82 +static int
83 +cp1124_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
84 +{
85 + unsigned char c = 0;
86 + if (wc < 0x00a0) {
87 + *r = wc;
88 + return 1;
89 + }
90 + else if (wc >= 0x00a0 && wc < 0x00b0)
91 + c = cp1124_page00[wc-0x00a0];
92 + else if (wc >= 0x0400 && wc < 0x0498)
93 + c = cp1124_page04[wc-0x0400];
94 + else if (wc == 0x2116)
95 + c = 0xf0;
96 + if (c != 0) {
97 + *r = c;
98 + return 1;
99 + }
100 + return RET_ILUNI;
101 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1125
22 + */
23 +
24 +static const unsigned short cp1125_2uni[80] = {
25 + /* 0xb0 */
26 + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
27 + 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510,
28 + /* 0xc0 */
29 + 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f,
30 + 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567,
31 + /* 0xd0 */
32 + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b,
33 + 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580,
34 + /* 0xe0 */
35 + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
36 + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
37 + /* 0xf0 */
38 + 0x0401, 0x0451, 0x0490, 0x0491, 0x0404, 0x0454, 0x0406, 0x0456,
39 + 0x0407, 0x0457, 0x00b7, 0x221a, 0x2116, 0x00a4, 0x25a0, 0x00a0,
40 +};
41 +
42 +static int
43 +cp1125_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
44 +{
45 + unsigned char c = *s;
46 + if (c < 0x80)
47 + *pwc = (ucs4_t) c;
48 + else if (c < 0xb0)
49 + *pwc = (ucs4_t) c + 0x0390;
50 + else
51 + *pwc = (ucs4_t) cp1125_2uni[c-0xb0];
52 + return 1;
53 +}
54 +
55 +static const unsigned char cp1125_page00[24] = {
56 + 0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
57 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
58 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
59 +};
60 +static const unsigned char cp1125_page04[152] = {
61 + 0x00, 0xf0, 0x00, 0x00, 0xf4, 0x00, 0xf6, 0xf8, /* 0x00-0x07 */
62 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
63 + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
64 + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
65 + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
66 + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
67 + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */
68 + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
69 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
70 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
71 + 0x00, 0xf1, 0x00, 0x00, 0xf5, 0x00, 0xf7, 0xf9, /* 0x50-0x57 */
72 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
73 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
74 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
75 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
76 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
77 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
78 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
79 + 0xf2, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
80 +};
81 +static const unsigned char cp1125_page25[168] = {
82 + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
83 + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
84 + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
85 + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
86 + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
87 + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
88 + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
89 + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
90 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
91 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
92 + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
93 + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
94 + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
95 + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
96 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
98 + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
99 + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
100 + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
101 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
102 + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
103 +};
104 +
105 +static int
106 +cp1125_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
107 +{
108 + unsigned char c = 0;
109 + if (wc < 0x0080) {
110 + *r = wc;
111 + return 1;
112 + }
113 + else if (wc >= 0x00a0 && wc < 0x00b8)
114 + c = cp1125_page00[wc-0x00a0];
115 + else if (wc >= 0x0400 && wc < 0x0498)
116 + c = cp1125_page04[wc-0x0400];
117 + else if (wc == 0x2116)
118 + c = 0xfc;
119 + else if (wc == 0x221a)
120 + c = 0xfb;
121 + else if (wc >= 0x2500 && wc < 0x25a8)
122 + c = cp1125_page25[wc-0x2500];
123 + if (c != 0) {
124 + *r = c;
125 + return 1;
126 + }
127 + return RET_ILUNI;
128 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1129
22 + */
23 +
24 +static const unsigned short cp1129_2uni[96] = {
25 + /* 0xa0 */
26 + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
27 + 0x0153, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
28 + /* 0xb0 */
29 + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0178, 0x00b5, 0x00b6, 0x00b7,
30 + 0x0152, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
31 + /* 0xc0 */
32 + 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
33 + 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x0300, 0x00cd, 0x00ce, 0x00cf,
34 + /* 0xd0 */
35 + 0x0110, 0x00d1, 0x0309, 0x00d3, 0x00d4, 0x01a0, 0x00d6, 0x00d7,
36 + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x01af, 0x0303, 0x00df,
37 + /* 0xe0 */
38 + 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
39 + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x0301, 0x00ed, 0x00ee, 0x00ef,
40 + /* 0xf0 */
41 + 0x0111, 0x00f1, 0x0323, 0x00f3, 0x00f4, 0x01a1, 0x00f6, 0x00f7,
42 + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x01b0, 0x20ab, 0x00ff,
43 +};
44 +
45 +static int
46 +cp1129_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
47 +{
48 + unsigned char c = *s;
49 + if (c < 0xa0)
50 + *pwc = (ucs4_t) c;
51 + else
52 + *pwc = (ucs4_t) cp1129_2uni[c-0xa0];
53 + return 1;
54 +}
55 +
56 +static const unsigned char cp1129_page00[272] = {
57 + 0x00, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
58 + 0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
59 + 0x00, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
60 + 0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
61 + 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
62 + 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
63 + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
64 + 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
65 + 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */
66 + 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */
67 + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff, /* 0xf8-0xff */
68 + /* 0x0100 */
69 + 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
70 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
71 + 0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
72 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
73 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
74 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
75 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
76 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
77 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
78 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
79 + 0x00, 0x00, 0xb8, 0xa8, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
81 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
82 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
83 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
84 + 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
85 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
86 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
87 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
89 + 0xd5, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
90 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, /* 0xa8-0xaf */
91 + 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
92 +};
93 +static const unsigned char cp1129_page03[40] = {
94 + 0xcc, 0xec, 0x00, 0xde, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
95 + 0x00, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
96 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
98 + 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
99 +};
100 +
101 +static int
102 +cp1129_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
103 +{
104 + unsigned char c = 0;
105 + if (wc < 0x00a8) {
106 + *r = wc;
107 + return 1;
108 + }
109 + else if (wc >= 0x00a8 && wc < 0x01b8)
110 + c = cp1129_page00[wc-0x00a8];
111 + else if (wc >= 0x0300 && wc < 0x0328)
112 + c = cp1129_page03[wc-0x0300];
113 + else if (wc == 0x20ab)
114 + c = 0xfe;
115 + if (c != 0) {
116 + *r = c;
117 + return 1;
118 + }
119 + return RET_ILUNI;
120 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1131
22 + */
23 +
24 +static const unsigned short cp1131_2uni[128] = {
25 + /* 0x80 */
26 + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
27 + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
28 + /* 0x90 */
29 + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
30 + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
31 + /* 0xa0 */
32 + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
33 + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
34 + /* 0xb0 */
35 + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
36 + 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510,
37 + /* 0xc0 */
38 + 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f,
39 + 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567,
40 + /* 0xd0 */
41 + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b,
42 + 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580,
43 + /* 0xe0 */
44 + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
45 + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
46 + /* 0xf0 */
47 + 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040e, 0x045e,
48 + 0x0406, 0x0456, 0x00b7, 0x00a4, 0x0490, 0x0491, 0x2219, 0x00a0,
49 +};
50 +
51 +static int
52 +cp1131_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
53 +{
54 + unsigned char c = *s;
55 + if (c < 0x80)
56 + *pwc = (ucs4_t) c;
57 + else
58 + *pwc = (ucs4_t) cp1131_2uni[c-0x80];
59 + return 1;
60 +}
61 +
62 +static const unsigned char cp1131_page00[24] = {
63 + 0xff, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
64 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
65 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
66 +};
67 +static const unsigned char cp1131_page04[152] = {
68 + 0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, 0xf8, 0xf4, /* 0x00-0x07 */
69 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */
70 + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
71 + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
72 + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
73 + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
74 + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */
75 + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
76 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
77 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
78 + 0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, 0xf9, 0xf5, /* 0x50-0x57 */
79 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */
80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
81 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
82 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
83 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
84 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
85 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
86 + 0xfc, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
87 +};
88 +static const unsigned char cp1131_page25[152] = {
89 + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
90 + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
91 + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
92 + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
93 + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
94 + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
95 + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
96 + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
98 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
99 + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
100 + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
101 + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
102 + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
103 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
104 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
105 + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
106 + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
107 + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
108 +};
109 +
110 +static int
111 +cp1131_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
112 +{
113 + unsigned char c = 0;
114 + if (wc < 0x0080) {
115 + *r = wc;
116 + return 1;
117 + }
118 + else if (wc >= 0x00a0 && wc < 0x00b8)
119 + c = cp1131_page00[wc-0x00a0];
120 + else if (wc >= 0x0400 && wc < 0x0498)
121 + c = cp1131_page04[wc-0x0400];
122 + else if (wc == 0x2219)
123 + c = 0xfe;
124 + else if (wc >= 0x2500 && wc < 0x2598)
125 + c = cp1131_page25[wc-0x2500];
126 + if (c != 0) {
127 + *r = c;
128 + return 1;
129 + }
130 + return RET_ILUNI;
131 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * IBM-CP1133
22 + */
23 +
24 +static const unsigned short cp1133_2uni_1[64] = {
25 + /* 0xa0 */
26 + 0x00a0, 0x0e81, 0x0e82, 0x0e84, 0x0e87, 0x0e88, 0x0eaa, 0x0e8a,
27 + 0x0e8d, 0x0e94, 0x0e95, 0x0e96, 0x0e97, 0x0e99, 0x0e9a, 0x0e9b,
28 + /* 0xb0 */
29 + 0x0e9c, 0x0e9d, 0x0e9e, 0x0e9f, 0x0ea1, 0x0ea2, 0x0ea3, 0x0ea5,
30 + 0x0ea7, 0x0eab, 0x0ead, 0x0eae, 0xfffd, 0xfffd, 0xfffd, 0x0eaf,
31 + /* 0xc0 */
32 + 0x0eb0, 0x0eb2, 0x0eb3, 0x0eb4, 0x0eb5, 0x0eb6, 0x0eb7, 0x0eb8,
33 + 0x0eb9, 0x0ebc, 0x0eb1, 0x0ebb, 0x0ebd, 0xfffd, 0xfffd, 0xfffd,
34 + /* 0xd0 */
35 + 0x0ec0, 0x0ec1, 0x0ec2, 0x0ec3, 0x0ec4, 0x0ec8, 0x0ec9, 0x0eca,
36 + 0x0ecb, 0x0ecc, 0x0ecd, 0x0ec6, 0xfffd, 0x0edc, 0x0edd, 0x20ad,
37 +};
38 +static const unsigned short cp1133_2uni_2[16] = {
39 + /* 0xf0 */
40 + 0x0ed0, 0x0ed1, 0x0ed2, 0x0ed3, 0x0ed4, 0x0ed5, 0x0ed6, 0x0ed7,
41 + 0x0ed8, 0x0ed9, 0xfffd, 0xfffd, 0x00a2, 0x00ac, 0x00a6, 0xfffd,
42 +};
43 +
44 +static int
45 +cp1133_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
46 +{
47 + unsigned char c = *s;
48 + if (c < 0xa0) {
49 + *pwc = (ucs4_t) c;
50 + return 1;
51 + }
52 + else if (c < 0xe0) {
53 + unsigned short wc = cp1133_2uni_1[c-0xa0];
54 + if (wc != 0xfffd) {
55 + *pwc = (ucs4_t) wc;
56 + return 1;
57 + }
58 + }
59 + else if (c < 0xf0) {
60 + }
61 + else {
62 + unsigned short wc = cp1133_2uni_2[c-0xf0];
63 + if (wc != 0xfffd) {
64 + *pwc = (ucs4_t) wc;
65 + return 1;
66 + }
67 + }
68 + return RET_ILSEQ;
69 +}
70 +
71 +static const unsigned char cp1133_page00[16] = {
72 + 0xa0, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfe, 0x00, /* 0xa0-0xa7 */
73 + 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
74 +};
75 +static const unsigned char cp1133_page0e[96] = {
76 + 0x00, 0xa1, 0xa2, 0x00, 0xa3, 0x00, 0x00, 0xa4, /* 0x80-0x87 */
77 + 0xa5, 0x00, 0xa7, 0x00, 0x00, 0xa8, 0x00, 0x00, /* 0x88-0x8f */
78 + 0x00, 0x00, 0x00, 0x00, 0xa9, 0xaa, 0xab, 0xac, /* 0x90-0x97 */
79 + 0x00, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, /* 0x98-0x9f */
80 + 0x00, 0xb4, 0xb5, 0xb6, 0x00, 0xb7, 0x00, 0xb8, /* 0xa0-0xa7 */
81 + 0x00, 0x00, 0xa6, 0xb9, 0x00, 0xba, 0xbb, 0xbf, /* 0xa8-0xaf */
82 + 0xc0, 0xca, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, /* 0xb0-0xb7 */
83 + 0xc7, 0xc8, 0x00, 0xcb, 0xc9, 0xcc, 0x00, 0x00, /* 0xb8-0xbf */
84 + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xdb, 0x00, /* 0xc0-0xc7 */
85 + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0x00, 0x00, /* 0xc8-0xcf */
86 + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xd0-0xd7 */
87 + 0xf8, 0xf9, 0x00, 0x00, 0xdd, 0xde, 0x00, 0x00, /* 0xd8-0xdf */
88 +};
89 +
90 +static int
91 +cp1133_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
92 +{
93 + unsigned char c = 0;
94 + if (wc < 0x00a0) {
95 + *r = wc;
96 + return 1;
97 + }
98 + else if (wc >= 0x00a0 && wc < 0x00b0)
99 + c = cp1133_page00[wc-0x00a0];
100 + else if (wc >= 0x0e80 && wc < 0x0ee0)
101 + c = cp1133_page0e[wc-0x0e80];
102 + else if (wc == 0x20ad)
103 + c = 0xdf;
104 + if (c != 0) {
105 + *r = c;
106 + return 1;
107 + }
108 + return RET_ILUNI;
109 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1161
22 + */
23 +
24 +static const unsigned short cp1161_2uni[96] = {
25 + /* 0xa0 */
26 + 0x0e48, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
27 + 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
28 + /* 0xb0 */
29 + 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
30 + 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
31 + /* 0xc0 */
32 + 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
33 + 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
34 + /* 0xd0 */
35 + 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
36 + 0x0e38, 0x0e39, 0x0e3a, 0x0e49, 0x0e4a, 0x0e4b, 0x20ac, 0x0e3f,
37 + /* 0xe0 */
38 + 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
39 + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
40 + /* 0xf0 */
41 + 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
42 + 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x00a2, 0x00ac, 0x00a6, 0x00a0,
43 +};
44 +
45 +static int
46 +cp1161_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
47 +{
48 + unsigned char c = *s;
49 + if (c < 0x80) {
50 + *pwc = (ucs4_t) c;
51 + return 1;
52 + }
53 + else if (c < 0xa0) {
54 + }
55 + else {
56 + *pwc = (ucs4_t) cp1161_2uni[c-0xa0];
57 + return 1;
58 + }
59 + return RET_ILSEQ;
60 +}
61 +
62 +static const unsigned char cp1161_page00[16] = {
63 + 0xff, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfe, 0x00, /* 0xa0-0xa7 */
64 + 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
65 +};
66 +
67 +static int
68 +cp1161_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
69 +{
70 + unsigned char c = 0;
71 + if (wc < 0x0080) {
72 + *r = wc;
73 + return 1;
74 + }
75 + else if (wc >= 0x00a0 && wc < 0x00b0)
76 + c = cp1161_page00[wc-0x00a0];
77 + else if (wc >= 0x0e48 && wc < 0x0e4c)
78 + c = wc-0x0d60;
79 + else if (wc >= 0x0e00 && wc < 0x0e60)
80 + c = cp874_page0e[wc-0x0e00];
81 + else if (wc == 0x20ac)
82 + c = 0xde;
83 + if (c != 0) {
84 + *r = c;
85 + return 1;
86 + }
87 + return RET_ILUNI;
88 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1162
22 + */
23 +
24 +static int
25 +cp1162_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
26 +{
27 + unsigned char c = *s;
28 + if (c < 0x80) {
29 + *pwc = (ucs4_t) c;
30 + return 1;
31 + }
32 + else {
33 + unsigned short wc = cp874_2uni[c-0x80];
34 + if (wc != 0xfffd) {
35 + *pwc = (ucs4_t) wc;
36 + return 1;
37 + }
38 + if (c < 0xa0) {
39 + *pwc = (ucs4_t) c;
40 + return 1;
41 + }
42 + }
43 + return RET_ILSEQ;
44 +}
45 +
46 +static int
47 +cp1162_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
48 +{
49 + unsigned char c = 0;
50 + if (wc < 0x0080) {
51 + *r = wc;
52 + return 1;
53 + }
54 + else if (wc >= 0x0080 && wc < 0x00a0 && cp874_2uni[wc-0x0080] == 0xfffd)
55 + c = wc;
56 + else if (wc == 0x00a0)
57 + c = 0xa0;
58 + else if (wc >= 0x0e00 && wc < 0x0e60)
59 + c = cp874_page0e[wc-0x0e00];
60 + else if (wc >= 0x2010 && wc < 0x2028)
61 + c = cp874_page20[wc-0x2010];
62 + else if (wc == 0x20ac)
63 + c = 0x80;
64 + if (c != 0) {
65 + *r = c;
66 + return 1;
67 + }
68 + return RET_ILUNI;
69 +}
1 +/*
2 + * Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1163
22 + */
23 +
24 +static int
25 +cp1163_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
26 +{
27 + unsigned char c = *s;
28 + if (c < 0xa0)
29 + *pwc = (ucs4_t) c;
30 + else if (c == 0xa4)
31 + *pwc = 0x20ac;
32 + else
33 + *pwc = (ucs4_t) cp1129_2uni[c-0xa0];
34 + return 1;
35 +}
36 +
37 +static const unsigned char cp1163_page20[8] = {
38 + 0x00, 0x00, 0x00, 0xfe, 0xa4, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
39 +};
40 +
41 +static int
42 +cp1163_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
43 +{
44 + unsigned char c = 0;
45 + if (wc < 0x00a0 || (wc < 0x00a8 && wc != 0x00a4) || wc == 0x00d0) {
46 + *r = wc;
47 + return 1;
48 + }
49 + else if (wc >= 0x00a8 && wc < 0x01b8)
50 + c = cp1129_page00[wc-0x00a8];
51 + else if (wc >= 0x0300 && wc < 0x0328)
52 + c = cp1129_page03[wc-0x0300];
53 + else if (wc == 0x203e)
54 + c = 0xaf;
55 + else if (wc >= 0x20a8 && wc < 0x20b0)
56 + c = cp1163_page20[wc-0x20a8];
57 + if (c != 0) {
58 + *r = c;
59 + return 1;
60 + }
61 + return RET_ILUNI;
62 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1250
22 + */
23 +
24 +static const unsigned short cp1250_2uni[128] = {
25 + /* 0x80 */
26 + 0x20ac, 0xfffd, 0x201a, 0xfffd, 0x201e, 0x2026, 0x2020, 0x2021,
27 + 0xfffd, 0x2030, 0x0160, 0x2039, 0x015a, 0x0164, 0x017d, 0x0179,
28 + /* 0x90 */
29 + 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
30 + 0xfffd, 0x2122, 0x0161, 0x203a, 0x015b, 0x0165, 0x017e, 0x017a,
31 + /* 0xa0 */
32 + 0x00a0, 0x02c7, 0x02d8, 0x0141, 0x00a4, 0x0104, 0x00a6, 0x00a7,
33 + 0x00a8, 0x00a9, 0x015e, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x017b,
34 + /* 0xb0 */
35 + 0x00b0, 0x00b1, 0x02db, 0x0142, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
36 + 0x00b8, 0x0105, 0x015f, 0x00bb, 0x013d, 0x02dd, 0x013e, 0x017c,
37 + /* 0xc0 */
38 + 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7,
39 + 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e,
40 + /* 0xd0 */
41 + 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7,
42 + 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df,
43 + /* 0xe0 */
44 + 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7,
45 + 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f,
46 + /* 0xf0 */
47 + 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7,
48 + 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9,
49 +};
50 +
51 +static int
52 +cp1250_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
53 +{
54 + unsigned char c = *s;
55 + if (c < 0x80) {
56 + *pwc = (ucs4_t) c;
57 + return 1;
58 + }
59 + else {
60 + unsigned short wc = cp1250_2uni[c-0x80];
61 + if (wc != 0xfffd) {
62 + *pwc = (ucs4_t) wc;
63 + return 1;
64 + }
65 + }
66 + return RET_ILSEQ;
67 +}
68 +
69 +static const unsigned char cp1250_page00[224] = {
70 + 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */
71 + 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */
72 + 0xb0, 0xb1, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
73 + 0xb8, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
74 + 0x00, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */
75 + 0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */
76 + 0x00, 0x00, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
77 + 0x00, 0x00, 0xda, 0x00, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */
78 + 0x00, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */
79 + 0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */
80 + 0x00, 0x00, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */
81 + 0x00, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xf8-0xff */
82 + /* 0x0100 */
83 + 0x00, 0x00, 0xc3, 0xe3, 0xa5, 0xb9, 0xc6, 0xe6, /* 0x00-0x07 */
84 + 0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef, /* 0x08-0x0f */
85 + 0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
86 + 0xca, 0xea, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
87 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
89 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
90 + 0x00, 0xc5, 0xe5, 0x00, 0x00, 0xbc, 0xbe, 0x00, /* 0x38-0x3f */
91 + 0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2, /* 0x40-0x47 */
92 + 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
93 + 0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, /* 0x50-0x57 */
94 + 0xd8, 0xf8, 0x8c, 0x9c, 0x00, 0x00, 0xaa, 0xba, /* 0x58-0x5f */
95 + 0x8a, 0x9a, 0xde, 0xfe, 0x8d, 0x9d, 0x00, 0x00, /* 0x60-0x67 */
96 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9, /* 0x68-0x6f */
97 + 0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
98 + 0x00, 0x8f, 0x9f, 0xaf, 0xbf, 0x8e, 0x9e, 0x00, /* 0x78-0x7f */
99 +};
100 +static const unsigned char cp1250_page02[32] = {
101 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, /* 0xc0-0xc7 */
102 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
103 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
104 + 0xa2, 0xff, 0x00, 0xb2, 0x00, 0xbd, 0x00, 0x00, /* 0xd8-0xdf */
105 +};
106 +static const unsigned char cp1250_page20[48] = {
107 + 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */
108 + 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */
109 + 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
110 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
111 + 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
112 + 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
113 +};
114 +
115 +static int
116 +cp1250_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
117 +{
118 + unsigned char c = 0;
119 + if (wc < 0x0080) {
120 + *r = wc;
121 + return 1;
122 + }
123 + else if (wc >= 0x00a0 && wc < 0x0180)
124 + c = cp1250_page00[wc-0x00a0];
125 + else if (wc >= 0x02c0 && wc < 0x02e0)
126 + c = cp1250_page02[wc-0x02c0];
127 + else if (wc >= 0x2010 && wc < 0x2040)
128 + c = cp1250_page20[wc-0x2010];
129 + else if (wc == 0x20ac)
130 + c = 0x80;
131 + else if (wc == 0x2122)
132 + c = 0x99;
133 + if (c != 0) {
134 + *r = c;
135 + return 1;
136 + }
137 + return RET_ILUNI;
138 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1251
22 + */
23 +
24 +static const unsigned short cp1251_2uni[128] = {
25 + /* 0x80 */
26 + 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021,
27 + 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f,
28 + /* 0x90 */
29 + 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
30 + 0xfffd, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f,
31 + /* 0xa0 */
32 + 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7,
33 + 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407,
34 + /* 0xb0 */
35 + 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7,
36 + 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457,
37 + /* 0xc0 */
38 + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
39 + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
40 + /* 0xd0 */
41 + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
42 + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
43 + /* 0xe0 */
44 + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
45 + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
46 + /* 0xf0 */
47 + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
48 + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
49 +};
50 +
51 +static int
52 +cp1251_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
53 +{
54 + unsigned char c = *s;
55 + if (c < 0x80) {
56 + *pwc = (ucs4_t) c;
57 + return 1;
58 + }
59 + else {
60 + unsigned short wc = cp1251_2uni[c-0x80];
61 + if (wc != 0xfffd) {
62 + *pwc = (ucs4_t) wc;
63 + return 1;
64 + }
65 + }
66 + return RET_ILSEQ;
67 +}
68 +
69 +static const unsigned char cp1251_page00[32] = {
70 + 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */
71 + 0x00, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */
72 + 0xb0, 0xb1, 0x00, 0x00, 0x00, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
73 + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
74 +};
75 +static const unsigned char cp1251_page04[152] = {
76 + 0x00, 0xa8, 0x80, 0x81, 0xaa, 0xbd, 0xb2, 0xaf, /* 0x00-0x07 */
77 + 0xa3, 0x8a, 0x8c, 0x8e, 0x8d, 0x00, 0xa1, 0x8f, /* 0x08-0x0f */
78 + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x10-0x17 */
79 + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x18-0x1f */
80 + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x20-0x27 */
81 + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x28-0x2f */
82 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x30-0x37 */
83 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x38-0x3f */
84 + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x40-0x47 */
85 + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0x48-0x4f */
86 + 0x00, 0xb8, 0x90, 0x83, 0xba, 0xbe, 0xb3, 0xbf, /* 0x50-0x57 */
87 + 0xbc, 0x9a, 0x9c, 0x9e, 0x9d, 0x00, 0xa2, 0x9f, /* 0x58-0x5f */
88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
89 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
90 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
91 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
92 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
93 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
94 + 0xa5, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
95 +};
96 +static const unsigned char cp1251_page20[48] = {
97 + 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */
98 + 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */
99 + 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
100 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
101 + 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
102 + 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
103 +};
104 +
105 +static int
106 +cp1251_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
107 +{
108 + unsigned char c = 0;
109 + if (wc < 0x0080) {
110 + *r = wc;
111 + return 1;
112 + }
113 + else if (wc >= 0x00a0 && wc < 0x00c0)
114 + c = cp1251_page00[wc-0x00a0];
115 + else if (wc >= 0x0400 && wc < 0x0498)
116 + c = cp1251_page04[wc-0x0400];
117 + else if (wc >= 0x2010 && wc < 0x2040)
118 + c = cp1251_page20[wc-0x2010];
119 + else if (wc == 0x20ac)
120 + c = 0x88;
121 + else if (wc == 0x2116)
122 + c = 0xb9;
123 + else if (wc == 0x2122)
124 + c = 0x99;
125 + if (c != 0) {
126 + *r = c;
127 + return 1;
128 + }
129 + return RET_ILUNI;
130 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1252
22 + */
23 +
24 +static const unsigned short cp1252_2uni[32] = {
25 + /* 0x80 */
26 + 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
27 + 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0xfffd, 0x017d, 0xfffd,
28 + /* 0x90 */
29 + 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
30 + 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0xfffd, 0x017e, 0x0178,
31 +};
32 +
33 +static int
34 +cp1252_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
35 +{
36 + unsigned char c = *s;
37 + if (c < 0x80 || c >= 0xa0) {
38 + *pwc = (ucs4_t) c;
39 + return 1;
40 + }
41 + else {
42 + unsigned short wc = cp1252_2uni[c-0x80];
43 + if (wc != 0xfffd) {
44 + *pwc = (ucs4_t) wc;
45 + return 1;
46 + }
47 + }
48 + return RET_ILSEQ;
49 +}
50 +
51 +static const unsigned char cp1252_page01[72] = {
52 + 0x00, 0x00, 0x8c, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
53 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
54 + 0x8a, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
55 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
56 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
57 + 0x9f, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x9e, 0x00, /* 0x78-0x7f */
58 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
59 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
60 + 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
61 +};
62 +static const unsigned char cp1252_page02[32] = {
63 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, /* 0xc0-0xc7 */
64 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
65 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
66 + 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
67 +};
68 +static const unsigned char cp1252_page20[48] = {
69 + 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */
70 + 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */
71 + 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
72 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
73 + 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
74 + 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
75 +};
76 +
77 +static int
78 +cp1252_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
79 +{
80 + unsigned char c = 0;
81 + if (wc < 0x0080) {
82 + *r = wc;
83 + return 1;
84 + }
85 + else if (wc >= 0x00a0 && wc < 0x0100)
86 + c = wc;
87 + else if (wc >= 0x0150 && wc < 0x0198)
88 + c = cp1252_page01[wc-0x0150];
89 + else if (wc >= 0x02c0 && wc < 0x02e0)
90 + c = cp1252_page02[wc-0x02c0];
91 + else if (wc >= 0x2010 && wc < 0x2040)
92 + c = cp1252_page20[wc-0x2010];
93 + else if (wc == 0x20ac)
94 + c = 0x80;
95 + else if (wc == 0x2122)
96 + c = 0x99;
97 + if (c != 0) {
98 + *r = c;
99 + return 1;
100 + }
101 + return RET_ILUNI;
102 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1253
22 + */
23 +
24 +static const unsigned short cp1253_2uni[128] = {
25 + /* 0x80 */
26 + 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
27 + 0xfffd, 0x2030, 0xfffd, 0x2039, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
28 + /* 0x90 */
29 + 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
30 + 0xfffd, 0x2122, 0xfffd, 0x203a, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
31 + /* 0xa0 */
32 + 0x00a0, 0x0385, 0x0386, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
33 + 0x00a8, 0x00a9, 0xfffd, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x2015,
34 + /* 0xb0 */
35 + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x00b5, 0x00b6, 0x00b7,
36 + 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f,
37 + /* 0xc0 */
38 + 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
39 + 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
40 + /* 0xd0 */
41 + 0x03a0, 0x03a1, 0xfffd, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
42 + 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af,
43 + /* 0xe0 */
44 + 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
45 + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
46 + /* 0xf0 */
47 + 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
48 + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0xfffd,
49 +};
50 +
51 +static int
52 +cp1253_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
53 +{
54 + unsigned char c = *s;
55 + if (c < 0x80) {
56 + *pwc = (ucs4_t) c;
57 + return 1;
58 + }
59 + else {
60 + unsigned short wc = cp1253_2uni[c-0x80];
61 + if (wc != 0xfffd) {
62 + *pwc = (ucs4_t) wc;
63 + return 1;
64 + }
65 + }
66 + return RET_ILSEQ;
67 +}
68 +
69 +static const unsigned char cp1253_page00[32] = {
70 + 0xa0, 0x00, 0x00, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
71 + 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */
72 + 0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
73 + 0x00, 0x00, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
74 +};
75 +static const unsigned char cp1253_page03[80] = {
76 + 0x00, 0x00, 0x00, 0x00, 0xb4, 0xa1, 0xa2, 0x00, /* 0x80-0x87 */
77 + 0xb8, 0xb9, 0xba, 0x00, 0xbc, 0x00, 0xbe, 0xbf, /* 0x88-0x8f */
78 + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x90-0x97 */
79 + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x98-0x9f */
80 + 0xd0, 0xd1, 0x00, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xa0-0xa7 */
81 + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xa8-0xaf */
82 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xb0-0xb7 */
83 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xb8-0xbf */
84 + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xc0-0xc7 */
85 + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, /* 0xc8-0xcf */
86 +};
87 +static const unsigned char cp1253_page20[48] = {
88 + 0x00, 0x00, 0x00, 0x96, 0x97, 0xaf, 0x00, 0x00, /* 0x10-0x17 */
89 + 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */
90 + 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
91 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
92 + 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
93 + 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
94 +};
95 +
96 +static int
97 +cp1253_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
98 +{
99 + unsigned char c = 0;
100 + if (wc < 0x0080) {
101 + *r = wc;
102 + return 1;
103 + }
104 + else if (wc >= 0x00a0 && wc < 0x00c0)
105 + c = cp1253_page00[wc-0x00a0];
106 + else if (wc == 0x0192)
107 + c = 0x83;
108 + else if (wc >= 0x0380 && wc < 0x03d0)
109 + c = cp1253_page03[wc-0x0380];
110 + else if (wc >= 0x2010 && wc < 0x2040)
111 + c = cp1253_page20[wc-0x2010];
112 + else if (wc == 0x20ac)
113 + c = 0x80;
114 + else if (wc == 0x2122)
115 + c = 0x99;
116 + if (c != 0) {
117 + *r = c;
118 + return 1;
119 + }
120 + return RET_ILUNI;
121 +}
1 +/*
2 + * Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
3 + * This file is part of the GNU LIBICONV Library.
4 + *
5 + * The GNU LIBICONV Library is free software; you can redistribute it
6 + * and/or modify it under the terms of the GNU Library General Public
7 + * License as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * The GNU LIBICONV Library is distributed in the hope that it will be
11 + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 + * Library General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU Library General Public
16 + * License along with the GNU LIBICONV Library; see the file COPYING.LIB.
17 + * If not, see <http://www.gnu.org/licenses/>.
18 + */
19 +
20 +/*
21 + * CP1254
22 + */
23 +
24 +static const unsigned short cp1254_2uni_1[32] = {
25 + /* 0x80 */
26 + 0x20ac, 0xfffd, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
27 + 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0xfffd, 0xfffd, 0xfffd,
28 + /* 0x90 */
29 + 0xfffd, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
30 + 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0xfffd, 0xfffd, 0x0178,
31 +};
32 +static const unsigned short cp1254_2uni_2[16] = {
33 + /* 0xd0 */
34 + 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
35 + 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df,
36 +};
37 +static const unsigned short cp1254_2uni_3[16] = {
38 + /* 0xf0 */
39 + 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
40 + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff,
41 +};
42 +
43 +static int
44 +cp1254_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
45 +{
46 + unsigned char c = *s;
47 + if (c < 0x80) {
48 + *pwc = (ucs4_t) c;
49 + return 1;
50 + }
51 + else if (c < 0xa0) {
52 + unsigned short wc = cp1254_2uni_1[c-0x80];
53 + if (wc != 0xfffd) {
54 + *pwc = (ucs4_t) wc;
55 + return 1;
56 + }
57 + }
58 + else if (c < 0xd0) {
59 + *pwc = (ucs4_t) c;
60 + return 1;
61 + }
62 + else if (c < 0xe0) {
63 + *pwc = (ucs4_t) cp1254_2uni_2[c-0xd0];
64 + return 1;
65 + }
66 + else if (c < 0xf0) {
67 + *pwc = (ucs4_t) c;
68 + return 1;
69 + }
70 + else {
71 + *pwc = (ucs4_t) cp1254_2uni_3[c-0xf0];
72 + return 1;
73 + }
74 + return RET_ILSEQ;
75 +}
76 +
77 +static const unsigned char cp1254_page00[48] = {
78 + 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
79 + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
80 + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
81 + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
82 + 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
83 + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff, /* 0xf8-0xff */
84 +};
85 +static const unsigned char cp1254_page01[128] = {
86 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, /* 0x18-0x1f */
87 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
88 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
89 + 0xdd, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
90 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
91 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
92 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
93 + 0x00, 0x00, 0x8c, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
94 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, /* 0x58-0x5f */
95 + 0x8a, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
96 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
97 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
98 + 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
99 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
100 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
101 + 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
102 +};
103 +static const unsigned char cp1254_page02[32] = {
104 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, /* 0xc0-0xc7 */
105 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
106 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
107 + 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
108 +};
109 +static const unsigned char cp1254_page20[48] = {
110 + 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */
111 + 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x18-0x1f */
112 + 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
113 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
114 + 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
115 + 0x00, 0x8b, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
116 +};
117 +
118 +static int
119 +cp1254_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
120 +{
121 + unsigned char c = 0;
122 + if (wc < 0x0080) {
123 + *r = wc;
124 + return 1;
125 + }
126 + else if (wc >= 0x00a0 && wc < 0x00d0)
127 + c = wc;
128 + else if (wc >= 0x00d0 && wc < 0x0100)
129 + c = cp1254_page00[wc-0x00d0];
130 + else if (wc >= 0x0118 && wc < 0x0198)
131 + c = cp1254_page01[wc-0x0118];
132 + else if (wc >= 0x02c0 && wc < 0x02e0)
133 + c = cp1254_page02[wc-0x02c0];
134 + else if (wc >= 0x2010 && wc < 0x2040)
135 + c = cp1254_page20[wc-0x2010];
136 + else if (wc == 0x20ac)
137 + c = 0x80;
138 + else if (wc == 0x2122)
139 + c = 0x99;
140 + if (c != 0) {
141 + *r = c;
142 + return 1;
143 + }
144 + return RET_ILUNI;
145 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.