summaryrefslogtreecommitdiffstats
path: root/test/unit/lib/redmine/i18n_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-04 02:39:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-04 02:39:43 +0000
commit6d13ed58db677fc1d5834dd9ac8c0643bfec57b7 (patch)
tree5e33a4794b9a01160f5a8a5af656fd2bf9688d80 /test/unit/lib/redmine/i18n_test.rb
parentd435195764dbe07f85bff1b87c386b2ad2582e97 (diff)
downloadredmine-6d13ed58db677fc1d5834dd9ac8c0643bfec57b7.tar.gz
redmine-6d13ed58db677fc1d5834dd9ac8c0643bfec57b7.zip
i18n: add test of utf-8 strings.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5307 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib/redmine/i18n_test.rb')
-rw-r--r--test/unit/lib/redmine/i18n_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/i18n_test.rb b/test/unit/lib/redmine/i18n_test.rb
index 7ef5feb39..946e7463f 100644
--- a/test/unit/lib/redmine/i18n_test.rb
+++ b/test/unit/lib/redmine/i18n_test.rb
@@ -146,4 +146,15 @@ class Redmine::I18nTest < ActiveSupport::TestCase
::I18n.locale = 'fr'
assert_equal "Pas de traduction", l(:untranslated)
end
+
+ def test_utf8
+ set_language_if_valid 'ja'
+ str_ja_yes = "\xe3\x81\xaf\xe3\x81\x84"
+ i18n_ja_yes = l(:general_text_Yes)
+ if str_ja_yes.respond_to?(:force_encoding)
+ str_ja_yes.force_encoding('UTF-8')
+ assert_equal "UTF-8", i18n_ja_yes.encoding.to_s
+ end
+ assert_equal str_ja_yes, i18n_ja_yes
+ end
end