ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Encoding error on Ruby 1.9 in pdf exports (Bug #437)


Added by Holger Just at 2011-05-30 07:50 pm. Updated at 2011-06-03 03:29 pm.


Status:Closed Start date:2011-05-30
Priority:Normal Due date:
Assignee:Eric Davis % Done:

0%

Category:-
Target version:2.0.0
Remote issue URL: Affected version:unstable

Description

http://ci.chiliproject.org/job/chiliproject_unstable/DATABASE=mysql,RUBY=ruby-1.9.2-p180/51/console

Line 144 in lib/redmine/export/pdf.rb contains invalid UTF-8 characters which break compatibility on Ruby 1.9.


Associated revisions

Revision 821d9f5c
Added by Eric Davis at 2011-05-30 11:20 pm

[#437] Move the encoding to the top of pdf.rb for Ruby 1.9

Revision f0987c82
Added by Eric Davis at 2011-05-31 12:11 am

[#437] Move the encoding to the top of pdf.rb for Ruby 1.9

History

Updated by Eric Davis at 2011-05-30 09:01 pm

The file might need to have it's encoding declared. I can't test it though because my 1.9.2 isn't working with bundler (linecache error).

Updated by Eric Davis at 2011-05-30 09:21 pm

I might have fixed this just using 1.9.2's syntax checker. Will wait for the CI to close. 821d9f5

  • Assignee set to Eric Davis
  • Status changed from Open to Needs more information

Updated by Eric Davis at 2011-06-02 05:07 am

Confirmed fixed in CI

  • Status changed from Needs more information to Closed

Updated by Toshi MARUYAMA at 2011-06-02 05:54 am

There is no test for this issue.
We fixed on redmine after revision 5300 which chili has not yet imported.

  • Status changed from Closed to Open

Updated by Toshi MARUYAMA at 2011-06-03 12:04 am

$ irb
ruby-1.9.2-p136 :001 > txt = "Felix Schäfer" 
 => "Felix Schäfer" 
ruby-1.9.2-p136 :002 > txt.force_encoding("ASCII-8BIT")
 => "Felix Sch\xC3\xA4fer" 
ruby-1.9.2-p136 :003 > txt = txt.gsub(/[“�]/, '"') if txt
Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
    from (irb):3:in `gsub'
    from (irb):3
    from /home/xxxxx/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>'
ruby-1.9.2-p136 :004 > txt.force_encoding("UTF-8")
 => "Felix Schäfer" 
ruby-1.9.2-p136 :005 > txt = txt.gsub(/[“�]/, '"') if txt
 => "Felix Schäfer" 

Updated by Toshi MARUYAMA at 2011-06-03 01:00 am

Toshi MARUYAMA wrote:

There is no test for this issue.
We fixed on redmine after revision 5300 which chili has not yet imported.

http://www.redmine.org/projects/redmine/repository/changes/trunk/test/unit/lib/redmine/export/pdf_test.rb?rev=5998

Updated by Eric Davis at 2011-06-03 03:29 pm

Toshi MARUYAMA:

This issue is not about a test failure, it was for a test error that was fixed in my commits.

  • Status changed from Open to Closed

Also available in: Atom PDF