I want to convert characters like ë
to just plain e
. I am looking to convert with regards to language and how people type cities. For example, most people actually type Brasilia when searching for it, instead of Brasília. And when news agencies like Rueters report on Brasília, they usually spell it Brasilia. So again, just looking for any gem (or character encoding math/method is probably better since that answer can be used, for reference, in other languages).
This is just to handle the typical "extended ASCII" character sets. Note: I am working with standard Unicode strings.
You may be looking for I18n#transliterate
.
Gem is here, install with gem install i18n
.
Example:
irb(main):001:0> require 'i18n'
=> true
irb(main):002:0> I18n.enforce_available_locales = false
=> false
irb(main):003:0> I18n.transliterate("ë,à,é,ä")
=> "e,a,e,a"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With