We desired to convert a unicode string in Slovak language into plain ASCII (without accents/carons) That's to complete: č->c š->s á->a é->e etc.

We attempted:

cstr = Iconv.conv('us-ascii//translit', 'utf-8', a_unicode_string)

It had been focusing on one system (Mac) and wasn't focusing on another (Ubuntu) where it had been giving '?' for highlighted figures after conversion.

Problem: iconv was using LANG/LC_ALL variables. I don't know why, once the encodings are known, but well... You needed to set the locale variables to something.utf8, for instance: sk_SK.utf8 or en_GB.utf8

Next thing was to try and set ENV['LANG'] and ENV['LC_ALL'] in config/application.rb. It was overlooked by Iconv in ruby.

Another try ended up being to use global system establishing /etc/default/locale - this labored in command line, although not for Rails application. Reason: apache features its own atmosphere. And so the final solution ended up being to add LANG/LC_ALL variables into /etc/apache2/envvars:

export LC_ALL="en_GB.utf8"
export LANG="en_GB.utf8"
export LANGUAGE="en_GB.utf8"

Restarted apache also it labored.

This really is more just a little how-to than the usual question. However, if a person has better solution I must learn about it.

You can test unaccent approach rather.