File: map8_txt2bin

package info (click to toggle)
libunicode-map8-perl-dfsg 0.12-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 904 kB
  • ctags: 59
  • sloc: perl: 495; ansic: 439; makefile: 45; sh: 6
file content (12 lines) | stat: -rwxr-xr-x 384 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl -w

# This script converts a textual mapping file to a binary one.
# One reason that we do this is that we are not allowed to
# re-distribute the mapping provided by Unicode, Inc directly.

binmode(STDOUT);
print pack("nn", 0xFFFE, 0x0001);  # magic
while (<>) {
    next unless /^\s*0x([0-9A-Fa-f]{2})\s+0x([0-9A-Fa-f]{4})/;
    print pack("nn", hex($1), hex($2));
}