X
Xavier Noria
According to the current manual PDF documents generated by =20
PDF::Writer can use UTF-16BE, but after a few trials with iconv I =20
can't get my UTF-8 strings right. Example:
$KCODE =3D 'u'
require 'rubygems'
require 'pdf/writer'
require 'iconv'
str =3D Iconv.iconv('UTF-16BE', 'UTF-8', '=E1 =DF =80')
pdf =3D PDF::Writer.new
# renders =E1 and =DF right, but not =80
pdf.text str
# same output with garbage prepended
pdf.text "\xfe\xff#{str}"
pdf.save_as('unicode_test.pdf')
The manual does not document if any encoding is needed for =20
select_font, I've played around with variations of
# gives complete garbage
pdf.select_font 'Times-Roman', :encoding =3D> 'UTF-16BE'
without luck.
TextMate is generating UTF-8 source files for sure. Any ideas?
-- fxn
PDF::Writer can use UTF-16BE, but after a few trials with iconv I =20
can't get my UTF-8 strings right. Example:
$KCODE =3D 'u'
require 'rubygems'
require 'pdf/writer'
require 'iconv'
str =3D Iconv.iconv('UTF-16BE', 'UTF-8', '=E1 =DF =80')
pdf =3D PDF::Writer.new
# renders =E1 and =DF right, but not =80
pdf.text str
# same output with garbage prepended
pdf.text "\xfe\xff#{str}"
pdf.save_as('unicode_test.pdf')
The manual does not document if any encoding is needed for =20
select_font, I've played around with variations of
# gives complete garbage
pdf.select_font 'Times-Roman', :encoding =3D> 'UTF-16BE'
without luck.
TextMate is generating UTF-8 source files for sure. Any ideas?
-- fxn