summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-06 10:16:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-06 10:16:29 +0000
commit561f6bb6d195e4a9c0d31d8ec7a1b27085aefbed (patch)
tree561ad24ab69548aef1a1de2753f4bb49f85306dc /test
parentb23bf1f2999bc5b7b12e7ec4f19642b35d7da6eb (diff)
downloadredmine-561f6bb6d195e4a9c0d31d8ec7a1b27085aefbed.tar.gz
redmine-561f6bb6d195e4a9c0d31d8ec7a1b27085aefbed.zip
PDF: add test of replacing converting error characters in FPDF ANSI on Ruby 1.9 (#61).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5350 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/export/pdf_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/export/pdf_test.rb b/test/unit/lib/redmine/export/pdf_test.rb
index d319ce0ec..db7787a57 100644
--- a/test/unit/lib/redmine/export/pdf_test.rb
+++ b/test/unit/lib/redmine/export/pdf_test.rb
@@ -66,4 +66,20 @@ class PdfTest < ActiveSupport::TestCase
assert_equal "\x91\xe3\x95\\\\a\\\\",
pdf.fix_text_encoding("\xe4\xbb\xa3\xe8\xa1\xa8a\\")
end
+
+ def test_fix_text_encoding_cannot_convert_ja_cp932
+ pdf = Redmine::Export::PDF::IFPDF.new('ja')
+ assert pdf
+ utf8_txt_1 = "\xe7\x8b\x80\xe6\x85\x8b"
+ utf8_txt_2 = "\xe7\x8b\x80\xe6\x85\x8b\xe7\x8b\x80"
+ utf8_txt_3 = "\xe7\x8b\x80\xe7\x8b\x80\xe6\x85\x8b\xe7\x8b\x80"
+ if utf8_txt_1.respond_to?(:force_encoding)
+ assert_equal "?\x91\xd4",
+ pdf.fix_text_encoding(utf8_txt_1)
+ assert_equal "?\x91\xd4?",
+ pdf.fix_text_encoding(utf8_txt_2)
+ assert_equal "??\x91\xd4?",
+ pdf.fix_text_encoding(utf8_txt_3)
+ end
+ end
end