Defect #13872
closed
CJK(Chinese/Japanese/Korean) pdf export error on other CJK locales
Added by huang leo about 11 years ago.
Updated almost 11 years ago.
Description
*only simple Chinese can NOT export pdf. Big5 is fine.
once click pdf export, Internal error will be show. Following is the error log from server:*
Iconv::InvalidEncoding (invalid encoding ("gb18030", "UTF-8")):
lib/redmine/codeset_util.rb:146:in `initialize'
lib/redmine/codeset_util.rb:146:in `new'
lib/redmine/codeset_util.rb:146:in `from_utf8'
lib/redmine/export/pdf.rb:788:in `rdm_from_utf8'
lib/redmine/export/pdf.rb:112:in `fix_text_encoding'
lib/redmine/export/pdf.rb:132:in `RDMCell'
lib/redmine/export/pdf.rb:441:in `issues_to_pdf'
app/controllers/issues_controller.rb:89:in `index'
app/controllers/issues_controller.rb:82:in `index'
Environment:
Redmine version 2.3.0.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.13
Environment production
Database adapter MySQL
Redmine plugins:
piwik_plugin 0.1.1
redmine_issue_checklist 2.0.5
- Priority changed from Normal to Low
- Subject changed from pdf export error to CJK(Chinese/Japanese/Korean) pdf export error on other CJK locales
- Status changed from New to Needs feedback
It seems your system does not have "gb18030" encoding.
Try following.
$ irb
1.8.7 :001 > require 'iconv'
=> true
1.8.7 :002 > ic = Iconv.new("gb18030", "UTF-8")
=> #<Iconv:0x7f73019f8208>
1.8.7 :003 > ic.iconv("中国")
=> "\326\320\271\372"
Toshi MARUYAMA wrote:
It seems your system does not have "gb18030" encoding.
Try following.
[...]
Hi Toshi,
Thx for your support, But I don't know how to use your support information. modify some files or run script?
- Status changed from Needs feedback to Closed
- Resolution set to Invalid
Please contact your system administrator.
It seems your Ruby is broken.
On my CentOS 6.
$ locate -i gb18030
/home/xxxxx/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/x86_64-linux/enc/gb18030.so
/home/xxxxx/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/x86_64-linux/enc/trans/gb18030.so
/home/xxxxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/x86_64-linux/enc/gb18030.so
/home/xxxxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/x86_64-linux/enc/trans/gb18030.so
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/.ext/x86_64-linux/enc/gb18030.so
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/.ext/x86_64-linux/enc/trans/gb18030.so
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/enc/gb18030.c
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/enc/gb18030.o
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/enc/trans/gb18030-tbl.rb
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/enc/trans/gb18030.c
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/enc/trans/gb18030.o
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/enc/trans/gb18030.trans
/home/xxxxx/.rvm/src/ruby-1.9.3-p392/test/ruby/enc/test_gb18030.rb
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/.ext/x86_64-linux/enc/gb18030.so
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/.ext/x86_64-linux/enc/trans/gb18030.so
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/enc/gb18030.c
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/enc/gb18030.o
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/enc/trans/gb18030-tbl.rb
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/enc/trans/gb18030.c
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/enc/trans/gb18030.o
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/enc/trans/gb18030.trans
/home/xxxxx/.rvm/src/ruby-2.0.0-p0/test/ruby/enc/test_gb18030.rb
/opt/Adobe/Reader9/Resource/TypeSupport/Unicode/icu/ctb_gb18030.cnv
/opt/Adobe/Reader9/Resource/TypeSupport/Unicode/icu/ctl_gb18030.cnv
/usr/lib/gconv/GB18030.so
/usr/lib64/gconv/GB18030.so
/usr/lib64/python2.6/encodings/gb18030.py
/usr/lib64/python2.6/encodings/gb18030.pyc
/usr/lib64/python2.6/encodings/gb18030.pyo
/usr/share/X11/locale/zh_CN.gb18030
/usr/share/X11/locale/zh_CN.gb18030/Compose
/usr/share/X11/locale/zh_CN.gb18030/XI18N_OBJS
/usr/share/X11/locale/zh_CN.gb18030/XLC_LOCALE
/usr/share/i18n/charmaps/GB18030.gz
According to note-5 outputs, Ruby 1.8.7 uses OS locales.
It seems your OS does not have "gb18030" encoding.
Toshi MARUYAMA wrote:
According to note-5 outputs, Ruby 1.8.7 uses OS locales.
It seems your OS does not have "gb18030" encoding.
Toshi MARUYAMA wrote:
Please contact your system administrator.
It seems your Ruby is broken.
On my CentOS 6.
[...]
Hi Toshi,
Pls checking this:
[~] # irb
irb(main):001:0> require 'iconv'
=> true
irb(main):002:0> ic = Iconv.new("gb18030", "UTF-8")
Iconv::InvalidEncoding: invalid encoding ("gb18030", "UTF-8")
from (irb):2:in `initialize'
from (irb):2:in `new'
from (irb):2
from :0
irb(main):003:0> ic.iconv("中国")
NoMethodError: undefined method `iconv' for nil:NilClass
from (irb):3
from :0
irb(main):004:0>
huang leo wrote:
irb(main):002:0> ic = Iconv.new("gb18030", "UTF-8")
Iconv::InvalidEncoding: invalid encoding ("gb18030", "UTF-8")
Obviously, your OS does not have "gb18030" locale.
Please contact your system administrator.
Toshi MARUYAMA wrote:
huang leo wrote:
irb(main):002:0> ic = Iconv.new("gb18030", "UTF-8")
Iconv::InvalidEncoding: invalid encoding ("gb18030", "UTF-8")
Obviously, your OS does not have "gb18030" locale.
Please contact your system administrator.
Toshi, Thx!
We are using QNAP NAS server as our redmine server, and it's running a customized Linux OS.
Also available in: Atom
PDF