1183 |
(%opt, allow_semiconforming => 1); |
(%opt, allow_semiconforming => 1); |
1184 |
if ($e) { |
if ($e) { |
1185 |
$obj->{perl_encoding_name} = $e->name; |
$obj->{perl_encoding_name} = $e->name; |
1186 |
if ($self->{category} & CHARSET_CATEGORY_SJIS) { |
unless ($self->{category} & CHARSET_CATEGORY_BLOCK_SAFE) { |
1187 |
return ((bless $obj, 'Whatpm::Charset::DecodeHandle::ShiftJIS'), |
$e_status |= FALLBACK_ENCODING_IMPL; |
|
$e_status); |
|
|
#} elsif ($self->{category} & CHARSET_CATEGORY_BLOCK_SAFE) { |
|
|
} else { |
|
|
$e_status |= FALLBACK_ENCODING_IMPL |
|
|
unless $self->{category} & CHARSET_CATEGORY_BLOCK_SAFE; |
|
|
$obj->{bom_pattern} = $self->{bom_pattern}; |
|
|
$obj->{fallback} = $self->{fallback}; |
|
|
return ((bless $obj, 'Whatpm::Charset::DecodeHandle::Encode'), |
|
|
$e_status); |
|
|
#} else { |
|
|
# ## TODO: no encoding error (?) |
|
|
# return (undef, 0); |
|
1188 |
} |
} |
1189 |
|
$obj->{bom_pattern} = $self->{bom_pattern}; |
1190 |
|
$obj->{fallback} = $self->{fallback}; |
1191 |
|
return ((bless $obj, 'Whatpm::Charset::DecodeHandle::Encode'), $e_status); |
1192 |
} else { |
} else { |
|
## TODO: no encoding error(?) |
|
1193 |
return (undef, 0); |
return (undef, 0); |
1194 |
} |
} |
1195 |
} # get_decode_handle |
} # get_decode_handle |