xref: /aosp_15_r20/external/cronet/third_party/icu/scripts/ibm866_gen.sh (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1#!/bin/sh
2# Copyright 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# Reference:
7#   http://encoding.spec.whatwg.org/#single-byte-decoder
8
9# Download the following file, run it in source/data/mappings directory
10# and save the result to ibm-866_html5-2012.ucm
11#   http://encoding.spec.whatwg.org/index-ibm866.txt )
12
13cat <<PREAMBLE
14# ***************************************************************************
15# *
16# *   Generated from index-ibm866.txt (
17# *   http://encoding.spec.whatwg.org/index-ibm866.txt )
18# *   following the algorithm for the single byte legacy encoding
19# *   described at http://encoding.spec.whatwg.org/#single-byte-decoder
20# *
21# ***************************************************************************
22<code_set_name>               "ibm-866_html5-2012"
23<char_name_mask>              "AXXXX"
24<mb_cur_max>                  1
25<mb_cur_min>                  1
26<uconv_class>                 "SBCS"
27<subchar>                     \x7F
28<icu:charsetFamily>           "ASCII"
29
30CHARMAP
31PREAMBLE
32
33
34
35
36awk 'BEGIN { for (i=0; i < 0x80; ++i) { printf("<U%04X> \\x%02X |0\n", i, i);}}
37!/^#/ && !/^$/ { printf ("<U%4s> \\x%02X |0\n", substr($2, 3), $1 + 0x80);}' \
38index-ibm866.txt | sort
39echo 'END CHARMAP'
40
41