This project is archived and is in readonly mode.

#4680 ✓stale
stanislav

Rails 2.3.7 and Ruby 1.9: invalid byte sequence in US-ASCII

Reported by stanislav | May 24th, 2010 @ 04:21 PM | in 2.3.10

Hello,

I'm using Ruby 1.9.1-243 and after upgrade to Rails 2.3.7 I hit this error:
"invalid byte sequence in US-ASCII"

The problem is that in activesupport-2.3.7/lib/active_support/core_ext/object/blank.rb it is not checked for a valid_encoding in contrast with ActiveSupport-2.3.5 .

So in v2.3.7 we have this method:

def blank?
self !~ /\S/ end

... and it does not work with ruby 1.9

while the same method in v2.3.5 was this:

def blank?
(!self.respond_to(:valid_encoding?) or self.valid_encoding?) ? self !~ /\S/ : self.strip.size == 0 end

... and it worked :)

Any ideas how I can fix this?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages