#! /bin/sh -f

if make UnicodeData.txt
then	true
else	echo Could not acquire Unicode data file UnicodeData.txt
	exit 1
fi


# scan UnicodeData.txt:
#	0153;LATIN SMALL LIGATURE OE;...
#	0000;<control>;Cc;0;BN;;;;;N;NULL;...
# generate lines:
#	{0x0153, "LATIN SMALL LIGATURE OE"},
#	{0x0000, "NULL"},

sed	-e 's/^\([^;]*\);<control>;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;\([^;]*\);.*/	{0x\1, "\2"},/' \
	-e t \
	-e '/^[^;]*;</ d' \
	-e 's/^\([^;]*\);\([^;]*\);.*/	{0x\1, "\2"},/' \
	-e t \
	UnicodeData.txt > charname.t

