summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-06 14:27:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-06 14:27:35 +0000
commitbb724e75c0a9ffc7f97b59ef474d96f221f90fd0 (patch)
tree59d6eb0a43a00111e7d6e208277f75a37d869a99 /app
parent5259dec0611a00c84b4ae7f460202c761abec5f9 (diff)
downloadredmine-bb724e75c0a9ffc7f97b59ef474d96f221f90fd0.tar.gz
redmine-bb724e75c0a9ffc7f97b59ef474d96f221f90fd0.zip
Fixed: improper 0x5c char handling in PDF output (Go Maeda).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@813 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-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