Mihnea Giurgea
Mihnea Giurgea

Reputation: 447

Convert Unicode to double ASCII letters in Python (ß -> ss)

Some Unicode characters can also be written as two ASCII letters (e.g.: ß -> ss, å -> aa). Is there any way to convert these in Python, without having a list with all of them?

LATER EDIT:

This kind of conversion is done by a lof of websites, including Stackoverflow (url from this page was converted), and Twitter. I'm curious how they do it.

Upvotes: 5

Views: 1770

Answers (1)

jfs
jfs

Reputation: 414685

There are no universal rules.

You could try unidecode module to transliterate Unicode text to ASCII.

Upvotes: 7

Related Questions