summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/ifpdf_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/ifpdf_helper.rb b/app/helpers/ifpdf_helper.rb
index 755692f65..5e7fb2898 100644
--- a/app/helpers/ifpdf_helper.rb
+++ b/app/helpers/ifpdf_helper.rb
@@ -53,10 +53,13 @@ module IfpdfHelper
def Cell(w,h=0,txt='',border=0,ln=0,align='',fill=0,link='')
@ic ||= Iconv.new(l(:general_pdf_encoding), 'UTF-8')
txt = begin
- @ic.iconv(txt)
+ # 0x5c char handling
+ txtar = txt.split('\\')
+ txtar << '' if txt[-1] == ?\\
+ txtar.collect {|x| @ic.iconv(x)}.join('\\').gsub(/\\/, "\\\\\\\\")
rescue
txt
- end
+ end || ''
super w,h,txt,border,ln,align,fill,link
end