Forum: Ruby portability of iconv's //TRANSLIT ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2007-03-13 15:26
(Received via mailing list)
I was using a field normalizer (for URLs, sorting, etc) that has

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

as a starting point. Accented characters such as "á" are "decomposed"
in my Mac, but the production machine is a Linux and they are ignored
there, so "á" becomes the empty string instead of "'a".

In the Mac we have "iconv (GNU libiconv 1.9)", in that linux we have
"iconv (GNU libc) 2.3.2". Since the current release of GNU iconv is
1.11, I guess those are different libraries with different
transliteration tables. Is that right?

I have written a transliteration table as a chain of gsubs as a
workaround, but that approach was so good! Can anyone explain what is
actually happening and confirm whether that //TRANSLIT trick is non-
portable and thus better avoided?

-- fxn
This topic is locked and can not be replied to.