Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to convert unicode to the nearest ASCII equivalent? [duplicate]

Tags:

python

unicode

I will give the example from Turkish, for example "şğüı" becomes "sgui"

I'm sure each language has it's own conversion methods, sometimes a character might be converted to multiple ASCII characters, like "alpha"/"phi" etc.

I'm wondering whether there is a library/method that achieves this conversion

like image 338
Kaan Soral Avatar asked Nov 03 '15 17:11

Kaan Soral


People also ask

Can Unicode be converted to ASCII?

World's simplest ascii tool. A simple browser-based utility that converts Unicode characters to ASCII characters. Just paste your Unicode text in the input area and you will instantly get ASCII text in the output area.

What is Unicode equivalent of ASCII A '?

Unicode is a superset of ASCII, and the numbers 0–127 have the same meaning in ASCII as they have in Unicode. For example, the number 65 means "Latin capital 'A'".

Is Unicode and ASCII code are same?

Unicode is the universal character encoding used to process, store and facilitate the interchange of text data in any language while ASCII is used for the representation of text such as symbols, letters, digits, etc.


1 Answers

What you are asking is called transliteration.

Try the Unidecode library.

like image 182
rodrigo Avatar answered Oct 10 '22 12:10

rodrigo