Defect #1249

在生成PDF文件时,中文出现乱码

Added by zongshui Xiao over 9 years ago. Updated almost 4 years ago.

Status:ClosedStart date:2008-05-17
Priority:NormalDue date:
Assignee:Chaoqun Zou% Done:

0%

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

Description

UTF-8是每个中文字是3个字节,而在\redmine\vendor\plugins\rfpdf\lib\rfpdf\chinese.rb文件中的第232行:i+=ascii ? 1 : 2,应该是i+=ascii ? 1 : 3
这样经过测试,问题解决。

language_selection.png (18.1 KB) Junyu Jiang, 2012-08-21 09:53

rd-274.pdf - user language english , export with chinese (309 KB) Maxime Vez, 2013-11-14 09:26


Related issues

Duplicates Redmine - Defect #13781: CJK(Chinese/Japanese/Korean) characters are not shown in ... Closed

History

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

  • Status changed from New to Closed
  • Assignee deleted (Nicolas Chuche)
  • Target version deleted (0.7.2)
  • Resolution set to Invalid

Please, speak in english here.

#2 Updated by qing qu over 7 years ago

  • Status changed from Closed to Reopened
  • Assignee set to Chaoqun Zou

  1. 文件默认就是1:3,还是乱码

#3 Updated by arone zhang over 7 years ago

0.9.3里面redmine将语言和字符集混淆了,
只要将个人默认语言设置为“简体中文”就可以正常导出了

所以它的逻辑是有问题的,语言是用来控制界面多语言的,而pdf中内容导出不应该是和这个有关系。

#4 Updated by Azamat Hackimov over 7 years ago

  • Status changed from Reopened to Closed

Please, speak english, or we cannot help you.

#5 Updated by Junyu Jiang about 5 years ago

Hi, I have same problem now, and I found this issue while searching.

The problem is, while export issue to pdf, the Chinese character will be a block.
This problem will be fixed if I changed my default language selection.
While my account language is English, it is wrong, and if my language is Chinese, then the export PDF is OK.

IMO, export PDF should not relating to my language selection.

Refer to

#6 Updated by Toshi MARUYAMA about 5 years ago

  • Status changed from Reopened to Closed
  • Resolution changed from Invalid to Wont fix

PDF implantation has changed on Redmine 1.2.
On non CJK locale, Redmine uses embedded fonts.
On CJK locale, Redmine uses non-embedded fonts.

Unicode has unified problem.
http://www.redmine.org/issues/61#note-95

And there is no free font of high quality CJK.

#7 Updated by Toshi MARUYAMA about 5 years ago

  • Category changed from Translations to PDF export

#8 Updated by Junyu Jiang about 5 years ago

mmm, my question is not export Chinese problem. Please refer to the png file I attached. While I am in Chinese language, there is no problem to export pdf file. But if I was in English language mode, there IS problem.

I think user interface should not be related to pdf export result.

#9 Updated by Toshi MARUYAMA about 5 years ago

Junyu Jiang wrote:

mmm, my question is not export Chinese problem. Please refer to the png file I attached. While I am in Chinese language, there is no problem to export pdf file. But if I was in English language mode, there IS problem.

This is design.
As I described note-6, on English locale, Redmine uses embedded font.
This font does not have Chinese characters.

I think user interface should not be related to pdf export result.

As I described note-6, Unicode has unified problem.
So, Redmine uses non-embedded fonts on CJK locales.

#10 Updated by Maxime Vez almost 4 years ago

+1

I have the exact same problem. When user language is set to English, and exporting to PDF, the Chinese characters will be displayed as square blocks in the PDF. When user language set as Chinese, then no problem.

Is there a workaround? thanks

#11 Updated by Jan Niggemann (redmine.org team member) almost 4 years ago

You posted to a thread that was first closed 5 years ago...

#12 Updated by Toshi MARUYAMA almost 4 years ago

  • Resolution changed from Wont fix to Duplicate

#13 Updated by Toshi MARUYAMA almost 4 years ago

  • Duplicates Defect #13781: CJK(Chinese/Japanese/Korean) characters are not shown in PDF on non CJK locales added

#14 Updated by Toshi MARUYAMA almost 4 years ago

Maxime Vez wrote:

+1

I have the exact same problem. When user language is set to English, and exporting to PDF, the Chinese characters will be displayed as square blocks in the PDF. When user language set as Chinese, then no problem.

Is there a workaround? thanks

See #13781.

Also available in: Atom PDF