shairontoledo / rghost

RGhost is a document creation and conversion API. It uses the Ghostscript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents. Support(PDF,PS,GIF,TIF,PNG,JPG,etc)
http://rghost.rubyforge.org
MIT License
187 stars 46 forks source link

UTF-8 characters not showing correctly #33

Closed nurettin closed 11 years ago

nurettin commented 11 years ago

Using JRuby 1.7.2 (1.9.3 compatibility)

#encoding: UTF-8 
require 'rghost'
require 'rghost_barcode'
require 'iconv'
RGhost::Config::GS[:path]= "/usr/bin/gs"
RGhost::Config::GS[:charset_convert]= nil
wtf= "İ"
p "#{wtf} encoding: #{wtf.encoding}"
RGhost::Document.new do |doc|
  doc.show wtf
  File.write("test.ps", doc.render_stream(:ps))
end

This shows wtf

But I want it to show İ

I tried:

What can I do to show UTF-8 characters in rghost ?

nurettin commented 11 years ago

Same thing happens with

doc.render :ps, filename: "test.ps"
shairontoledo commented 11 years ago

Have you ever tried encode_test to figure out what is the properly encoding for you?