1#!/usr/bin/perl -w
2
3# This script converts a textual mapping file to a binary one.
4# One reason that we do this is that we are not allowed to
5# re-distribute the mapping provided by Unicode, Inc directly.
6
7binmode(STDOUT);
8print pack("nn", 0xFFFE, 0x0001);  # magic
9while (<>) {
10    next unless /^\s*0x([0-9A-Fa-f]{2})\s+0x([0-9A-Fa-f]{4})/;
11    print pack("nn", hex($1), hex($2));
12}
13