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