0

I have a string like Brazil: Série A my goal is to convert to Brazil: Serie A.

Also, method should convert and other similar situations: é -> e, š -> s, ė -> e , ą -> a ...

Edgaras Karka
  • 7,400
  • 15
  • 61
  • 115
  • 2
    Related https://stackoverflow.com/questions/11815883/convert-non-ascii-characters-umlauts-accents-to-their-closest-ascii-equiva, https://stackoverflow.com/questions/18123501/replacing-accented-characters-with-plain-ascii-ones – Ilja Everilä Jul 02 '17 at 07:21
  • 2
    Possible duplicate of [Replacing accented characters with plain ascii ones](https://stackoverflow.com/questions/18123501/replacing-accented-characters-with-plain-ascii-ones) – try-catch-finally Jul 02 '17 at 07:44

1 Answers1

1

I'm using Slugify (https://github.com/simov/slugify) to do just that. It comes with a predefined set of characters it will replace with plain english ones https://github.com/simov/slugify/blob/master/index.js#L13 and the ability to extend it.

Dominik
  • 6,078
  • 8
  • 37
  • 61