0

maybe I'm facing a rather simple problem, but it's causing me some problems at the moment.

I have a text file, which contains umlauts (UTF-8). Now I need a function (Python 3) which reads in the file and replaces the umlauts accordingly. Means, and Ä becomes AE, an ö becomes oe and so on.

Acutally I would read in the files like this:

questions = open('Questions.txt', 'r')
content = questions.read()
content_list = content.split('\n')
for element in content_list:
   print(element) #Here I would require the function for my elements

Unfortunately, I'm very new to encoding and decoding and can't find a good overview at the moment.

I am helpful about every tip and recommendation for this topic!

Thanks a lot!

  • Does this answer your question? [Replacing instances of a character in a string](https://stackoverflow.com/questions/12723751/replacing-instances-of-a-character-in-a-string) – mkrieger1 Apr 16 '20 at 23:30
  • Does this answer your question? [Python - Transliterate German Umlauts to Diacritic](https://stackoverflow.com/questions/33281430/python-transliterate-german-umlauts-to-diacritic) – JosefZ Feb 01 '21 at 16:24

0 Answers0