Debian Codegraph @

Unicode/gen-upc

raw symbols SCIP
1 #!/bin/sh
2 set -e
3 LC_ALL=C
4 export LC_ALL
5 echo
6 echo Generating Unicode upcase table.
7 for file in upcase locase; do
8 (
9 echo '/* Automatically generated by gen-upc */'
10 echo
11 echo "static_const struct { unsigned short o; unsigned short n; } unicode_$file [] = {"
12 (
13 if [ $file = upcase ]; then
14 echo '00A0 0020'
15 fi
16 cat $file.uni
17 ) | sed 's/^\([0-9A-Z]*\) \([0-9A-Z]*\)$/ { 0x\1, 0x\2 },/' | sort
18 echo '};'
19 ) > ../$file.inc
20 done
21 echo Done.
22 echo