From: Paul Battley Date: 2006-06-27T17:39:22+09:00 Subject: Re: Iconv and incompatible encodings On 27/06/06, Alex Young wrote:> Ooh, that's nice. Thanks for that. I guess it's wishful thinking to> hope for:>> puts ic_ignore.iconv(s) # => caffe Your wish is granted: #!/usr/bin/env rubby$KCODE = 'u'require 'unicode' s = 'caff竪' puts Unicode.normalize_KD(s).gsub(/[^\x00-\x7F]/n,'') # => caffe It works by decomposing characters and rejecting everything aboveposition 127, which includes all the now-separated accents. This does require the slightly-flaky unicode library (work is underwayto update it). You can get that from http://www.yoshidam.net/Ruby.htmlor via gems. Paul.