summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-01-28 05:43:33 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-01-28 05:43:33 +0000
commit281bc5c454411e72f6ce934de7cbf1ca5192d35e (patch)
treeaf56b8a770c7506ef55d1da006d85b1c26a421d7 /lib
parent3e2d20ad91657f315f73507d0d6232a1295a1f86 (diff)
downloadredmine-281bc5c454411e72f6ce934de7cbf1ca5192d35e.tar.gz
redmine-281bc5c454411e72f6ce934de7cbf1ca5192d35e.zip
unify duplicate codes (#24616)
git-svn-id: http://svn.redmine.org/redmine/trunk@16272 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/codeset_util.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/redmine/codeset_util.rb b/lib/redmine/codeset_util.rb
index bb1f972d4..bd4803b70 100644
--- a/lib/redmine/codeset_util.rb
+++ b/lib/redmine/codeset_util.rb
@@ -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