1 /* Mapping table for CP874.
2 Copyright (C) 1998 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Table to map to UCS4. It can be generated using
22 (I know, this is a useless use of cat, but the linebreak requires it):
24 cat .../unix/mappings/vendors/micsft/pc/cp874.txt |
25 sed -e 's/\(0x..\)[[:space:]]*\(0x....\).*$/ [\1] = \2,/p' -e d
28 static const uint32_t to_ucs4
[256] =
257 /* Index table for mapping from UCS4. The table can be generated with
259 cat .../unix/mappings/vendors/micsft/pc/cp874.txt |
260 awk '/^0x/ { if (NF > 2) print $2; }' | perl gap.pl
262 where gap.pl is the file in this directory.
264 static struct gap from_idx
[] =
266 { start
: 0x0000, end
: 0x007f, idx
: 0 },
267 { start
: 0x00a0, end
: 0x00a0, idx
: -32 },
268 { start
: 0x0e01, end
: 0x0e5b, idx
: -3456 },
269 { start
: 0x2013, end
: 0x2026, idx
: -7991 },
270 { start
: 0xffff, end
: 0xffff, idx
: 0 }
273 /* Table accessed through above index table. It can be generated using:
275 cat .../unix/mappings/vendors/micsft/pc/cp874.txt |
276 awk '/^0x/ { if (NF > 2) print $2, $1; }' | perl gaptab.pl
278 where gaptab.pl is the file in this directory.
280 static const char from_ucs4
[] =
282 '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
283 '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
284 '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
285 '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
286 '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27',
287 '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f',
288 '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37',
289 '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f',
290 '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47',
291 '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f',
292 '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57',
293 '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f',
294 '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67',
295 '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f',
296 '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77',
297 '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f',
298 '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7',
299 '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf',
300 '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7',
301 '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf',
302 '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
303 '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf',
304 '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
305 '\xd8', '\xd9', '\xda', '\x00', '\x00', '\x00', '\x00', '\xdf',
306 '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7',
307 '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef',
308 '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7',
309 '\xf8', '\xf9', '\xfa', '\xfb', '\x96', '\x97', '\x00', '\x00',
310 '\x00', '\x91', '\x92', '\x00', '\x00', '\x93', '\x94', '\x00',
311 '\x00', '\x00', '\x00', '\x95', '\x00', '\x00', '\x00', '\x85',