This project is archived and is in readonly mode.

#1325 ✓committed
Akira Matsuda

Ruby 1.9 compat: script encoding should be explicitly defined by magic comment

Reported by Akira Matsuda | November 4th, 2008 @ 09:49 AM | in 2.x

Since Ruby 1.9, script encoding should be explicitly defined by magic comment when the script source includes multibyte characters. Otherwise, the script will be parsed as a US-ASCII file.

see http://redmine.ruby-lang.org/wik...

This patch fixes failure in rails command.

Comments and changes to this ticket

  • Akira Matsuda

    Akira Matsuda December 2nd, 2008 @ 04:39 PM

    Ruby 1.9.1 preview 2 + Edge Rails still fails in "rails" command with the following error, and this patch is still effective to fix the problem. Any reason to put off the commit?

    
    % ruby19 ~/src/rails/railties/bin/rails test_app
    $RAILS_DIR/activesupport/lib/active_support/core_ext/integer/inflections.rb:1:in `require':
    $RAILS_DIR/activesupport/lib/active_support/inflector.rb:286: invalid multibyte char (US-ASCII) (SyntaxError)
    $RAILS_DIR/activesupport/lib/active_support/inflector.rb:286: invalid multibyte char (US-ASCII)
    $RAILS_DIR/activesupport/lib/active_support/inflector.rb:286: syntax error, unexpected $end, expecting ')'
        elsif "foo" != Inflector.transliterate("föö")
                                                   ^
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext/integer/inflections.rb:1:in `<top (required)>'
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext/integer.rb:2:in `require'
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext/integer.rb:2:in `<top (required)>'
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext.rb:3:in `require'
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext.rb:3:in `block in <top (required)>'
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext.rb:1:in `each'
    	from $RAILS_DIR/activesupport/lib/active_support/core_ext.rb:1:in `<top (required)>'
    	from $RAILS_DIR/activesupport/lib/active_support.rb:55:in `require'
    	from $RAILS_DIR/activesupport/lib/active_support.rb:55:in `<top (required)>'
    	from $RAILS_DIR/railties/lib/rails_generator.rb:28:in `require'
    	from $RAILS_DIR/railties/lib/rails_generator.rb:28:in `<top (required)>'
    	from $RAILS_DIR/railties/bin/rails:13:in `require'
    	from $RAILS_DIR/railties/bin/rails:13:in `<main>'
    
  • Jeremy Kemper

    Jeremy Kemper December 3rd, 2008 @ 04:04 PM

    • State changed from “new” to “committed”

    It was committed on November 7: b5291ed0f1e956cc98e1bfc8e50ee9fb4f6a661b

  • Ryan Bigg

    Ryan Bigg October 9th, 2010 @ 10:02 PM

    • Tag cleared.

    Automatic cleanup of spam.

  • Ryan Bigg

    Ryan Bigg October 21st, 2010 @ 03:36 AM

    Automatic cleanup of spam.

  • Jeff Kreeftmeijer
  • bingbing

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>

People watching this ticket

Attachments

Pages