From 113316cf1ed573264f2514ed0851c1da5eb9df4a Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 9 Jun 2011 03:51:23 +0000 Subject: [PATCH] Merged r6023 from trunk. PDF: use SJIS instead of CP932 at unit pdf test test_rdm_pdf_iconv_invalid_utf8_should_be_replaced_ja in JRuby. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6026 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/lib/redmine/export/pdf_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/lib/redmine/export/pdf_test.rb b/test/unit/lib/redmine/export/pdf_test.rb index 59cae2092..acb46ca69 100644 --- a/test/unit/lib/redmine/export/pdf_test.rb +++ b/test/unit/lib/redmine/export/pdf_test.rb @@ -95,7 +95,11 @@ class PdfTest < ActiveSupport::TestCase str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding) str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding) if RUBY_VERSION < '1.9' - ic = Iconv.new(l(:general_pdf_encoding), 'UTF-8') + if RUBY_PLATFORM == 'java' + ic = Iconv.new("SJIS", 'UTF-8') + else + ic = Iconv.new(l(:general_pdf_encoding), 'UTF-8') + end end txt_1 = Redmine::Export::PDF::RDMPdfEncoding::rdm_pdf_iconv(ic, str1) txt_2 = Redmine::Export::PDF::RDMPdfEncoding::rdm_pdf_iconv(ic, str2)