ruby on rails - "englify" string, get rid off special symbols -
i wanted ask question converting string.
i using rails 4.0.4
and in database have values in native language rīga or jēkabpils. wondering if there kind of function or other way convert words english symbols/characters riga or jekabpils.
i wondering because compare them
like:
"jēkabpils".convert == "jekabpils"
i asking purely based on own interest, wondering if possible?
you can this:
require "i18n" i18n.enforce_available_locales = false s = "jēkabpils" puts s puts i18n.transliterate(s)
output:
jēkabpils jekabpils
Comments
Post a Comment