Skip to content

Commit

Permalink
W32H cannot display &#xXXXX; f*cking..
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Jan 24, 2008
1 parent c61d7c8 commit f32595f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions lib/HTML/Entities/ConvertPictogramMobileJp.pm
Expand Up @@ -4,6 +4,7 @@ use warnings;
our $VERSION = '0.03';
use Encode;
use Encode::JP::Mobile;
use Encode::JP::Mobile::Character;
use Params::Validate;
use base 'Exporter';
our @EXPORT = qw/convert_pictogram_entities/;
Expand All @@ -21,8 +22,12 @@ sub convert_pictogram_entities {
if ($agent->is_softbank) {
_convert_unicode('softbank', $2)
} elsif ($agent->is_ezweb) {
join '', map { sprintf( '&#x%X;', unpack( 'U*', $_ ) ) } split //,
decode "x-sjis-kddi-cp932-raw", encode( "x-sjis-kddi-auto", chr( hex $2 ) );
join '', map {
sprintf '<img localsrc="%d" />',
Encode::JP::Mobile::Character->from_unicode( unpack 'U*', $_ )->number
}
split //, decode "x-sjis-kddi-auto-raw",
encode( "x-sjis-kddi-auto", chr( hex $2 ) );
} elsif ($agent->is_docomo && $agent->is_foma) {
_convert_unicode('docomo', $2)
} elsif (($agent->is_docomo && !$agent->is_foma) || $agent->is_airh_phone) {
Expand Down
4 changes: 2 additions & 2 deletions t/01_simple.t
Expand Up @@ -29,7 +29,7 @@ html: "&#xE63E;&#xE65C;"
--- input
user_agent: KDDI-SA31 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0
html: "&#xE63E;&#xE65C;"
--- expected: &#xE488;&#xE5BC;
--- expected: <img localsrc="44" /><img localsrc="341" />
=== i2i(foma)
--- input
Expand All @@ -53,7 +53,7 @@ html: "&#xE63E;&#xE65C;"
--- input
user_agent: KDDI-SA31 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0
html: "&#xE722;"
--- expected: &#xE471;&#xE5B1;
--- expected: <img localsrc="257" /><img localsrc="330" />
=== i2v, pair
--- input
Expand Down

0 comments on commit f32595f

Please sign in to comment.