Commit 90113134 authored by marutosijp's avatar marutosijp

unify duplicate codes (#24616)

git-svn-id: https://svn.redmine.org/redmine/trunk@16272 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 3f0fd686
......@@ -25,11 +25,7 @@ module Redmine
str = str.encode("UTF-8", :invalid => :replace,
:undef => :replace, :replace => '?')
else
str.force_encoding("UTF-8")
if ! str.valid_encoding?
str = str.encode("US-ASCII", :invalid => :replace,
:undef => :replace, :replace => '?').encode("UTF-8")
end
str = replace_invalid_utf8(str)
end
str
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment