Defect #6505
closedPDF export broken with Japanese (Gannt and Issue Tracking)
0%
Description
When exporting Gannts or Issue Lists to PDF, the Japanese-language text is garbled (the English-language text comes out fine). A sample image is attached.
I suspect this will be true of any PDF export, but those are the two exports I've tried this with.
Note that unlike the report regarding Hebrew, this is not true of CSV export for Issue Lists; those come out fine via the UTF-8 encoding.
- CentOS 5.3
- MySQL 5.0.77 (yes my charset is UTF-8)
- ruby 1.8.7
- Rails 1.2.6 (I think, I'm using the one that was packaged with redmine 1.0.1)
I'm in Tokyo so this would seem to rule out decent printing from Redmine. Because CSV export works, there's always that workaround for Issue Lists.
I've read about the GANTT rewrite, but the fact this is in issue list export as well suggests it's something more generic. I listed the two related reports, but I couldn't see anything where this was resolved.
Files
Related issues
Updated by Leo Hourvitz about 14 years ago
Updated by Igor Velkov about 14 years ago
Same for russian: I try to save as pdf an issue with comments, and got pdf with russian garbled text.
Updated by Toshi MARUYAMA about 14 years ago
In Japanese, Issue Tracking works fine.
Please see http://www.redmine.org/boards/2/topics/11734 .
But Gantt is broken at 1.0.2.
Updated by John Yani almost 14 years ago
PDF enconding is a known bug of Redmine. See issue #61.
Updated by Toshi MARUYAMA almost 14 years ago
#61 is UTF-8 and font problem.
"general_pdf_encoding" at source:/tags/1.0.4/config/locales/ja.yml#L159 is "CP932".
So, PDF for issue list has no problem as long as user uses only Japanese character and user locale is "ja".
But, Gannt is broken at 1.0.2.
This is related with #6348.
Updated by Jun NAITOH over 13 years ago
- File japanese.rb.patch japanese.rb.patch added
- File korean.rb.patch korean.rb.patch added
- File chinese.rb.patch chinese.rb.patch added
This patch fixed the PDF export broken problem with Japanese/Chinese/Korean.
This is Rfpdf plugin's problem. Rfpdf plugin don't expect to input of UTF-8 character set....
Flow of PDF export broken problem (issue_to_pdf) in Japanese case.¶
- lib/redmine/export/pdf.rb : pdf.MultiCell (use UTF-8 character set)
- vendor/plugins/rfpdf/lib/rfpdf/japanese.rb : def MultiCell (expect SJIS character set input)
- vendor/plugins/rfpdf/lib/rfpdf/japanese.rb : Cell (expect SJIS character set output)
- lib/redmine/export/pdf.rb : def Cell (expect UTF-8 character set input)
MultiCell break UTF-8 3byte character.(Because, SJIS is 2byte character.)
Changed by this patch.¶
- lib/redmine/export/pdf.rb : pdf.MultiCell (use UTF-8 character set)
- vendor/plugins/rfpdf/lib/rfpdf/japanese.rb : def MultiCell (expect UTF-8 character set input)
- vendor/plugins/rfpdf/lib/rfpdf/japanese.rb : Cell (expect UTF-8 character set output)
- lib/redmine/export/pdf.rb : def Cell (expect UTF-8 character set input)
As for Chinese and Korean, it is similar.
My environment is as follows.¶
- CentOS 5.5(x86)
- Redmine 1.1.2
- ruby 1.8.7
- Rubygems 1.3.5
- sqlite 3.3.6
Updated by Toshi MARUYAMA over 13 years ago
- Category changed from Issues to PDF export
- Status changed from New to 7
- Assignee set to Toshi MARUYAMA
Updated by Toshi MARUYAMA over 13 years ago
- Assignee deleted (
Toshi MARUYAMA)
It seems an effect of note 6 patches is big.
I don't know about PDF, I remove assignee.
Updated by Jun NAITOH over 13 years ago
- File pdf.rb_utf8.patch pdf.rb_utf8.patch added
- File gantt.rb_utf8.patch gantt.rb_utf8.patch added
- File korean.rb_utf8.patch korean.rb_utf8.patch added
- File japanese.rb_utf8.patch japanese.rb_utf8.patch added
- File chinese.rb_utf8.patch chinese.rb_utf8.patch added
Sorry, a effect of note 6 patches is big... I'm think so, too.
I want to reduce the patches's effect. so, I rewrote this patch.
This new patch don't change the rpdf plugin interface spec.
This is related to #1170 patch.
Changed by this rewritten patch.¶
- UTF-8 input function added.
- lib/redmine/export/pdf.rb : def UTF8MultiCell (expect UTF-8 character set input, and use iconv)
- lib/redmine/export/pdf.rb : def UTF8Cell (expect UTF-8 character set input, and use iconv)
- some minor fix.
- tab character clash problem fix (japanese.rb only)
- don't work 'explicit line break' problem fix (korean.rb only)
- etc
Updated by Toshi MARUYAMA over 13 years ago
Updated by Jun NAITOH over 13 years ago
Updated by Toshi MARUYAMA over 13 years ago
- Status changed from 7 to Closed
- Resolution set to Duplicate
Thank you posting new patch to #61.