Anybody knows how to solve that?
Check this:
u.lastname
=> "Guimar\303\243es"
puts u.lastname
Guimarães
=> nil
u.lastname.titlecase
=> "Guimar\303\243Es"
puts u.lastname.titlecase
GuimarãEs # ------------------> Check the E in capital, this is a bug
=> nil
···
--
Posted via http://www.ruby-forum.com/.
Titlecase is a Rails-ism (and the usual policy here is that Rails
questions should go to Rails lists or #rubyonrails IRC channel), but you can try:
puts u.lastname.chars.titlecase
Read: ri ActiveSupport::CoreExtensions::String::Unicode#chars
···
On 2007-06-01 22:19:23 +0900 (Fri, Jun), Manoel Lemos wrote:
Anybody knows how to solve that?
Check this:
>> u.lastname
=> "Guimar\303\243es"
>> puts u.lastname
Guimarães
=> nil
>> u.lastname.titlecase
=> "Guimar\303\243Es"
>> puts u.lastname.titlecase
GuimarãEs # ------------------> Check the E in capital, this is a bug
=> nil
--
No virus found in this outgoing message.
Checked by 'grep -i virus $MESSAGE'
Trust me.
Manoel Lemos wrote:
Anybody knows how to solve that?
Check this:
u.lastname
=> "Guimar\303\243es"
puts u.lastname
Guimarães
=> nil
u.lastname.titlecase
=> "Guimar\303\243Es"
puts u.lastname.titlecase
GuimarãEs # ------------------> Check the E in capital, this is a bug
=> nil
If you're going to use utf-8 you need at least to set $KCODE='u'
>> $KCODE='n'
>> puts "Guimar\303\243es".titlecase
GuimarãEs
>> $KCODE='u'
>> puts "Guimar\303\243es".titlecase
Guimarães
-Daniel