Unfortunately, the Unicode 0.1 (sudo gem install unicode
) doesn't work on Ruby 1.9. I have the following snippet:
require "rubygems"
require "unicode"
str = "áéíóúç"
Unicode.normalize_KD(str).gsub(/[^\x00-\x7F]/n, "")
#=> aeiouc
I use it to convert titles to permalink, without removing accented characters.
Is there a way of converting such texts using pack
or unpack
methods?