use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# vX.Y.Z: X YYYZZZ
-$VERSION = 1.000004;
+$VERSION = 1.000005;
@ISA = qw(Exporter);
@EXPORT = ();
@EXPORT_OK = (
sub html_entity_encode_dec {
- (my $t, my $encoding, my $all) = @_;
+ # (my $t, my $encoding, my $all) = @_;
+ (my $t, my $all) = @_;
if ($all) {
- $t =~ s/(.)/html_entity_encode_1ch_dec($1, $encoding)/eg;
+ # $t =~ s/(.)/html_entity_encode_1ch_dec($1, $encoding)/eg;
+ $t =~ s/(.)/html_entity_encode_1ch_dec($1)/eg;
}
else {
- $t =~ s/([\"\&<=>])/html_entity_encode_1ch_dec($1, $encoding)/eg;
+ # $t =~ s/([\"\&<=>])/html_entity_encode_1ch_dec($1, $encoding)/eg;
+ $t =~ s/([\"\&<=>])/html_entity_encode_1ch_dec($1)/eg;
}
return $t;
}
sub html_entity_encode_hex {
- (my $t, my $encoding, my $all) = @_;
+ # (my $t, my $encoding, my $all) = @_;
+ (my $t, my $all) = @_;
if ($all) {
- $t =~ s/(.)/html_entity_encode_1ch_hex($1, $encoding)/eg;
+ # $t =~ s/(.)/html_entity_encode_1ch_hex($1, $encoding)/eg;
+ $t =~ s/(.)/html_entity_encode_1ch_hex($1)/eg;
}
else {
- $t =~ s/([\"\&<=>])/html_entity_encode_1ch_hex($1, $encoding)/eg;
+ # $t =~ s/([\"\&<=>])/html_entity_encode_1ch_hex($1, $encoding)/eg;
+ $t =~ s/([\"\&<=>])/html_entity_encode_1ch_hex($1)/eg;
}
return $t;
}
sub html_entity_encode_1ch_dec {
- (my $ch, my $encoding) = @_;
+ # (my $ch, my $encoding) = @_;
+ (my $ch) = @_;
- if ($encoding ne '') {
- # escape byte values instead of code point value
- $ch = encode($encoding, $ch);
- }
+ # if ($encoding ne '') {
+ # # escape byte values instead of code point value
+ # $ch = encode($encoding, $ch);
+ # }
$ch =~ s/(.)/sprintf('&#%02u;',ord($1))/eg;
return $ch;
}
sub html_entity_encode_1ch_hex {
- (my $ch, my $encoding) = @_;
+ # (my $ch, my $encoding) = @_;
+ (my $ch) = @_;
- if ($encoding ne '') {
- # escape byte values instead of code point value
- $ch = encode($encoding, $ch);
- }
+ # if ($encoding ne '') {
+ # # escape byte values instead of code point value
+ # $ch = encode($encoding, $ch);
+ # }
$ch =~ s/(.)/sprintf('&#x%02X;',ord($1))/eg;
return $ch;
}