]> source.dussan.org Git - redmine.git/commitdiff
i18n: add test of utf-8 strings.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 4 Apr 2011 02:39:43 +0000 (02:39 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 4 Apr 2011 02:39:43 +0000 (02:39 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5307 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/i18n_test.rb

index 7ef5feb39165eadf19a3de20202f2ad517a4c193..946e7463ff5bfe15fcde36c803f18ea52d58d698 100644 (file)
@@ -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