Commit 288199b70036035c7c67e9617a1264851d438d6c
1 parent
00d46ded
Exists in
master
and in
29 other branches
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)>"
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 | ... | ... |
-
mentioned in commit c4802a8fa0897ecce90c87d86b6cf9de8ba2878b