@@ -44,4 +44,19 class PdfTest < ActiveSupport::TestCase | |||||
44 | assert_equal '\\\\\\\\abcd\\\\\\\\abcd\\\\\\\\', |
|
44 | assert_equal '\\\\\\\\abcd\\\\\\\\abcd\\\\\\\\', | |
45 | pdf.fix_text_encoding('\\\\abcd\\\\abcd\\\\') |
|
45 | pdf.fix_text_encoding('\\\\abcd\\\\abcd\\\\') | |
46 | end |
|
46 | end | |
|
47 | ||||
|
48 | def test_fix_text_encoding_backslash_ja_cp932 | |||
|
49 | pdf = Redmine::Export::PDF::IFPDF.new('ja') | |||
|
50 | assert pdf | |||
|
51 | assert_equal "\x83\\\\\x98A", | |||
|
52 | pdf.fix_text_encoding("\xe3\x82\xbd\xe9\x80\xa3") | |||
|
53 | assert_equal "\x83\\\\\x98A\x91\xe3\x95\\\\", | |||
|
54 | pdf.fix_text_encoding("\xe3\x82\xbd\xe9\x80\xa3\xe4\xbb\xa3\xe8\xa1\xa8") | |||
|
55 | assert_equal "\x91\xe3\x95\\\\\\\\", | |||
|
56 | pdf.fix_text_encoding("\xe4\xbb\xa3\xe8\xa1\xa8\\") | |||
|
57 | assert_equal "\x91\xe3\x95\\\\\\\\\\\\", | |||
|
58 | pdf.fix_text_encoding("\xe4\xbb\xa3\xe8\xa1\xa8\\\\") | |||
|
59 | assert_equal "\x91\xe3\x95\\\\a\\\\", | |||
|
60 | pdf.fix_text_encoding("\xe4\xbb\xa3\xe8\xa1\xa8a\\") | |||
|
61 | end | |||
47 | end |
|
62 | end |
General Comments 0
You need to be logged in to leave comments.
Login now