This project is archived and is in readonly mode.

#1195 ✓committed
James Kebinger

framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding)

Reported by James Kebinger | October 8th, 2008 @ 10:52 PM

After moving to edge rails on a OS X 10.4 machine, script/server throws the error iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) on launch.

The function in question reads as follows:

# Replaces accented characters with their ascii equivalents.
def transliterate(string)
  Iconv.iconv('ascii//translit//IGNORE', 'utf-8', string).to_s
end

The problem is resolved by switching the order of the arguments like this:

Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s

That format starts on both Tiger and Leopard, whereas the current syntax in edge rails only starts on Leopard.

The ruby version on the machine that fails is 1.8.6 (2008-08-11 patchlevel 287). The IConv class passes through to an external library though, so the version of that is probably at issue

The stack dump is as follows: /Users/Cris/Documents/Aptana Studio/insights/vendor/rails/activesupport/lib/active_support/inflector.rb:276:in iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding)

    from /Users/Cris/Documents/Aptana Studio/insights/vendor/rails/activesupport/lib/active_support/inflector.rb:276:in `transliterate'
    from /Users/Cris/Documents/Aptana Studio/insights/vendor/rails/activesupport/lib/active_support/inflector.rb:281
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from /Users/Cris/Documents/Aptana Studio/insights/vendor/rails/activesupport/lib/active_support.rb:26
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from /Users/Cris/Documents/Aptana Studio/insights/vendor/rails/railties/lib/commands/server.rb:1
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from script/server:3

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>