TarkaLabs TIL
Published in

TarkaLabs TIL

Removing Accented (Diacritic) Characters From Strings in Rails

If you have a huge list of text records with accented characters and want to get rid of the accented (diacritic) characters because you want to keep the data ASCII-only, Rails offers a simple method to get rid of accented characters without having to go through the pain of writing complex Regex matchers.

As per the official documentation, the `transliterate` method replaces non-ASCII characters with an ASCII approximation.

--

--

Tarka Labs is a team of passionate hackers, designers and product managers. We believe in experimental methods to identify the best solutions to problems instead of working on technology du jour. (https://tarkalabs.com/)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sreedev Kodichath

Senior Software Engineer @ Tarka Labs. Ruby, Elixir, Javascript C & Rust. Amateur Radio Operator — KD2ZWB/VU2JWE. www.sree.dev. Brooklyn, NYC.