Defect #6505
PDF export broken with Japanese (Gannt and Issue Tracking)
Status: | Closed | Start date: | 2010-09-27 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | PDF export | |||
Target version: | - | |||
Resolution: | Duplicate | Affected version: | 1.0.1 |
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.
Related issues
History
#1
Updated by Leo Hourvitz about 9 years ago
#2
Updated by Igor Velkov about 9 years ago
Same for russian: I try to save as pdf an issue with comments, and got pdf with russian garbled text.
#3
Updated by Toshi MARUYAMA about 9 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.
#4
Updated by John Yani about 9 years ago
PDF enconding is a known bug of Redmine. See issue #61.
#5
Updated by Toshi MARUYAMA about 9 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.
#6
Updated by Jun NAITOH over 8 years ago
- File japanese.rb.patch
added
- File korean.rb.patch
added
- File 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
#7
Updated by Toshi MARUYAMA over 8 years ago
- Category changed from Issues to PDF export
- Status changed from New to 7
- Assignee set to Toshi MARUYAMA
#8
Updated by Toshi MARUYAMA over 8 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.
#9
Updated by Jun NAITOH over 8 years ago
- File pdf.rb_utf8.patch
added
- File gantt.rb_utf8.patch
added
- File korean.rb_utf8.patch
added
- File japanese.rb_utf8.patch
added
- File 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
#10
Updated by Toshi MARUYAMA over 8 years ago
#11
Updated by Jun NAITOH over 8 years ago
#12
Updated by Toshi MARUYAMA over 8 years ago
- Status changed from 7 to Closed
- Resolution set to Duplicate
Thank you posting new patch to #61.