mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-23 00:41:14 +00:00
unify duplicate codes (#24616)
git-svn-id: http://svn.redmine.org/redmine/trunk@16272 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3e2d20ad91
commit
281bc5c454
@ -25,11 +25,7 @@ module Redmine
|
|||||||
str = str.encode("UTF-8", :invalid => :replace,
|
str = str.encode("UTF-8", :invalid => :replace,
|
||||||
:undef => :replace, :replace => '?')
|
:undef => :replace, :replace => '?')
|
||||||
else
|
else
|
||||||
str.force_encoding("UTF-8")
|
str = replace_invalid_utf8(str)
|
||||||
if ! str.valid_encoding?
|
|
||||||
str = str.encode("US-ASCII", :invalid => :replace,
|
|
||||||
:undef => :replace, :replace => '?').encode("UTF-8")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
str
|
str
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user