From: Xavier Noria Date: 2006-04-16T00:08:49+09:00 Subject: Re: [SPAM DETECT] String#downcase for accented letters in UTF-8? On Apr 15, 2006, at 15:08, Gioele Barabucci wrote: > How can I convert to lowercase a string that contains accented > characters > encoded in UTF-8? > String#downcase does not work with accented letters. I hand-coded that: # This library redefines String#tr so that it understands UTF-8. require 'jcode' def normalize_for_sorting(s) return nil if s.nil? norm = s.downcase norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm.tr!('�����', 'aeiou') norm end -- fxn