# Iconv translit working in every situationâ€¦ but the running app!

**URL:** <https://www.ruby-forum.com/t/iconv-translit-working-in-every-situationa-but-the-running-app/124868>\
**Category:** Rails\
**Created:** [January 3, 2008, 9:51am UTC](https://www.ruby-forum.com/t/iconv-translit-working-in-every-situationa-but-the-running-app/124868 "2008-01-03T09:51:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/35a633/32.png) [@tdd](https://www.ruby-forum.com/u/tdd)\
**Post date:** [January 3, 2008, 9:51am UTC](https://www.ruby-forum.com/t/iconv-translit-working-in-every-situationa-but-the-running-app/124868/1 "2008-01-03T09:51:40Z")

</div>

Hi all,

I scourged the web, including this ML’s archives, and did not find an  
answer for this.

I have the following code in my Rails app:

require ‘iconv’  
…  
@@converter = Iconv.new(‘ASCII//TRANSLIT’, ‘UTF-8’)  
…  
result = @@converter.iconv(text.to\_s).downcase  
…

Now, the facts:

- Inbound text is indeed valid UTF-8
- Transliteration works fine in the following situations:
  - Same box, irb, my user or the Rails app’s user
  - Same box, ruby interpreter, my user or the Rails app’s user
  - Same box, _ruby script/console production_!!!

And yet, despite running fine in the production-mode Rails console, it  
b0rks within the running Rails app.

I tried dumping the environments in the Rails app and the production  
console, and they’re just identical. No difference in traditional iconv  
factors such as LANG or LC\_xxx variables, for instance.

Perhaps a note of importance: this DOES work on my dev box:

OSX 10.4, libiconv 1.9.1-11 through Fink, ruby 1.8.6, Rails 1.2.6

However, this b0rks on my stage server:

Debian Etch, iconv (libc) 2.3.6, libiconv-ruby 1.8.2, ruby 1.8.5,  
Rails 1.2.6

…and on my production server:

RHEL5, iconv (libc) 2.5, ruby 1.8.6, Rails 1.2.6 (frozen in vendor)

I’m at a loss here! Any idea?

Thanks!

–  
Christophe P. aka TDD  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![tdd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/35a633/32.png) [@tdd](https://www.ruby-forum.com/u/tdd)\
**Post date:** [May 15, 2008, 4:25am UTC](https://www.ruby-forum.com/t/iconv-translit-working-in-every-situationa-but-the-running-app/124868/2 "2008-05-15T04:25:13Z")

</div>

I am having a very similar issue, but Rails just hangs and I have to  
kill -9 mongrel. My line is doing this:

Iconv.conv(“utf-8”, “ISO-8859-1”, input\_line)
