lib/peddler/flat_file_parser.rb in peddler-2.1.0 vs lib/peddler/flat_file_parser.rb in peddler-2.1.1
- old
+ new
@@ -37,10 +37,10 @@
private
def scrub_body!(encoding)
return if body.encoding == Encoding::UTF_8
- self.body = body.dup.force_encoding(encoding)
+ self.body = body.dup.force_encoding(content_charset || encoding)
end
def extract_content_and_summary
@content = body.encode('UTF-8', invalid: :replace, undef: :replace)
@summary, @content = @content.split("\n\n", 2) if @content =~ /\t\t.*\n\n/