Bugs: Browse | Submit New | Admin

[#27804] Encoding errors under Ruby 1.9.1 - uri_helper.rb

Date:
2010-02-09 22:54
Priority:
3
Submitted By:
Tim Littlemore (timl)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Encoding errors under Ruby 1.9.1 - uri_helper.rb

Detailed description
I have just been experimenting with a Rails 3 project running under Ruby 1.9.1. I installed feedtools with bundler then
encountered the following errors when trying to run "rake -T" in my project directory:

rake aborted!
/Users/Tim/.bundle/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:44: invalid multibyte char (US-ASCII)
/Users/Tim/.bundle/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:44: invalid multibyte char (US-ASCII)
/Users/Tim/.bundle/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:44: syntax error, unexpected $end, expecting
')'
          if IDN::Idna.toASCII('http://www.詹姆斯.com/') ==
                                             ^

I have been able to fix this by adding a magic comment to the first line of uri_helper.rb with the following contents:

# encoding: UTF-8

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item