Skip to content
Browse files

Adding support for regex of UTF8 characters

  • Loading branch information...
1 parent aaf86ad commit ef0d5db568faa75073a43f45d5f544d4414a8ea3 Lucas Carlson committed Aug 24, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/simple-rss.rb
View
8 lib/simple-rss.rb
@@ -152,13 +152,13 @@ def clean_tag(tag)
end
def unescape(content)
- if content =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/n then
- CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
+ if content =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/un then
+ CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/u,'').strip
else
- content.gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
+ content.gsub(/(<!\[CDATA\[|\]\]>)/u,'').strip
end
end
end
class SimpleRSSError < StandardError
-end
+end

6 comments on commit ef0d5db

@redbar0n

Actually, this doesn't fix the error.

But replacing /un with /u in line 155 does.

Ref:
http://hightechsorcery.com/2011/04/fixing-a-bug-in-simple-rss/

Also, I recommend including this fix in the version people get when running 'gem install simple-rss'.
so they don't have to download from git and build the gem themselves, or edit the source themselves like I did.

cheers

@rstacruz

+1

@maosotero

This gem works pretty good, the problem is that still has the UTF bug.

@cwarren
cwarren commented on ef0d5db Aug 3, 2012

rebbaron - thanks for the update / tip!

@kevTheDev

+1

@Audio
Audio commented on ef0d5db Feb 4, 2013

@redbar0n thanks

Please sign in to comment.
Something went wrong with that request. Please try again.