This project is archived and is in readonly mode.

#4323 ✓resolved
Kristopher Murata

Parameterize should accept malformated utf8 strings

Reported by Kristopher Murata | April 4th, 2010 @ 07:02 AM | in 2.3.6

When using parameterize I ended up with the following errors:

NoMethodError: undefined method normalize' for "Fort\351":String

This occurred because user data (user name, city name...) sometimes were inserted with malformated characters (something like "Now \251") and parameterize was not able to transform that string into a slug. I assume that parameterize should transform any string into a nice slug, even if it ends up removing characters or generating a slightly different slug from the original string.
So what I did is first verify if the string is a valid utf8, if not it should force the convert to utf8 (with losses if necessary) and then translate to ascii equivalents using Inflector:transliterate.

This should solve this bug too #3504.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages