Skip to content

Instantly share code, notes, and snippets.

@thenaturalist
thenaturalist / replace_umlaute.py
Created July 5, 2016 14:02 — forked from frruit/replace_umlaute.py
Small example hot to convert german special characters from unicode to utf-8 and back to unicode
# Small example hot to convert german special characters from unicode to utf-8 and back to unicode
# http://www.utf8-zeichentabelle.de/unicode-utf8-table.pl?start=128&number=128&names=-&utf8=string-literal
#
umlaute_dict = {
'\xc3\xa4': 'ae', # U+00E4 \xc3\xa4
'\xc3\xb6': 'oe', # U+00F6 \xc3\xb6
'\xc3\xbc': 'ue', # U+00FC \xc3\xbc
'\xc3\x84': 'Ae', # U+00C4 \xc3\x84
'\xc3\x96': 'Oe', # U+00D6 \xc3\x96