プロジェクト

全般

プロフィール

Vote #62007

完了

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

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
0
issue_org_id:
9
author_id:
9
assigned_to_id:
0
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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)Iconv.new 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

  super
  • extend(PDF_Japanese)
  •  AddSJISFont()
    

    SetCreator("redMine #{Redmine::VERSION}")

    end

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:

  o=ord(c)

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:

          o=c

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.


journals

Good news, thanks.
--------------------------------------------------------------------------------
I tried revision 287 on Windows and Linux(debian testing).

Export works very fine. Great :)
--------------------------------------------------------------------------------
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 ?
Thanks
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,61,Broken character encoding in pdf export

Admin Redmine さんがほぼ4年前に更新

  • カテゴリI18n から I18n_37 に変更

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0