#!/usr/local/bin/perl use vars qw($opt_7 $opt_8 $opt_L); use Getopt::Std; @range = ( # [ 0, 127, 'Controls and Basic Latin' ], [ 128, 255, 'Controls and Latin-1 Supplement' ], [ 0x100, 0x17F, 'Latin Extended-A' ], [ 0x180, 0x24F, 'Latin Extended-B' ], [ 0x250, 0x2AF, 'IPA Extensions' ], [ 0x2B0, 0x2FF, 'Spacing Modifier Letters' ], [ 0x2000, 0x206F, 'General Punctuation' ], [ 0x20A0, 0x20CF, 'Currency Symbols' ], [ 0x2100, 0x214F, 'Letterlike Symbols' ], [ 0x2150, 0x218F, 'Number Forms' ], [ 0xFB00, 0xFB4F, 'Alphabetic Presentation Forms' ], ); $progname = $0; $progname =~ s!.*/!!; getopts('78L'); $enc = '-7' if ($opt_7); $enc = '-8' if ($opt_8); if ($enc eq '') { die <<"EOT"; Usage: $progname -7|-8 [-L] -7 : Use UTF-7 encoding -8 : Use UTF-8 encoding -L : Generate LaTeX file EOT } if ($opt_L) { $format = "\\noindent U+%04X: %s\n"; } else { $format = "U+%04X: %s"; } $format =~ s/\+/+-/ if ($opt_7); if ($opt_L) { print <<'EOT'; \documentclass[a4paper,12pt,twocolumn]{article} \usepackage{textcomp} \usepackage{eurofont} \usepackage[T1,tone,safe]{tipa} \begin{document} EOT } for $ref (@range) { $from = $ref->[0]; $to = $ref->[1]; $txt = $ref->[2]; $txt =~ s/\+/+-/g if ($opt_7); print ($opt_L ? "\\subsubsection*{$txt}\n\n" : "$txt\n\n"); for ($i = $from; $i <= $to; $i++) { $utf = `utfcode $enc 120 $i 120`; printf ($format, $i, $utf); } print "\n" unless ($opt_L); } print "\\end{document}\n" if ($opt_L);