[Bug] String.titlecase failing on UTF-8 with accented chars

M

Manoel Lemos

Anybody knows how to solve that?

Check this:
Guimarães
=> nilGuimarãEs # ------------------> Check the E in capital, this is a bug
=> nil
 
M

Mariusz Pękala

--pvezYHf7grwyp3Bc
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Anybody knows how to solve that?
=20
Check this:
=20
Guimar=E3es
=3D> nil
Guimar=E3Es # ------------------> Check the E in capital, this is a bug
=3D> nil

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 ca=
n try:

puts u.lastname.chars.titlecase

Read: ri ActiveSupport::CoreExtensions::String::Unicode#chars


--=20
No virus found in this outgoing message.
Checked by 'grep -i virus $MESSAGE'
Trust me.

--pvezYHf7grwyp3Bc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7-ecc0.1.6 (GNU/Linux)

iD8DBQFGYCtusnU0scoWZKARAgFBAKDc/p3bh+zCgrWsta5TrmJc0fqavgCeNd9U
pmq2uElwwWzBeguFX/nmbdg=
=MB6Q
-----END PGP SIGNATURE-----

--pvezYHf7grwyp3Bc--
 
D

Daniel DeLorme

Manoel said:
Anybody knows how to solve that?

Check this:

Guimarães
=> nil
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'
GuimarãEs
Guimarães

-Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top