[MacRuby] #823: ActiveSupport 3 RC1 Not working
MacRuby
ruby-noreply at macosforge.org
Sat Dec 4 12:25:45 PST 2010
#823: ActiveSupport 3 RC1 Not working
-------------------------------+--------------------------------------------
Reporter: maccman@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords: #reduction
-------------------------------+--------------------------------------------
Changes (by mattaimonetti@…):
* keywords: => #reduction
Comment:
Watson is right, this is an encoding issue.
Here is a slightly better reduction of the ActiveSupport problem:
{{{
$ sudo macgem install activesupport
$ macirb -rrubygems --simple-prompt
>> require "active_support/core_ext/uri"
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and
ASCII-8BIT
}}}
Here is the file in question:
http://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/uri.rb
Now the real problem can be reduced like that:
{{{
require 'uri'
str = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" # Ni-ho-nn-go in UTF-8,
means Japanese.
puts str.encoding
parser = URI::Parser.new
puts parser.escape(str).encoding
str == parser.unescape(parser.escape(str))
}}}
The output will look like that:
{{{
UTF-8
US-ASCII
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and
ASCII-8BIT
}}}
The same file executed under 1.9.2 will return the following:
{{{
ASCII-8BIT
US-ASCII
=> true
}}}
But if you add the magic encoding comment in 1.9.2:
{{{
UTF-8
US-ASCII
=> true
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/823#comment:2>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list