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
|
||||
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue