From c79bc7584092cf2eacf8736ac78228dd110afce5 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 24 Aug 2010 16:53:35 -0700 Subject: [PATCH] Fix encoding problems with the SC asset. Update the encodings test to no longer require an ENV variable to run. Fixes bug #11795 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/SyndicatedContent.pm | 6 +----- t/Asset/Wobject/SyndicatedContent/encodings.t | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e212edb79..41a100fca 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,6 +10,7 @@ - fixed #11798: Gallery request non existent image - fixed #11800: Group to view for new events defaults to 'Everyone' - fixed #11796: Gallery Drag & Drop broken in IE 7 + - fixed #11795: Wrong display UTF8 chars in Syndicated content (#12621) 7.9.12 - webgui.org homepage gives 404 (#11778) diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index 27494239d..f8625e439 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -168,11 +168,7 @@ sub generateFeed { $value = $cache->setByHTTP($url, $self->get("cacheTimeout")); $newlyCached = 1; } - #warn "got this: $value\n"; - # if the content can be downgraded, it is either valid latin1 or didn't have - # an HTTP Content-Encoding header. In the second case, XML::FeedPP will take - # care of any encoding specified in the XML prolog - utf8::downgrade($value, 1); + eval { my $singleFeed = XML::FeedPP->new($value, utf8_flag => 1, -type => 'string', xml_deref => 1, @opt); $feed->merge_channel($singleFeed); diff --git a/t/Asset/Wobject/SyndicatedContent/encodings.t b/t/Asset/Wobject/SyndicatedContent/encodings.t index b84eca499..29804f44e 100644 --- a/t/Asset/Wobject/SyndicatedContent/encodings.t +++ b/t/Asset/Wobject/SyndicatedContent/encodings.t @@ -19,7 +19,6 @@ use lib "$FindBin::Bin/../../../lib"; use WebGUI::Test; use Test::More; # increment this value for each test you create use WebGUI::Session; -plan skip_all => 'set TEST_ENCODINGS to enable this test' unless $ENV{TEST_ENCODINGS}; plan tests => 13; # increment this value for each test you create use Test::Deep; use WebGUI::Asset::Wobject::SyndicatedContent; @@ -103,6 +102,7 @@ is $syndicated_content->generateFeed->title, $es_title, 'No encoding in prolog, $cache->set($iso_8859_1, 60); is $syndicated_content->generateFeed->title, $es_title, 'ISO-8859-1 encoded'; + $cache->set($iso_8859_5, 60); is $syndicated_content->generateFeed->title, $ru_title, 'ISO-8859-5 encoded';