|
|
|
|
|
|
|
|
txt.force_encoding('ASCII-8BIT') |
|
|
txt.force_encoding('ASCII-8BIT') |
|
|
else |
|
|
else |
|
|
@ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8') |
|
|
@ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8') |
|
|
txt = begin |
|
|
|
|
|
@ic.iconv(txt) |
|
|
|
|
|
|
|
|
txtar = "" |
|
|
|
|
|
begin |
|
|
|
|
|
txtar += @ic.iconv(txt) |
|
|
|
|
|
rescue Iconv::IllegalSequence |
|
|
|
|
|
txtar += $!.success |
|
|
|
|
|
txt = '?' + $!.failed[1,$!.failed.length] |
|
|
|
|
|
retry |
|
|
rescue |
|
|
rescue |
|
|
txt |
|
|
|
|
|
|
|
|
txtar += $!.success |
|
|
end |
|
|
end |
|
|
|
|
|
txt = txtar |
|
|
end |
|
|
end |
|
|
# 0x5c char handling |
|
|
# 0x5c char handling |
|
|
txt.gsub(/\\/, "\\\\\\\\") |
|
|
txt.gsub(/\\/, "\\\\\\\\") |