Skip to content

Commit

Permalink
Merge pull request #42 from mrasu/fix_content_type_encoding
Browse files Browse the repository at this point in the history
allow charset including quote
  • Loading branch information
rubys committed Mar 13, 2016
2 parents 00a92ff + 5ccd995 commit 1b0fdb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nokogumbo-import/lib/nokogumbo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def self.reencode(body, content_type=nil)

# look for a charset in a content-encoding header
if content_type
encoding ||= content_type[/charset=(.*?)($|\s|;)/i, 1]
encoding ||= content_type[/charset=["']?(.*?)($|["';\s])/i, 1]
end

# look for a charset in a meta tag in the first 1024 bytes
Expand Down

0 comments on commit 1b0fdb0

Please sign in to comment.