3 echo Generating Unicode width data
for newlib
/libc
/string
/wcwidth.c
6 PATH
="$PATH":.
# ensure access to uniset tool
8 #############################################################################
9 # checks and (with option -u) downloads
12 -h) echo "Usage: $0 [-h|-u|-i]"
13 echo "Generate width data tables ambiguous.t, combining.t, wide.t"
14 echo "from local Unicode files UnicodeData.txt, Blocks.txt, EastAsianWidth.txt."
17 echo " -u download files from unicode.org first, download uniset tool"
18 echo " -i copy files from /usr/share/unicode/ucd first"
25 ref
=`ls "$ref" 2> /dev/null || echo 01-Jan-1970`
26 curl
-R -O --connect-timeout 55 -z "$ref" "$1"
29 echo downloading uniset tool
30 wget https
://www.cl.cam.ac.uk
/~mgk25
/download
/uniset.
tar.gz
31 gzip -dc uniset.
tar.gz |
tar xvf
- uniset
33 echo downloading data from unicode.org
34 for data
in UnicodeData.txt Blocks.txt EastAsianWidth.txt
35 do wget http
://unicode.org
/Public
/UNIDATA
/$data
39 echo copying data from
/usr
/share
/unicode
/ucd
40 for data
in UnicodeData.txt Blocks.txt EastAsianWidth.txt
41 do cp /usr
/share
/unicode
/ucd
/$data .
46 echo checking uniset tool
49 echo checking Unicode data files
50 for data
in UnicodeData.txt Blocks.txt EastAsianWidth.txt
53 else echo $data not available
, skipping table generation
58 echo generating from Unicode version
`sed -e 's,[^.0-9],,g' -e 1q Blocks.txt`
60 #############################################################################
63 echo generating combining characters table
64 uniset
+cat=Me
+cat=Mn
+cat=Cf
-00AD +1160-11FF +200B
+D7B0-D7C6
+D7CB-D7FB c
> combining.t
66 echo generating ambiguous width characters table
67 sh .
/mkwidthA
&& uniset
+WIDTH-A
-cat=Me
-cat=Mn
-cat=Cf c
> ambiguous.t
69 echo generating wide characters table
72 #############################################################################