Defect #7794

Internal server error on formatting an issue as a PDF in Japanese

Added by Yuki Sonoda almost 10 years ago. Updated almost 10 years ago.

Status:ClosedStart date:2011-03-06
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

0%

Category:PDF export
Target version:1.1.3
Resolution:Fixed Affected version:1.1.2

Description

IssuesController#show fails with internal server error when
  • params[:format] is pdf
  • AcceptLanguage: ja
  • @issue.description contains an ASCII control character.

This is because the map SJIS_widths does not have a mapping for control characters and it leads concatenation of a String and nil at vendor/plugins/rfpdf/lib/rfpdf/japanese.rb:182.

The attached patch fixes this problem.

ja-pdf.patch Magnifier (1.67 KB) Yuki Sonoda, 2011-03-06 13:23

test-1-org.pdf (5.48 KB) Jun NAITOH, 2011-04-01 00:54

test-1-ja-pdf.patch.pdf (5.98 KB) Jun NAITOH, 2011-04-01 00:54

test-1-ja-pdf_fix.patch.pdf (5.48 KB) Jun NAITOH, 2011-04-01 00:54

ja-pdf_fix.patch Magnifier (627 Bytes) Jun NAITOH, 2011-04-01 00:54


Related issues

Related to Redmine - Defect #61: Broken character encoding in pdf export Closed
Related to Redmine - Defect #6505: PDF export broken with Japanese (Gannt and Issue Tracking) Closed 2010-09-27

Associated revisions

Revision 5183
Added by Toshi MARUYAMA almost 10 years ago

Fix an internal server error on formatting an issue as a PDF in Japanese (#7794).

Contributed by Yuki Sonoda.

Revision 5253
Added by Toshi MARUYAMA almost 10 years ago

PDF: transplant r5183 (#61).

Fix an internal server error on formatting an issue as a PDF in Japanese (#7794).

Contributed by Yuki Sonoda.

Revision 5271
Added by Toshi MARUYAMA almost 10 years ago

PDF: fix the width of the ASCII character of Japanese PDF (#7794).

r5256 in trunk has this change.
So, there is no need to commit in trunk.

Contributed by Jun NAITOH.

Revision 5281
Added by Toshi MARUYAMA almost 10 years ago

PDF: back out r5253 (#7794, #61).

r5256 fixed #7794 completely.
r5253 effects the width of the ASCII character of Japanese PDF.

Contributed by Jun NAITOH.

Revision 5282
Added by Toshi MARUYAMA almost 10 years ago

Merged r5281 from trunk.

r5256 in trunk and r5271 in 1.1-stable fixed #7794 completely.
r5253 (r5183) in trunk and r5184 effect the width of the ASCII character of Japanese PDF.

Contributed by Jun NAITOH.

History

#1 Updated by Toshi MARUYAMA almost 10 years ago

  • Status changed from New to 7
  • Assignee set to Toshi MARUYAMA

#2 Updated by Toshi MARUYAMA almost 10 years ago

  • Tracker changed from Patch to Defect
  • Subject changed from Fix for an internal server error on formatting an issue as a PDF in Japanese to Internal server error on formatting an issue as a PDF in Japanese

#3 Updated by Toshi MARUYAMA almost 10 years ago

  • Target version set to 1.1.3
  • Affected version (unused) set to 1.1.2
  • Affected version set to 1.1.2

I confirmed Japanese locale has problem.
Korean, Simplified and Traditional Chinese don't have problem.

#4 Updated by Toshi MARUYAMA almost 10 years ago

  • Status changed from 7 to Closed
  • Resolution set to Fixed

Fixed by r5183 in trunk and r5184 in 1.1-stable.
Thanks.

#5 Updated by Jun NAITOH almost 10 years ago

When I tested #61 in trunk, now. I found ja-pdf.patch problem.

I retested in Redmine 1.1.2 + ja-pdf.patch.

Test string is "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 0"

  • Redmine 1.1.2 : test-1-org.pdf
  • Redmine 1.1.2 + ja-pdf.patch : test-1-ja-pdf.patch.pdf

The width of the ASCII character has changed by ja-pdf.patch.

I rewrite ja-pdf_fix.patch for Redmine 1.1.2.

  • Redmine 1.1.2 + ja-pdf_fix.patch : test-1-ja-pdf_fix.patch.pdf

#6 Updated by Toshi MARUYAMA almost 10 years ago

  • Status changed from Reopened to Closed

I have committed r5271 in 1.1-stable.
Thanks.

#7 Updated by Toshi MARUYAMA almost 10 years ago

  • Status changed from Closed to Reopened

#8 Updated by Toshi MARUYAMA almost 10 years ago

  • Status changed from Reopened to Closed

Sorry, I could not understand note 5.
I committed r5281 in trunk and r5282 in stable-1.1.
Thanks.

Also available in: Atom PDF