Project

General

Profile

Defect #10590 ยป force_encoding_always.patch

Alexander Oryol, 2012-04-03 10:16

View differences:

app/models/wiki_content.rb
end
def text
@text ||= case compression
when 'gzip'
str = Zlib::Inflate.inflate(data)
@text ||= begin
str = case compression
when 'gzip'
Zlib::Inflate.inflate(data)
else
# uncompressed data
data
end
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
str
else
# uncompressed data
data
end
end
    (1-1/1)