my @nibble = (0..9, 'A'..'F');
my $nibsize = 1;
-use Encode qw(decode resolve_alias);
# generate character table(s)
# (~16x faster than decoding in loop;
# substr strings is twice as fast as splitting to an array)
@nibble = (map { $_.0, $_.8 } 0 .. 7);
$nibsize = 8;
}
- elsif ($row{set} = resolve_alias($input)) {
+ elsif ($row{set} = Encode::resolve_alias($input)) {
if ($row{set} eq 'Internal') {
$row{table} = ' ' x ($endpoint < 255 ? 640 : 8192);
$row{set} = 'Unicode BMP';
or printf "<p class=error>Table data could not be read: <em>%s</em>.</p>\n", $@ || $!;
}
else {
- $row{table} = decode($row{set}, pack 'C*', $row{offset} .. $endpoint);
+ $row{table} = Encode::decode($row{set}, pack 'C*', $row{offset} .. $endpoint);
}
}
else {
use File::stat 'stat';
use HTTP::Date;
+use Encode qw( decode_utf8 );
$PLP::ERROR = sub {
my ($text, $html) = @_;
# user request
our $Dev = $ENV{HTTP_HOST} =~ /\bdev\./;
our ($file) = $ENV{SCRIPT_FILENAME} =~ m{ ([^/]+) \.plp$ }x;
-our $Request = $ENV{PATH_INFO} =~ s{^/}{}r;
+our $Request = decode_utf8($ENV{PATH_INFO} =~ s{^/}{}r);
our $style;
our $showkeys = !exists $get{keys} ? undef :
}
-r $source or die "Requested file not found\n";
- require Encode;
if (eval { require Text::VimColor and Text::VimColor->VERSION(0.12) }) {
delete $Text::VimColor::SYNTAX_TYPE{Underlined};
my %TYPETAG = (
say '<pre>';
foreach (@$parsed) {
my ($type, $contents) = @{$_};
- $contents = Encode::decode_utf8($contents);
+ $contents = decode_utf8($contents);
my $tag = $type && ($TYPETAG{$type} || 'span');
my $arg = '';
print "<$tag$arg class=\"sy-\l$type\">" if $tag;
}
else {
say '<pre>';
- print EscapeHTML(Encode::decode_utf8(ReadFile($source)));
+ print EscapeHTML(decode_utf8(ReadFile($source)));
say '</pre>';
}