Commit c78c959a9b5eaa03998d782e908e405dcedcb4a5
Committed by
Antonio Terceiro
1 parent
3362240c
Fix: force utf-8 on content from external feeds
Error with feeds encoded with 8-bit ascii: "#<Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)>" (cherry picked from commit 288199b70036035c7c67e9617a1264851d438d6c)
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/feed_handler.rb
... | ... | @@ -25,7 +25,7 @@ class FeedHandler |
25 | 25 | def parse(content) |
26 | 26 | raise FeedHandler::ParseError, "Content is nil" if content.nil? |
27 | 27 | begin |
28 | - return FeedParser::Feed::new(content) | |
28 | + return FeedParser::Feed::new(content.force_encoding('utf-8')) | |
29 | 29 | rescue Exception => ex |
30 | 30 | raise FeedHandler::ParseError, "Invalid feed format." |
31 | 31 | end | ... | ... |