Closed ollym closed 10 years ago
Wow long time anyone fixed anything in postscript level, thank you for doing that. Can you please test with external encoding option for this change? Just put
RGhost::Config::GS[:external_encoding]= 'ascii-8bit'
Before your document creation. If it work correctly I will create a new gem version.
sure I'll give it a go. I'm a bit worried about how this will turn out on Ruby < 1.8 (if you still support that?) but I'll give it a go.
I obviously need to write some tests too, so this is very much still a WIP
We won't support Ruby 1.8 anymore. The coming releases are based on > 1.9.3.
@shairontoledo I can confirm this works with RGhost::Config::GS[:external_encoding]= 'ascii-8bit'
@ollym I had to update ruby_to_ps with encoding utf-8 header. I created a method to print the current UTF-8 mapping:
RGhost::Config.utf8_encodings.render :pdf, :filename => "/tmp/encoding_map.pdf"
It generates http://d.pr/i/TKkh
New version has been created 0.9.4
https://rubygems.org/gems/rghost/versions/0.9.4
Thank you for the collaboration.
Looks good. You'll also need to use something like:
RGhost::Config::GS[:font_encoding] = 'UTF-8'
RGhost::Config::GS[:charset_convert] = -> (text) {
text.encode(RGhost::Config::GS[:font_encoding], invalid: :replace, undef: :replace, replace: '?')
}
Fixes a number of unicode encoding issues. Table found here: http://www.w3.org/2001/06/utf-8-test/postscript-utf-8.html