Show
Ignore:
Timestamp:
02/06/08 18:52:59 (5 years ago)
Author:
chiba
Message:

lang/perl/HTTP-MobileAgent?-Plugin-Charset
auはSSL(というかAccept-Charsetに*が含まれない場合)ではutf-8をサポートしないが
そうでない場合はutf-8をサポートしているのでAccept-Charsetで判別して
sjisかutf-8を決めるようにしました

Location:
lang/perl/HTTP-MobileAgent-Plugin-Charset/branches/au_ssl
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAgent-Plugin-Charset/branches/au_ssl/lib/HTTP/MobileAgent/Plugin/Charset.pm

    r6145 r6292  
    1717        return 'x-sjis-airh'; 
    1818    } elsif ($self->is_ezweb) { 
    19         # ezweb canot display utf8 in https. 
    20         return 'x-sjis-ezweb-auto'; 
     19        if ($self->xhtml_compliant && $self->get_header('Accept-Charset') =~ /\*/) { 
     20            return 'x-utf8-ezweb'; 
     21        } else { 
     22            # ezweb canot display utf8 in https. 
     23            return 'x-sjis-ezweb-auto'; 
     24        } 
    2125    } elsif ($self->is_vodafone) { 
    2226        if ($self->is_type_3gc) { 
  • lang/perl/HTTP-MobileAgent-Plugin-Charset/branches/au_ssl/t/01_can_display_utf8.t

    r5277 r6292  
    44use HTTP::MobileAgent; 
    55use HTTP::MobileAgent::Plugin::Charset; 
    6  
    76plan tests => 1*blocks; 
    87 
    98filters { 
    10     input => [qw/filt/], 
     9    input => [qw/trim lines chomp filt/], 
    1110    expected => [qw/yaml/], 
    1211}; 
     
    1514 
    1615sub filt { 
    17     my $ua = shift; 
     16    my ($ua, $accept_charset) = @_; 
    1817 
    19     local $ENV{HTTP_USER_AGENT} = $ua; 
     18    local $ENV{HTTP_USER_AGENT}     = $ua; 
     19    local $ENV{HTTP_ACCEPT_CHARSET} = $accept_charset if $accept_charset; 
    2020 
    2121    my $agent = HTTP::MobileAgent->new; 
     
    7070encoding: x-sjis-ezweb-auto 
    7171 
    72 === ez utf8 
    73 --- input: KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 
     72=== ez utf8 non-SSL 
     73--- input 
     74KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 
     75shift_jis,* 
     76--- expected 
     77can_display_utf8: utf8 
     78encoding: x-utf8-ezweb 
     79 
     80=== ez utf8 SSL 
     81--- input 
     82KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 
     83shift_jis 
    7484--- expected 
    7585can_display_utf8: no utf8