10

I have a string containing Arabic charachters "محمود"

When I try to parameterize this string, it returns empty string ""

x = "محمود"
x.parameterize    => ""

I have checked parameterize code and found it calls I18n.transliterate which returns question marks "?????"

I tried to customize transliteration referring to previous question How do you customize transliterations in a Rails 3 app?

But still returning blank string.

Any help?

Community
  • 1
  • 1
Mahmoud Khaled
  • 6,226
  • 6
  • 37
  • 42

1 Answers1

4

The parameterize method is supposed to render the string URL safe, and there's a strict limit on what kind of characters can appear in the URL. Generally anything not strictly a-z or 0-9 or - is stripped.

You could always try and fix it so that multi-byte UTF-8 characters are admitted by default. The current implementation is really quite lacking. Instead of allowing only a small set of specific characters, a more robust version would strip out the troublesome ones.

tadman
  • 208,517
  • 23
  • 234
  • 262