Christophe Porteneuve
2008-Jan-03 08:54 UTC
Iconv translit working in every situation… but the running app!
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 Porteneuve aka TDD
tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Jason Goecke
2008-May-15 02:25 UTC
Re: Iconv translit working in every situation… but the runn
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)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---