Paul Battley wrote:
> On 27/06/06, Alex Young <alex / blackkettle.org> 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 above
> position 127, which includes all the now-separated accents.
> 
> This does require the slightly-flaky unicode library (work is underway
> to update it). You can get that from http://www.yoshidam.net/Ruby.html
> or via gems.
Hah!  That's fantastic :-)

I love the smell of Ruby in the morning.

-- 
Alex