| 1 | package Locale::Maketext::Lexicon::Getcontext; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use Locale::Maketext::Lexicon::Gettext; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | our $VERSION = "0.05"; | |||||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | my ( $InputEncoding, $OutputEncoding, $DoEncoding ); | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub input_encoding {$InputEncoding} | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
input_encoding: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub output_encoding {$OutputEncoding} | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
output_encoding: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # functions | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 3 | *parse_mo = \&Locale::Maketext::Lexicon::Gettext::parse_mo; | |||||||||||||||||||||||||||||||||||||||||||||
| 15 | 3 | *_unescape = \&Locale::Maketext::Lexicon::Gettext::_unescape; | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | 3 | *_gettext_to_maketext | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | = \&Locale::Maketext::Lexicon::Gettext::_gettext_to_maketext; | ||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 22 | # parse() | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # ----- | ||||||||||||||||||||||||||||||||||||||||||||||
| 24 | # copy-pasted from Locale::Maketext::Lexicon::Gettext, with s/msgid/msgctxt/g | ||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 8 | ▶ | sub parse { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse: called CC=17 SCAR=33.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 8 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 28 | 8 | my ( %var, $key, @ret ); | |||||||||||||||||||||||||||||||||||||||||||||
| 29 | 8 | my @metadata; | |||||||||||||||||||||||||||||||||||||||||||||
| 30 | 8 | my @comments; | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 8 | my @fuzzy; | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 8 | $InputEncoding = $OutputEncoding = $DoEncoding = undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 3 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 8 | ▶ | Carp::cluck "Undefined source called\n" unless defined $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | # Check for magic string of MO files | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 8 | ▶ | return parse_mo( join( '', @_ ) ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$_[0] =~ /^\x95\x04\x12\xde/ or $_[0] =~ /^\xde\x12\x04\x95/
MC/DC0%0/2
$_[0] =~ /^\x95\x04\x12\xde/ or $_[0] =~ /^\xde\x12\x04\x95/
$_[0] =~ /^\x95\x04\x12\xde/
$_[0] =~ /^\xde\x12\x04\x95/
Truth table33%1/3
A or B
A= $_[0] =~ /^\x95\x04\x12\xde/B= $_[0] =~ /^\xde\x12\x04\x95/
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | if ( $_[0] =~ /^\x95\x04\x12\xde/ or $_[0] =~ /^\xde\x12\x04\x95/ ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 8 | local $^W; # no 'uninitialized' warnings, please. | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 8 | require Locale::Maketext::Lexicon; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 8 | my $KeepFuzzy = Locale::Maketext::Lexicon::option('keep_fuzzy'); | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | 8 | ▶ | my $UseFuzzy = $KeepFuzzy | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$KeepFuzzy || Locale::Maketext::Lexicon::option('use_fuzzy')
MC/DC0%0/2
$KeepFuzzy || Locale::Maketext::Lexicon::option('use_fuzzy')
$KeepFuzzy
Locale::Maketext::Lexicon::option('use_fuzzy')
Truth table33%1/3
A || B
A= $KeepFuzzyB= Locale::Maketext::Lexicon::option('use_fuzzy')
| |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | || Locale::Maketext::Lexicon::option('use_fuzzy'); | ||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 8 | my $AllowEmpty = Locale::Maketext::Lexicon::option('allow_empty'); | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | 3470 | ▶ | my $process = sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=8 SCAR=26.6
| |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 3470 | ▶ | if ( length( $var{msgstr} ) and ( $UseFuzzy or !$var{fuzzy} ) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%2/6
length $var{"msgstr"} and $UseFuzzy || !$var{"fuzzy"}
$UseFuzzy or not $var{"fuzzy"}
MC/DC0%0/3
length $var{"msgstr"} and $UseFuzzy || !$var{"fuzzy"}
length $var{"msgstr"}
$UseFuzzy
not $var{"fuzzy"}
Truth table25%1/4
A and B or not(C)
A= length $var{"msgstr"}B= $UseFuzzyC= not $var{"fuzzy"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 3470 | push @ret, ( map transform($_), @var{ 'msgctxt', 'msgstr' } ); | |||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 53 | elsif ($AllowEmpty) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | push @ret, ( transform( $var{msgctxt} ), '' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 3470 | ▶ | if ( $var{msgctxt} eq '' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 8 | push @metadata, parse_metadata( $var{msgstr} ); | |||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 59 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 3462 | push @comments, $var{msgctxt}, $var{msgcomment}; | |||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 3470 | ▶ | if ( $KeepFuzzy && $var{fuzzy} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$KeepFuzzy and $var{"fuzzy"}
MC/DC0%0/2
$KeepFuzzy and $var{"fuzzy"}
$KeepFuzzy
$var{"fuzzy"}
Truth table33%1/3
A and B
A= $KeepFuzzyB= $var{"fuzzy"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | push @fuzzy, $var{msgctxt}, 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 3470 | %var = (); | |||||||||||||||||||||||||||||||||||||||||||||
| 66 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||
| 68 | # Parse PO files | ||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 8 | foreach (@_) { | |||||||||||||||||||||||||||||||||||||||||||||
| 70 | 15406 | s/[\015\012]*\z//; # fix CRLF issues | |||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||
| 72 | /^(msgctxt|msgid|msgstr) +"(.*)" *$/ | ||||||||||||||||||||||||||||||||||||||||||||||
| 73 | ? do { # leading strings | ||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 10402 | $var{$1} = $2; | |||||||||||||||||||||||||||||||||||||||||||||
| 75 | 10402 | ▶ | $key = $1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 77 | : | ||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | /^"(.*)" *$/ | ||||||||||||||||||||||||||||||||||||||||||||||
| 80 | ? do { # continued strings | ||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1534 | ▶ | $var{$key} .= $1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 83 | : | ||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||
| 85 | /^# (.*)$/ | ||||||||||||||||||||||||||||||||||||||||||||||
| 86 | ? do { # user comments | ||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | $var{msgcomment} .= $1 . "\n"; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 89 | : | ||||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||
| 91 | /^#, +(.*) *$/ | ||||||||||||||||||||||||||||||||||||||||||||||
| 92 | ? do { # control variables | ||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | $var{$_} = 1 for split( /,\s+/, $1 ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
/^ *$/ and %var
MC/DC0%0/2
/^ *$/ and %var
/^ *$/
%var
Truth table33%1/3
A and B
A= /^ *$/B= %var
| |||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 95 | : | ||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||
| 97 | /^ *$/ && %var | ||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 15406 | ▶ | ? do { # interpolate string escapes | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 3470 | $process->($_); | |||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 101 | : (); | ||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||
| 105 | # do not silently skip last entry | ||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 8 | ▶ | $process->() if keys %var != 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | push @ret, map { transform($_) } @var{ 'msgctxt', 'msgstr' } | |||||||||||||||||||||||||||||||||||||||||||||
| 109 | 8 | ▶ | if length $var{msgstr}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 110 | push @metadata, parse_metadata( $var{msgstr} ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 8 | ▶ | if $var{msgctxt} eq ''; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||
| 113 | return wantarray | ||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 8 | ▶ | ? ( { @metadata, @ret }, {@comments}, {@fuzzy} ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 115 | : ( { @metadata, @ret } ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 121 | # parse_metadata() | ||||||||||||||||||||||||||||||||||||||||||||||
| 122 | # -------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 123 | # copy-pasted from Locale::Maketext::Lexicon::Gettext, with no change, | ||||||||||||||||||||||||||||||||||||||||||||||
| 124 | # because it accesses the $InputEncoding and $OutputEncoding vars | ||||||||||||||||||||||||||||||||||||||||||||||
| 125 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 16 | ▶ | sub parse_metadata { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_metadata: called CC=12 SCAR=28.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 127 | return map { | ||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 16 | (/^([^\x00-\x1f\x80-\xff :=]+):\s*(.*)$/) | |||||||||||||||||||||||||||||||||||||||||||||
| 129 | ? ( $1 eq 'Content-Type' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 64 | ▶ | ? do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 8 | my $enc = $2; | |||||||||||||||||||||||||||||||||||||||||||||
| 132 | 8 | ▶ | if ( $enc =~ /\bcharset=\s*([-\w]+)/i ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 8 | ▶ | $InputEncoding = $1 || ''; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$1 || ''
MC/DC0%0/1
$1 || ''
$1
Truth table50%1/2
A
A= $1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 8 | ▶ | $OutputEncoding | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
Locale::Maketext::Lexicon::encoding() || ''
MC/DC0%0/1
Locale::Maketext::Lexicon::encoding() || ''
Locale::Maketext::Lexicon::encoding()
Truth table50%1/2
A
A= Locale::Maketext::Lexicon::encoding()
| |||||||||||||||||||||||||||||||||||||||||||||||
| 135 | = Locale::Maketext::Lexicon::encoding() | ||||||||||||||||||||||||||||||||||||||||||||||
| 136 | || ''; | ||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 8 | ▶ | $InputEncoding = 'utf8' | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 138 | if $InputEncoding =~ /^utf-?8$/i; | ||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 8 | ▶ | $OutputEncoding = 'utf8' | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 140 | if $OutputEncoding =~ /^utf-?8$/i; | ||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 8 | ▶ | if (Locale::Maketext::Lexicon::option('decode') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
Locale::Maketext::Lexicon::option("decode") and !$OutputEncoding || $InputEncoding ne $OutputEncoding
not $OutputEncoding or $InputEncoding ne $OutputEncoding
MC/DC0%0/3
Locale::Maketext::Lexicon::option("decode") and !$OutputEncoding || $InputEncoding ne $OutputEncoding
Locale::Maketext::Lexicon::option("decode")
not $OutputEncoding
$InputEncoding ne $OutputEncoding
Truth table25%1/4
A and not(B) or C
A= Locale::Maketext::Lexicon::option("decode")B= not $OutputEncodingC= $InputEncoding ne $OutputEncoding
| |||||||||||||||||||||||||||||||||||||||||||||||
| 142 | and ( !$OutputEncoding | ||||||||||||||||||||||||||||||||||||||||||||||
| 143 | or $InputEncoding ne $OutputEncoding ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 144 | ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 145 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 8 | ▶ | require Encode::compat if $] < 5.007001; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 8 | require Encode; | |||||||||||||||||||||||||||||||||||||||||||||
| 148 | 8 | $DoEncoding = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 8 | ( "__Content-Type", $enc ); | |||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 153 | : ( "__$1", $2 ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 154 | : (); | ||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } split( /\r*\n+\r*/, transform(pop) ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 160 | # transform() | ||||||||||||||||||||||||||||||||||||||||||||||
| 161 | # --------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 162 | # copy-pasted from Locale::Maketext::Lexicon::Gettext, with no change, | ||||||||||||||||||||||||||||||||||||||||||||||
| 163 | # because it accesses the $InputEncoding and $OutputEncoding vars | ||||||||||||||||||||||||||||||||||||||||||||||
| 164 | # | ||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 6956 | ▶ | sub transform { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
transform: called CC=8 SCAR=22.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 6956 | my $str = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 6956 | ▶ | if ( $DoEncoding and $InputEncoding ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$DoEncoding and $InputEncoding
MC/DC50%1/2
$DoEncoding and $InputEncoding
$DoEncoding
$InputEncoding
Truth table66%2/3
A and B
A= $DoEncodingB= $InputEncoding
| |||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 6932 | ▶ | $str | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 170 | = ( $InputEncoding eq 'utf8' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 171 | ? Encode::decode_utf8($str) | ||||||||||||||||||||||||||||||||||||||||||||||
| 172 | : Encode::decode( $InputEncoding, $str ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 6956 | $str =~ s/\\([0x]..|c?.)/qq{"\\$1"}/eeg; | |||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 6956 | ▶ | if ( $DoEncoding and $OutputEncoding ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$DoEncoding and $OutputEncoding
MC/DC0%0/2
$DoEncoding and $OutputEncoding
$DoEncoding
$OutputEncoding
Truth table66%2/3
A and B
A= $DoEncodingB= $OutputEncoding
| |||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | $str | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 179 | = ( $OutputEncoding eq 'utf8' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 180 | ? Encode::encode_utf8($str) | ||||||||||||||||||||||||||||||||||||||||||||||
| 181 | : Encode::encode( $OutputEncoding, $str ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 6956 | ▶ | return Locale::Maketext::Lexicon::option('disable_maketext_conversion') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 185 | ? $str : _gettext_to_maketext($str); | ||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 3 | __PACKAGE__ | |||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||
| 191 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||