Adding conditional to test if xml is already decoded
This commit is contained in:
parent
e6d3b211f8
commit
b895efb8c6
1 changed files with 5 additions and 1 deletions
|
|
@ -358,7 +358,11 @@ sub _get_rss_data {
|
||||||
# Convert encoding if needed
|
# Convert encoding if needed
|
||||||
$xml =~ /<\?xml.*?encoding=['"](\S+)['"]/i;
|
$xml =~ /<\?xml.*?encoding=['"](\S+)['"]/i;
|
||||||
my $xmlEncoding = $1 || 'utf8';
|
my $xmlEncoding = $1 || 'utf8';
|
||||||
$xml = Encode::decode($xmlEncoding, $xml);
|
|
||||||
|
if (Encode::is_utf8($xml)) {
|
||||||
|
} else {
|
||||||
|
$xml = Encode::decode($xmlEncoding, $xml);
|
||||||
|
}
|
||||||
|
|
||||||
my $rss_lite = {};
|
my $rss_lite = {};
|
||||||
eval {
|
eval {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue