This project is archived and is in readonly mode.
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
-
James Kebinger October 8th, 2008 @ 10:53 PM
- Title changed from crash on server launch `iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) to server crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding)
-
Rob Anderton October 14th, 2008 @ 10:31 AM
- Tag changed from 2.2, encoding, iconv, inflector, invalid to 2.2, bug, encoding, iconv, inflector
I'm getting the same with Edge on Windows XP with Ruby 1.8.6 and iconv 1.9. It doesn't just stop the server from working, anything that uses the framework (e.g. rake tasks) also breaks.
The fix suggested by James works on Windows too.
-
Rob Anderton October 14th, 2008 @ 10:33 AM
- Title changed from server crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) to framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding)
-
Pratik October 14th, 2008 @ 01:43 PM
- Assigned user set to Michael Koziarski
- Milestone cleared.
-
Repository October 14th, 2008 @ 08:25 PM
- State changed from new to resolved
(from [e0993c6c376d62716757a8a7f476ed0c369d0fc7]) Reverse the order of the iconv arguments to remain compatible with older rubies / iconvs.
[#1195 state:resolved] http://github.com/rails/rails/co...
-
Repository December 10th, 2008 @ 07:05 PM
- State changed from resolved to committed
(from [757e4364dc3f808f0002a6c8cb03531e69e2f356]) Fix: counter_cache should decrement on deleting associated records.
[#1195 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
-
Repository December 10th, 2008 @ 07:05 PM
(from [c9e176de78067c5941233b12686276d3016fbb38]) Fix: counter_cache should decrement on deleting associated records.
[#1195 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
-
Repository December 10th, 2008 @ 07:05 PM
(from [05f2183747c8e75c9e8bbaadb9573b4bdf41ecfc]) Fix: counter_cache should decrement on deleting associated records.
[#1195 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
-
explorer-lighthouse-skandragon (at flame) February 3rd, 2009 @ 03:25 PM
- Tag changed from 2.2, bug, encoding, iconv, inflector to 2.2.2, bug, encoding, iconv, inflector
I believe this fix is not complete. On NetBSD, I get this:
irb(main):003:0> Iconv.iconv('ascii//ignore//translit', 'utf-8', 'test') Iconv::InvalidEncoding: invalid encoding ("ascii//ignore//translit", "utf-8")
from (irb):3:in `iconv' from (irb):3 from :0
This is using the built-in libc version of the iconv library, built on a fairly recent NetBSD source tarball.
-
Michael Koziarski February 6th, 2009 @ 12:28 AM
- State changed from committed to open
That changeset has nothing to do with this ticket
-
Repository February 6th, 2009 @ 12:48 AM
- State changed from open to committed
(from [3c006d428b3d3d306185f620cce3821b1bdb636f]) Handle every error that can come out of the Iconv branch by rescuing and returning nil
[#1195 state:committed]
Conflicts:
activesupport/lib/active_support/inflector.rb
-
Repository February 6th, 2009 @ 12:48 AM
(from [4e4f961c112f1ffac73a1397d94dfbb4a10effae]) Handle every error that can come out of the Iconv branch by rescuing and returning nil
[#1195 state:committed] http://github.com/rails/rails/co...
-
David Reese February 6th, 2009 @ 04:12 AM
Commit 3c006d428b3d3d306185f620cce3821b1bdb636f (rails 2.2), rails errors out -- the line should be if, not elseif.
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
Referenced by
- 1195 framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) [#1195 state:resolved] http://github.com/rails/rails/co...
- 1195 framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) [#1195 state:committed]
- 1195 framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) [#1195 state:committed]
- 1195 framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) [#1195 state:committed]
- 1195 framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) [#1195 state:committed]
- 1195 framework crashes on launch 'iconv': invalid encoding ("ascii//translit//IGNORE", "utf-8") (Iconv::InvalidEncoding) [#1195 state:committed] http://github.com/rails/rails/co...