Re: [Rails] Re: upcase special chars (åäöü...)?

Rimantas Liubertas rimantas at gmail.com
Wed Apr 19 11:42:31 GMT 2006


> Ok, this is what I have come up with so far... pretty ugly, but it
> works.
>
> def myupcase(stringtoupper)
>stringtoupper.upcase.gsub('å','Å').gsub('ä','Ä').gsub('ö','Ö').gsub('ü','Ü').gsub('ñ','Ñ').gsub('ï','Ï')
> end

How about:

stringtoupper.upcase.tr('åäöüñï','ÅÄÖÜÑÏ')


Regards,
Rimantas
--
http://rimantas.com/


More information about the Rails mailing list