Skip to content

Instantly share code, notes, and snippets.

@brianmed
Created October 4, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianmed/87859d8e5f6965670415 to your computer and use it in GitHub Desktop.
Save brianmed/87859d8e5f6965670415 to your computer and use it in GitHub Desktop.
my %ENTITIES;
my $ent = PerlApp::get_bound_file("entities.txt") || slurp(catfile(dirname(__FILE__), "entities.txt"));
for my $line (split "\x0a", $ent) {
next unless $line =~ /^(\S+)\s+U\+(\S+)(?:\s+U\+(\S+))?/;
$ENTITIES{$1} = defined $3 ? (chr(hex $2) . chr(hex $3)) : chr(hex $2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment