summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/redmine/export/pdf.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb
index 5ea33e3a8..3115b8b0c 100644
--- a/lib/redmine/export/pdf.rb
+++ b/lib/redmine/export/pdf.rb
@@ -151,11 +151,17 @@ module Redmine
txt.force_encoding('ASCII-8BIT')
else
@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
- txt
+ txtar += $!.success
end
+ txt = txtar
end
# 0x5c char handling
txt.gsub(/\\/, "\\\\\\\\")