root/lang/perl/HTTP-MobileAgent-Plugin-Charset/trunk/t/02_encoding.t @ 4175

Revision 4175, 0.6 kB (checked in by tokuhirom, 7 years ago)

H::MA::P::Charset: support docomo and nonmobile :)

Line 
1use strict;
2use warnings;
3use Test::Base;
4use HTTP::MobileAgent;
5use HTTP::MobileAgent::Plugin::Charset;
6
7plan tests => 1*blocks;
8
9filters {
10    input => [qw/encoding/],
11};
12
13run_is input => 'expected';
14
15sub encoding {
16    my $ua = shift;
17
18    local $ENV{HTTP_USER_AGENT} = $ua;
19    my $agent = HTTP::MobileAgent->new;
20    $agent->encoding;
21}
22
23__END__
24
25===
26--- input: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.8) Gecko/20071019 Firefox/2.0.0.8
27--- expected: utf8
28
29=== docomo foma
30--- input: DoCoMo/2.0 N905iBiz(c100;TJ)
31--- expected: x-utf8-docomo
32
33=== docomo mova
34--- input: DoCoMo/1.0/D501i
35--- expected: x-sjis-docomo
36
Note: See TracBrowser for help on using the browser.