Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created March 17, 2009 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolasblanco/80605 to your computer and use it in GitHub Desktop.
Save nicolasblanco/80605 to your computer and use it in GitHub Desktop.
>> s.title
=> "Alpеs-de-Haute-Provence"
>> s.title.parameterize
=> #<ActiveSupport::Multibyte::Chars:0x5fabce8 @wrapped_string="alps-de-haute-provence">
>> ActiveSupport::Multibyte::Chars.g_pack(ActiveSupport::Multibyte::Chars.g_unpack(s.title).map { |c| c == [1077] ? [101] : c }).parameterize
=> #<ActiveSupport::Multibyte::Chars:0x5fb14e0 @wrapped_string="alpes-de-haute-provence">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment