##// END OF EJS Templates
PDF: replace converting error characters instead of returning UTF-8 in FPDF ANSI on Ruby 1.8 (#61)....
Toshi MARUYAMA -
r5231:2f2cdfd96a9c
parent child
Show More
@@ -151,11 +151,17 module Redmine
151 txt.force_encoding('ASCII-8BIT')
151 txt.force_encoding('ASCII-8BIT')
152 else
152 else
153 @ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
153 @ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
154 txt = begin
154 txtar = ""
155 @ic.iconv(txt)
155 begin
156 txtar += @ic.iconv(txt)
157 rescue Iconv::IllegalSequence
158 txtar += $!.success
159 txt = '?' + $!.failed[1,$!.failed.length]
160 retry
156 rescue
161 rescue
157 txt
162 txtar += $!.success
158 end
163 end
164 txt = txtar
159 end
165 end
160 # 0x5c char handling
166 # 0x5c char handling
161 txt.gsub(/\\/, "\\\\\\\\")
167 txt.gsub(/\\/, "\\\\\\\\")
General Comments 0
You need to be logged in to leave comments. Login now