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,15 +91,17 @@ class WikiContent < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def text
|
||||
@text ||= case compression
|
||||
@text ||= begin
|
||||
str = case compression
|
||||
when 'gzip'
|
||||
str = Zlib::Inflate.inflate(data)
|
||||
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
||||
str
|
||||
Zlib::Inflate.inflate(data)
|
||||
else
|
||||
# uncompressed data
|
||||
data
|
||||
end
|
||||
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
||||
str
|
||||
end
|
||||
end
|
||||
|
||||
def project
|
||||
|
|
Loading…
Reference in New Issue