@@ -34,12 +34,15 class PdfTest < ActiveSupport::TestCase | |||||
34 | utf8_txt_2 = "\xe7\x8b\x80\xe6\x85\x8b\xe7\x8b\x80" |
|
34 | utf8_txt_2 = "\xe7\x8b\x80\xe6\x85\x8b\xe7\x8b\x80" | |
35 | utf8_txt_3 = "\xe7\x8b\x80\xe7\x8b\x80\xe6\x85\x8b\xe7\x8b\x80" |
|
35 | utf8_txt_3 = "\xe7\x8b\x80\xe7\x8b\x80\xe6\x85\x8b\xe7\x8b\x80" | |
36 | if utf8_txt_1.respond_to?(:force_encoding) |
|
36 | if utf8_txt_1.respond_to?(:force_encoding) | |
37 | assert_equal "?\x91\xd4", |
|
37 | txt_1 = pdf.fix_text_encoding(utf8_txt_1) | |
38 |
|
|
38 | txt_2 = pdf.fix_text_encoding(utf8_txt_2) | |
39 | assert_equal "?\x91\xd4?", |
|
39 | txt_3 = pdf.fix_text_encoding(utf8_txt_3) | |
40 | pdf.fix_text_encoding(utf8_txt_2) |
|
40 | assert_equal "?\x91\xd4", txt_1 | |
41 |
assert_equal "? |
|
41 | assert_equal "?\x91\xd4?", txt_2 | |
42 | pdf.fix_text_encoding(utf8_txt_3) |
|
42 | assert_equal "??\x91\xd4?", txt_3 | |
|
43 | assert_equal "ASCII-8BIT", txt_1.encoding.to_s | |||
|
44 | assert_equal "ASCII-8BIT", txt_2.encoding.to_s | |||
|
45 | assert_equal "ASCII-8BIT", txt_3.encoding.to_s | |||
43 | else |
|
46 | else | |
44 | assert_equal "???\x91\xd4", |
|
47 | assert_equal "???\x91\xd4", | |
45 | pdf.fix_text_encoding(utf8_txt_1) |
|
48 | pdf.fix_text_encoding(utf8_txt_1) |
General Comments 0
You need to be logged in to leave comments.
Login now