Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: scripts/single_byte_gen.sh

Issue 598383002: Make all the single byte encodings compliant to the encoding spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/icu52/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
OLDNEW
(Empty)
1 #!/bin/bash
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 function preamble {
7
8 encoding="$1"
9 cat <<PREAMBLE
10 # ***************************************************************************
11 # *
12 # * Generated from index-$encoding.txt (
13 # * https://encoding.spec.whatwg.org/index-${encoding}.txt )
14 # * following the algorithm for the single byte legacy encoding
15 # * described at http://encoding.spec.whatwg.org/#single-byte-decoder
16 # *
17 # ***************************************************************************
18 <code_set_name> "${encoding}-html"
19 <char_name_mask> "AXXXX"
20 <mb_cur_max> 1
21 <mb_cur_min> 1
22 <uconv_class> "SBCS"
23 <subchar> \x3F
24 <icu:charsetFamily> "ASCII"
25
26 CHARMAP
27 PREAMBLE
28
29 }
30
31 encodings="ibm866 iso-8859-2 iso-8859-3 iso-8859-4 iso-8859-5 iso-8859-6\
jsbell 2014/10/04 00:15:26 Consider including a note about iso-8859-8-i here
jungshik at Google 2014/10/04 09:32:40 Will do.
32 iso-8859-7 iso-8859-8 iso-8859-10 iso-8859-13 iso-8859-14\
33 iso-8859-15 iso-8859-16 koi8-r koi8-u macintosh\
34 windows-874 windows-1250 windows-1251 windows-1252 windows-1253\
35 windows-1254 windows-1255 windows-1256 windows-1257 windows-1258\
36 x-mac-cyrillic"
37
38 ENCODING_DIR="$(dirname $0)/../source/data/mappings"
39 for e in ${encodings}
40 do
41 output="${ENCODING_DIR}/${e}-html.ucm"
42 index="index-${e}.txt"
43 indexurl="https://encoding.spec.whatwg.org/index-${e}.txt"
44 curl -o ${index} "${indexurl}"
45 preamble ${e} > ${output}
46 awk 'BEGIN \
47 { \
48 for (i=0; i < 0x80; ++i) \
49 { \
50 printf("<U%04X> \\x%02X |0\n", i, i);} \
51 } \
52 !/^#/ && !/^$/ \
53 {
54 printf ("<U%4s> \\x%02X |0\n", substr($2, 3), $1 + 0x80); \
55 }' ${index} | sort >> ${output}
56 echo 'END CHARMAP' >> ${output}
57 rm ${index}
58 done
59
OLDNEW
« no previous file with comments | « android/icudtl.dat ('k') | source/data/in/icudtl.dat » ('j') | source/data/mappings/convrtrs.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698