From: James Edward Gray II Date: 2006-10-25T02:19:54+09:00 Subject: Re: downcase part of a string On Oct 22, 2006, at 8:16 PM, Wilson Bilkovich wrote: > On 10/22/06, Mike Durham wrote: >> James Edward Gray II wrote: >> > On Oct 22, 2006, at 7:30 AM, ilhamik wrote: >> > >> >> Thanks Peter, it works fine. >> > >> > You missed Tim Bray's RubyConf talk. According to him we >> should, never >> > be using the case changing methods. "Just don't do it!" ;) >> > >> > James Edward Gray II >> > >> Why not? What reason did he give? > > The problem is that proper upcasing and downcasing of characters is > locale-dependent, not just encoding or language-dependent. Yes, this is basically it. Tim Bray feels that case changing is more or less impossible in the practical sense. When you get around to downcasing that string a user entered into your web form a month back, are you going to know if that string was encoded in a Turkish local (critical info if it contains an "i")? Even if it were possible, Tim suggests that it's a performance killer. See Java, which tries to address as many rules as it possibly can, for proof. James Edward Gray II