summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-29 05:35:51 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-29 05:35:51 +0000
commit02c5577a26b19b551817017f140f47f377dc10c4 (patch)
tree4c2fadb1af0cd1903510fe5fe8be8d8b65e801b5
parentf62605c636c2089a1c7a4ea6998dac135bd75346 (diff)
downloadredmine-02c5577a26b19b551817017f140f47f377dc10c4.tar.gz
redmine-02c5577a26b19b551817017f140f47f377dc10c4.zip
PDF: add test of ensuring 'ASCII-8BIT' encoding in Ruby 1.9 (#61).
Japanese CP932(Shift_JIS) and Traditional Chinese Big5 have 0x5c(backslash) problem, and these are incompatible with ASCII. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5566 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/lib/redmine/export/pdf_test.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/unit/lib/redmine/export/pdf_test.rb b/test/unit/lib/redmine/export/pdf_test.rb
index c26c4c4b7..6118b96c0 100644
--- a/test/unit/lib/redmine/export/pdf_test.rb
+++ b/test/unit/lib/redmine/export/pdf_test.rb
@@ -34,12 +34,15 @@ class PdfTest < ActiveSupport::TestCase
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)
+ txt_1 = pdf.fix_text_encoding(utf8_txt_1)
+ txt_2 = pdf.fix_text_encoding(utf8_txt_2)
+ txt_3 = pdf.fix_text_encoding(utf8_txt_3)
+ assert_equal "?\x91\xd4", txt_1
+ assert_equal "?\x91\xd4?", txt_2
+ assert_equal "??\x91\xd4?", txt_3
+ assert_equal "ASCII-8BIT", txt_1.encoding.to_s
+ assert_equal "ASCII-8BIT", txt_2.encoding.to_s
+ assert_equal "ASCII-8BIT", txt_3.encoding.to_s
else
assert_equal "???\x91\xd4",
pdf.fix_text_encoding(utf8_txt_1)