]> git.saurik.com Git - wxWidgets.git/blame - misc/unictabl/mk_encodings.sh
add wx/generic/private/*.h files
[wxWidgets.git] / misc / unictabl / mk_encodings.sh
CommitLineData
045c4fab
VS
1#!/bin/sh
2# CVS-ID: $Id$
3
4
5echo " * compiling C source generator..."
6
7cc mk_ctable.c -o mk_ctable
8
9echo " * writing copyright info..."
10
11echo "
12
13/*
c260cbf8 14 * This file is #included by encconv.cpp
045c4fab 15 *
c260cbf8 16 * CVS-ID: \$Id\$
045c4fab 17 *
c260cbf8
MR
18 * *** *** CAUTION! *** ***
19 * Do not modify this file by hand! It is generated by shell
20 * script \$(WXWIN)/misc/unictabl/regenerate
045c4fab 21 *
c260cbf8
MR
22 * Parts of this file are based on tables published by Unicode, Inc.
23 * Original tables are freely available at
24 * ftp://ftp.unicode.org/Public/MAPPINGS
045c4fab 25 *
c260cbf8 26 * Original copyright info as present in mapping tables follows:
045c4fab
VS
27 *
28 *
c260cbf8 29 * Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved.
045c4fab 30 *
c260cbf8
MR
31 * This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
32 * No claims are made as to fitness for any particular purpose. No
33 * warranties of any kind are expressed or implied. The recipient
34 * agrees to determine applicability of information provided. If this
35 * file has been provided on optical media by Unicode, Inc., the sole
36 * remedy for any claim will be exchange of defective media within 90
37 * days of receipt.
045c4fab 38 *
c260cbf8
MR
39 * Unicode, Inc. hereby grants the right to freely use the information
40 * supplied in this file in the creation of products supporting the
41 * Unicode Standard, and to make copies of this file in any form for
42 * internal or external distribution as long as this notice remains
43 * attached.
045c4fab
VS
44 */
45
46" > unictabl.inc
47
48
49echo " * creating C tables..."
50
51all_encodings=""
52
53for i in mappings/*.TXT ; do
54
55 enc=`echo $i | cut -c10- | tr - _ | sed 's/\.TXT//g' |\
56sed 's/8859_\(.*\)/ISO8859_\1/g
57s/KOI8_R/KOI8/g'`
58 cat $i | sed -n '/^0x...0x..../p' | cut -f1,2 | \
59 ./mk_ctable $i $enc >> unictabl.inc
60 all_encodings="$all_encodings $enc"
61
62done
63
64rm -f mk_ctable
65
66
67echo " * adding fallback..."
68
69echo "
70
71
72
73
74/*
75 *
76 * Unicode to 7bit ASCII fallback
77 * (for use with wxRECODE_SUBSTITUTE recoding mode)
78 *
79 */
80
39a31a2d 81static const struct {
045c4fab
VS
82 wxUint16 c /*code*/;
83 wxUint8 s /*inaccurate substitution*/;
84} encoding_unicode_fallback[] = {
85" >> unictabl.inc
86
87cat Fallbacks | while read i ; do
88 code=`echo "$i" | cut -f1`
89 subs=`echo "$i" | cut -f2 | cut -c1-2,5-6`
90 echo " {$code, $subs}," >> unictabl.inc
91done
92echo " {0, 0}" >> unictabl.inc
93echo " };" >> unictabl.inc
94echo "
39a31a2d 95static const unsigned encoding_unicode_fallback_count = "`cat Fallbacks | wc -l`";" >> unictabl.inc
045c4fab
VS
96
97
98echo " * adding reference table..."
99
100
101echo "
102
103
104
105/*
106 *
107 * Table of all supported encodings:
108 *
109 */
110
39a31a2d 111static const struct {
045c4fab 112 wxFontEncoding encoding; // encoding identifier
cd1a22d1 113 const wxUint16 *table; // 8bit to unicode table
045c4fab
VS
114} encodings_list[] = {
115" >> unictabl.inc
116
117for i in $all_encodings ; do
118 echo " { wxFONTENCODING_$i, encoding_table__$i}," >> unictabl.inc
119done
120
121echo " {wxFONTENCODING_MAX /*anything*/, NULL}" >> unictabl.inc
122echo " };" >> unictabl.inc