Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#4680

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?

Reported by stanislav · May 24th, 2010 @ 04:21 PM

State: stale
Milestone: 2.3.10
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: Low

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 2.3.8
    • State changed from new to open
    • Assigned user set to Yehuda Katz (wycats)

    Fix is forthcoming.

    May 24th, 2010 @ 07:15 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.8 to 2.3.9

    May 25th, 2010 @ 11:45 PM

  3. Harm Aarts
    Harm Aarts

    I believe I have a related error in actionpack-2.3.8/lib/action_view/template_handlers/erb.rb. Line 14 uses a regex which dies when the encoding is not checked.

    Error occurs with Rails 2.3.8 and Ruby 1.9.1p378. Perhaps the more relevant question is how the encoding got messed up in the first place.

    June 15th, 2010 @ 06:11 PM

  4. Harm Aarts
    Harm Aarts

    It appears that all regexes are affected, I get this error too when sending email:
    /gems/actionmailer-2.3.8/lib/action_mailer/utils.rb, line 4

    June 17th, 2010 @ 01:50 PM

  5. Harm Aarts
    Harm Aarts

    FYI I think the upgrade from TMail 1.2.3 to 1.2.7 is responsible for the last error. The to_s method in Tmail (encoding.rb) looks iffy.

    June 17th, 2010 @ 02:43 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.9 to 2.3.10
    • Importance changed from to Low

    August 30th, 2010 @ 02:28 AM

  7. Santiago Pastorino
    Santiago Pastorino
    • Tag changed from rails 2.3.7, ruby 1.9, bug, encodings to rails 237, ruby 19, bug, encodings

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:49 PM

  8. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:49 PM

  9. bingbing