Patch #1170

export issue to pdf will messup when use Chinese language

Added by Chaoqun Zou over 9 years ago. Updated over 9 years ago.

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

0%

Category:Translations
Target version:0.7.2

Description

When using Chinese language, exporting issue to pdf will messup when the issue description is too long to be auto line broken.
The reason is the original chinese.rb assumes that the Chinese letter in utf-8 has 2 bytes, but actually the utf-8 Chinese letter has 3 bytes. So sometimes the auto line breaking function will insert a break in the middle of a Chinese letter, and then iconv which cann't convert the utf-8 text to gb2312 will throw an exception.
The jpg attachment shows the messup effect.

The attached patch also resolve a type convert error which will cause explicit line break being ignored.

And I have also checked the japanese.rb and korean.rb file in the same rfpdf folder. They also have the same problem that they assumes japanese or korean letter letter in utf-8 has 2 bytes which actually has 3. I hope some local user would correct them because I cann't read japanese or korean.

chinese_pdf_messup.jpg - messup effect (82.1 KB) Chaoqun Zou, 2008-05-04 18:08

chinese.rb.patch Magnifier - patch (1.83 KB) Chaoqun Zou, 2008-05-04 18:08

chinese.rb Magnifier - patched chinese.rb file (12.1 KB) Chaoqun Zou, 2008-05-04 18:08

Associated revisions

Revision 1497
Added by Jean-Philippe Lang over 9 years ago

Fixes Chinese pdf export when the issue description is too long (#1170).

Revision 5252
Added by Toshi MARUYAMA over 6 years ago

PDF: transplant r1497 (#61).

Fixes Chinese pdf export when the issue description is too long (#1170).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Target version set to 0.7.2

Fix applied in r1497. Thanks.

Also available in: Atom PDF