Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid use of an undocumented charnames API

  • Loading branch information...
commit 5cff6883de743a5ec0f736ab23e73e3465452cd0 1 parent a755b3f
miyagawa authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/Encode/JP/Mobile/Charnames.pm
11 lib/Encode/JP/Mobile/Charnames.pm
View
@@ -1,7 +1,6 @@
package Encode::JP::Mobile::Charnames;
use strict;
use warnings;
-use charnames ();
use bytes ();
use File::ShareDir 'dist_file';
use Carp;
@@ -14,6 +13,12 @@ our @EXPORT_OK = qw( unicode2name unicode2name_en vianame );
my $name2unicode;
+{
+ use charnames ':full';
+ BEGIN { *_def_translator = $^H{charnames} }
+}
+
+
sub import {
# for perl < 5.10
if ($charnames::hint_bits) {
@@ -67,14 +72,14 @@ sub _unicode_translator {
}
}
else {
- return charnames::charnames($name);
+ return _def_translator($name);
}
}
# pictograms are only in the above 0xFF area.
sub _bytes_translator {
my $name = shift;
- return charnames::charnames($name);
+ return _def_translator($name);
}
sub vianame {
Please sign in to comment.
Something went wrong with that request. Please try again.