From 6d13ed58db677fc1d5834dd9ac8c0643bfec57b7 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Mon, 4 Apr 2011 02:39:43 +0000 Subject: [PATCH] i18n: add test of utf-8 strings. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5307 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/lib/redmine/i18n_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) 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