Defect #9

Export feature(to csv/pdf) doesn't work (in Japanese)

Added by Satoru KURASHIKI almost 16 years ago. Updated about 10 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution: Affected version:


Gantt chart and Issues report can be exported to csv/pdf.
But when contents has Japanese(not Western) character, it doesn't work.

There are these problems:

1) is hardcorded with 'ISO-8859-1'.
Japanese requires 'SJIS'.
I think that it can be solved with introducing some mapping variable(hash, array, etc).

2)rfpdf plugin requires additional initializations for Japanese.
I tested on app/helpers/ifpdf_helpers.rb:
def initialize

+ extend(PDF_Japanese)
+ AddSJISFont()
SetCreator("redMine #{Redmine::VERSION}")

This is a bad example, but may be a hint in anyway...

3)rfpdf plugin may has bug(???)
in vendor/plugins/rfpdf/lib/rfpdf/japanese.rb 166:


Method 'ord' is not exist(ruby1.8). And, while it seems to aim converting character(c) to number(o), but (c) is already
number.(I tested 'o=c.unpack("U")', and got error. (c) is not string, but fixnum.)

To output pdf correctly, I change that line into:


But I'm not sure that this is OK. I don't know it's a -
a)not tested, only passing through from PHP version
b)tested on ruby1.9?(if added that method 'ord')

rfpdf's problem is out of this project. If this problem is difficult to solve, please add notice to README.

Related issues

Related to Redmine - Defect #61: Broken character encoding in pdf export Closed

Associated revisions

Revision 5249
Added by Toshi MARUYAMA over 11 years ago

PDF: transplant r287 (#61).

Fix for #9.
Export feature(to csv/pdf) doesn't work in Japanese
csv and pdf encoding are know defined for each language
(general_csv_encoding and general_pdf_encoding keys in lang files)
added SJIS font for japanese pdf exports.


#1 Updated by Jean-Philippe Lang almost 16 years ago

Good news, thanks.

#2 Updated by Satoru KURASHIKI almost 16 years ago

I tried revision 287 on Windows and Linux(debian testing).

Export works very fine. Great :)

#3 Updated by Jean-Philippe Lang almost 16 years ago

I've just committed a few changes to handle japanese in csv and
pdf exports. Encodings are now defined at language level (in
lang files).
Now it works fine, at least on my machine.

Can you try it ?

#4 Updated by Toshi MARUYAMA over 11 years ago

  • Category set to I18n

Also available in: Atom PDF