プロジェクト

全般

プロフィール

Vote #73340

完了

Generating PDF of issue causes UndefinedConversionError with htmlentities gem

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

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

説明

When attempting to create a PDF of an issue an internal error occurs. I think it is caused by the '–' character ("long dash":http://text-symbols.com/html/entities-and-descriptions/ or hyphen), because when I changed it to a standard dash '-' the PDF generated correctly.

In the log is the following:

Encoding::UndefinedConversionError ("\xE2" from ASCII-8BIT to UTF-8):
  lib/plugins/rfpdf/lib/tcpdf.rb:4346:in `unhtmlentities'
  lib/plugins/rfpdf/lib/tcpdf.rb:3542:in `block in writeHTML'
  lib/plugins/rfpdf/lib/tcpdf.rb:3509:in `each'
  lib/plugins/rfpdf/lib/tcpdf.rb:3509:in `writeHTML'
  lib/plugins/rfpdf/lib/tcpdf.rb:3620:in `writeHTMLCell'
  lib/redmine/export/pdf.rb:129:in `RDMwriteHTMLCell'
  lib/redmine/export/pdf.rb:681:in `block in issue_to_pdf'
  lib/redmine/export/pdf.rb:668:in `each'
  lib/redmine/export/pdf.rb:668:in `issue_to_pdf'
  app/controllers/issues_controller.rb:124:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:116:in `show'

This is the output of @RAILS_ENV=production rake about@

About your application's environment
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          1.8.11
Rack version              1.4
Rails version             3.2.11
Active Record version     3.2.11
Action Pack version       3.2.11
Active Resource version   3.2.11
Action Mailer version     3.2.11
Active Support version    3.2.11
Middleware                Rack::Cache, ActionDispatch::Static, Rack::Lock, #
, Rack::Runtime,
 Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger,
 ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp,
 ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement,
 ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore,
 ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head,
 Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport,
 OpenIdAuthentication
Application root          /var/www/redmine-2.2.2
Environment               production
Database adapter          mysql2
Database schema version   20121026003537

journals

Interestingly, PDF link works correctly for this issue, which was unexpected.
--------------------------------------------------------------------------------
I cannot reproduce on ruby-1.9.3-p374 in English.
What is your language and what is "general_pdf_encoding"?
English: source:tags/2.2.2/config/locales/en.yml#L143
--------------------------------------------------------------------------------
I forgot attaching PDF.
--------------------------------------------------------------------------------
I tried on CentOS 6.
I added Gemfile.local file.
<pre>
gem 'htmlentities'
</pre>

I reproduced on ruby 1.9.3p125 in English.
But, I cannot reproduced on ruby 1.8.7 in English.

I think it is the same problem as #12309.
--------------------------------------------------------------------------------
Toshi MARUYAMA wrote:
> I cannot reproduce on ruby-1.9.3-p374 in English.

Output from @ruby --version@ is: @ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]@
Server OS is Ubuntu 12.04 LTS.

> What is your language and what is "general_pdf_encoding"?
> English: source:tags/2.2.2/config/locales/en.yml#L143

Language is english & "general_pdf_encoding" is set to UTF-8.
--------------------------------------------------------------------------------
I think to this probrem caused by htmlentities gem on ruby 1.9.3

Redmine PDF export don't use htmlentities gem, now.
I wrote htmlentities gem delete patch.
--------------------------------------------------------------------------------

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

--------------------------------------------------------------------------------
Committed in trunk r11399 and 2.2-stable r11400, thanks.
--------------------------------------------------------------------------------


related_issues

duplicates,Closed,12309,rfpdf fails to include htmlentities gem, even when installed, thus potentially corrupting pdf output

Admin Redmine さんが3年以上前に更新

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

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

いいね!0
いいね!0