WikiContent::Version#text may return ascii-8bit encoded string (#10590).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9329 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e964135b62
commit
f1cae4f7af
|
@ -91,14 +91,16 @@ class WikiContent < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def text
|
def text
|
||||||
@text ||= case compression
|
@text ||= begin
|
||||||
when 'gzip'
|
str = case compression
|
||||||
str = Zlib::Inflate.inflate(data)
|
when 'gzip'
|
||||||
|
Zlib::Inflate.inflate(data)
|
||||||
|
else
|
||||||
|
# uncompressed data
|
||||||
|
data
|
||||||
|
end
|
||||||
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
||||||
str
|
str
|
||||||
else
|
|
||||||
# uncompressed data
|
|
||||||
data
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue