#! /bin/bash

# download unihan.txt from ftp://ftp.unicode.org/Public/UNIDATA/Unihan.zip
wget ftp://ftp.unicode.org/Public/UNIDATA/Unihan.zip && \
unzip Unihan.zip || \
 ( \
   echo "cannot get Unihan.txt from ftp://ftp.unicode.org/Public/UNIDATA/Unihan.zip" 1>&2; \
   exit 1 \
 )

grep kMandarin Unihan.txt | cut -f1,3 > mapping.txt
