プロジェクト

全般

プロフィール

Vote #70097

完了

JRuby: PDF export error with TypeError

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

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

0%

予定工数:
category_id:
39
version_id:
35
issue_org_id:
8569
author_id:
11192
assigned_to_id:
11192
comments:
2
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
27
ステータス-->[Closed]

説明

TypeError in IssuesController#show

can't convert nil into String

/REDMINE-2/hg-git/redmine/lib/redmine/export/pdf.rb:417:in `rdm_pdf_iconv'
/REDMINE-2/hg-git/redmine/lib/redmine/export/pdf.rb:101:in `fix_text_encoding'
/REDMINE-2/hg-git/redmine/lib/redmine/export/pdf.rb:109:in `RDMMultiCell'
/REDMINE-2/hg-git/redmine/lib/redmine/export/pdf.rb:276:in `issue_to_pdf'
/REDMINE-2/hg-git/redmine/app/controllers/issues_controller.rb:124:in `show'
/REDMINE-2/hg-git/redmine/app/controllers/issues_controller.rb:120:in `show'

h2. The reason

"狀態" can not be converted to Japanese SJIS.
source:trunk/test/unit/lib/redmine/export/pdf_test.rb@6013#L43

$ python
>>> s = "\xe7\x8b\x80\xe6\x85\x8b"
>>> print s
狀態
>>> s.decode("UTF-8").encode("SJIS")
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'shift_jis' codec can't encode character u'\u72c0' in position 0: illegal multibyte sequence
>>> s.decode("UTF-8").encode("BIG5")
'\xaa\xac\xbaA'
>>> s.decode("UTF-8")
u'\u72c0\u614b'

journals

--------------------------------------------------------------------------------
Committed in trunk and 1.2-stable,
--------------------------------------------------------------------------------

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

  • カテゴリPDF export_39 にセット
  • 対象バージョン1.2.1_35 にセット

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

いいね!0
いいね!0