Defect #12309

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

Added by C Tibirna about 5 years ago. Updated almost 5 years ago.

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

0%

Category:PDF export
Target version:-
Resolution:Duplicate Affected version:

Description

Situation:
  • redmine 1.4-stable of today (2012-11-05)
  • rfpdf as coming installed with redmine
  • htmlentities-4.3.1 installed
  • wiking r27
Symptoms:
  • wiking has a few default behaviors for replacing quotes ("'"), short and long dashes with their htmlentities representations:
    • ' => ’
    • -- => –
    • --- => —
  • rfpdf should convert these htmlentities back to UTF characters, but fails
  • results a PDF output which, e.g. in French, it's barely readable ( "it's" ==> "it’s; "je l'ai" => "je l’ai") etc.
Investigation results:
  • it came out that rfpdf fails to load the htmlentities gem. There is code to (optionnaly) do it in rfpdf/init.rb, but, even when htmlentities is correctly installed, the loading of that module fails.
  • in the local configuration, in order to load htmlentities as installed with gem, one has to
    require 'rubygems'
    require 'htmlentities'
    Only the second is not enough.

Related issues

Duplicates Redmine - Defect #13138: Generating PDF of issue causes UndefinedConversionError w... Closed

History

#1 Updated by C Tibirna about 5 years ago

Heh, the default html code conversion tricked me. Please read:

  • ' => ’
  • -- => –
  • --- => —

results a PDF output which, e.g. in French, it's barely readable ( "it's" ==> "it’s and "je l'ai" => "je l’ai") etc.

#2 Updated by Jean-Philippe Lang about 5 years ago

  • Resolution set to Cant reproduce

C Tibirna wrote:

wiking has a few default behaviors for replacing quotes ("'"), short and long dashes with their htmlentities representations

I'm not aware of that, do you use the default textile formetter?.
And does anybody reproduces this problem?

#3 Updated by C Tibirna about 5 years ago

Oh, sorry, my bad. I managed to undertone a lot the fact that I am using the wiking plugin an this is the required first step.

But the bug is not the fault of wiking (it does its job as advertised). It's rfpdf that fails to decode html containing certain entities. Theoretically one can write those entities by hand in a redmine wiki document (as I did in the initial report) and then, trying to save that wiki page to pdf will render it "corrupted".

I wish and hope I did a better job at the rest of my report. Thanks for your understanding.

#4 Updated by Toshi MARUYAMA almost 5 years ago

  • Status changed from New to Closed
  • Resolution changed from Cant reproduce to Duplicate

As #13138#note-4, this issue is duplicate.

Also available in: Atom PDF