i18n: add test of utf-8 strings.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5307 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-04 02:39:43 +00:00
parent d435195764
commit 6d13ed58db
1 changed files with 11 additions and 0 deletions

View File

@ -146,4 +146,15 @@ class Redmine::I18nTest < ActiveSupport::TestCase
::I18n.locale = 'fr' ::I18n.locale = 'fr'
assert_equal "Pas de traduction", l(:untranslated) assert_equal "Pas de traduction", l(:untranslated)
end 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 end