txt = Redmine::CodesetUtil.replace_invalid_utf8(txt)
end
txt.force_encoding('ASCII-8BIT')
+ elsif RUBY_PLATFORM == 'java'
+ begin
+ ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
+ txt = ic.iconv(txt)
+ rescue
+ txt = txt.gsub(%r{[^\r\n\t\x20-\x7e]}, '?')
+ end
else
ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
txtar = ""
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
+ elsif RUBY_PLATFORM == 'java'
+ assert_equal "??",
+ Redmine::Export::PDF::RDMPdfEncoding::rdm_pdf_iconv(ic, utf8_txt_1)
+ assert_equal "???",
+ Redmine::Export::PDF::RDMPdfEncoding::rdm_pdf_iconv(ic, utf8_txt_2)
+ assert_equal "????",
+ Redmine::Export::PDF::RDMPdfEncoding::rdm_pdf_iconv(ic, utf8_txt_3)
else
assert_equal "???\x91\xd4",
Redmine::Export::PDF::RDMPdfEncoding::rdm_pdf_iconv(ic, utf8_txt_1)