File Coverage

blib/lib/Encode/JP/Mobile/MIME/SoftBank.pm
Criterion Covered Total %
statement 22 24 91.6
branch 1 4 25.0
condition 1 3 33.3
subroutine 9 10 90.0
pod 0 1 0.0
total 33 42 78.5


line stmt bran cond sub pod time code
1             package Encode::JP::Mobile::MIME::SoftBank;
2 24     24   134 use strict;
  24         57  
  24         5255  
3             Encode::Alias::define_alias('MIME-Header-JP-Mobile-SoftBank' => 'MIME-Header-JP-Mobile-SoftBank-UTF8');
4             Encode::Alias::define_alias('MIME-Header-JP-Mobile-Vodafone' => 'MIME-Header-JP-Mobile-SoftBank-UTF8');
5              
6             sub charset_to_encoding {
7 1     1 0 3 my ($self, $charset) = @_;
8            
9 1 50 33     12 if (!$charset || $charset =~ /utf-8/i) {
    0          
10 1         2 $charset = 'x-utf8-softbank';
11             }
12             elsif ($charset =~ /shift_jis/i) {
13 0         0 $charset = 'x-sjis-softbank';
14             }
15            
16 1         5 Encode::find_encoding($charset);
17             }
18              
19              
20             package Encode::JP::Mobile::MIME::SoftBank::UTF8;
21 24     24   151 use strict;
  24         42  
  24         703  
22 24     24   123 use base 'Encode::JP::Mobile::MIME';
  24         41  
  24         4110  
23             __PACKAGE__->Define('MIME-Header-JP-Mobile-SoftBank-UTF8');
24              
25             Encode::Alias::define_alias('MIME-Header-JP-Mobile-Vodafone-UTF8' => 'MIME-Header-JP-Mobile-SoftBank-UTF8');
26              
27             sub subject_encoding {
28 1     1   4 Encode::find_encoding('x-utf8-softbank');
29             }
30              
31             sub charset_to_encoding {
32 1     1   6 Encode::JP::Mobile::MIME::SoftBank::charset_to_encoding(@_);
33             }
34              
35              
36             package Encode::JP::Mobile::MIME::SoftBank::SJIS;
37 24     24   141 use strict;
  24         44  
  24         748  
38 24     24   129 use base 'Encode::JP::Mobile::MIME';
  24         43  
  24         3868  
39             __PACKAGE__->Define('MIME-Header-JP-Mobile-SoftBank-SJIS');
40              
41             Encode::Alias::define_alias('MIME-Header-JP-Mobile-Vodafone-SJIS' => 'MIME-Header-JP-Mobile-SoftBank-SJIS');
42              
43             sub subject_encoding {
44 1     1   6 Encode::find_encoding('x-sjis-softbank');
45             }
46              
47             sub charset_to_encoding {
48 0     0     Encode::JP::Mobile::MIME::SoftBank::charset_to_encoding(@_);
49             }
50              
51             1;