Patch #1204

Patch for scramble of PDF properties in UTF-8 environment

Added by Hajime Baba about 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:2008-05-07
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:0.8.1

Description

Hi, forks,

Thank you for the development of such a great product!

For PDF properties (such as Title, Author, and else), the encoding
of multi-byte characters should be UTF-16BE with BOM prefix, not UTF-8.

Below is a patch for this problem. The patch will provide
method overridings of SetTitle() and textstring(),
which are original in vendor/plugins/rfpdf/lib/rfpdf/fpdf.rb.

I have checked this patch in Japanese environment (see attached images),
but I suppose it should be applicable to other multi-byte environments
(such as Chinese, Korean, and so on) encoded by UTF-8.

Thank you for your consideration in advance.

Best Regards,
Hajime BABA

sample1.PNG (43.2 KB) Hajime Baba, 2008-05-07 15:09

sample2.PNG (101 KB) Hajime Baba, 2008-05-07 15:09

ifpdf_helper.rb.diff Magnifier (1.05 KB) Hajime Baba, 2008-05-07 15:09

Associated revisions

Revision 2233
Added by Jean-Philippe Lang over 8 years ago

Scramble PDF title (#1204).

History

#1 Updated by Thomas Lecavelier about 9 years ago

  • Target version changed from 0.7.1 to 0.8

Version 0.7.1 was released. Switch to 0.8.

#2 Updated by Jeffrey Hulten over 8 years ago

This patch applied cleanly for me but I am unsure of how to test it or what else needs to be done to accept it.

#3 Updated by Jean-Philippe Lang over 8 years ago

  • Target version changed from 0.8 to 0.8.1

#4 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Closed

Committed in r2233. Thanks.

Also available in: Atom PDF