Project

General

Profile

Actions

Defect #12309

closed

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

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

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
PDF export
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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'
    </pre
    Only the second is not enough.

Related issues

Is duplicate of Redmine - Defect #13138: Generating PDF of issue causes UndefinedConversionError with htmlentities gemClosed

Actions
Actions #1

Updated by C Tibirna about 12 years ago

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

  • ' => &rsquo;
  • -- => &ndash;
  • --- => &mdash;

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

Actions #2

Updated by Jean-Philippe Lang about 12 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?

Actions #3

Updated by C Tibirna about 12 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.

Actions #4

Updated by Toshi MARUYAMA almost 12 years ago

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

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

Actions

Also available in: Atom PDF