Convert/Cyrillic/Utils.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 46 CC 13 SCAR 40.8
CC
13
Cov
0%
cs2encoding
72.0
Platform2DefEncoding
42.0
CRAP 59.1
1 package Convert::Cyrillic::Utils;
2  
3 $VERSION = '1.01';
4  
5 sub cs2encoding {
6 my ($enc) = @_;
7 my ($charset);
8
9 $charset = "koi8-r" if $enc=~/koi/io;
10 $charset = "windows-1251" if $enc=~/win/io;
11 $charset = "x-mac-cyrillic" if $enc=~/mac/io;
12 $charset = "ibm866" if $enc=~/dos/io;
13 $charset = "ISO-8859-5" if $enc=~/iso/io;
14 $charset = "UTF-8" if $enc=~/utf8/io;
15  
16 $META = <<"EOF"
17 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=$charset">
18 EOF
19 if $charset;
20 }
21  
22 sub Platform2DefEncoding {
23 my ($platform) = @_;
24 $encoding = '';
25 $encoding = 'win' if $platform=~/WIN/io;
26 $encoding = 'mac' if $platform eq 'MAC';
27 $encoding = 'koi' if $platform eq 'UNIX';
28 $encoding = 'dos' if $platform eq 'OS2';
29 $encoding = 'nocs' if $platform eq 'Linux';
30 return $encoding;
31 }
32