I have a problem with converting uppercase letters with umlauts to lower case.
print("ÄÖÜAOU".lower())
A, O and U are converted correctly, but Ä, Ö and Ü remain in uppercase. Any ideas?
The first problem is fixed with .decode ('utf-8'), but I still have the second:
# -*- coding: utf-8 -*- original_message="ÄÜ".decode('utf-8') original_message=original_message.lower() original_message=original_message.replace("ä", "x") print(original_message)
Traceback (last last call): File "Untitled.py", line 4, in original_message = original_message.replace ("ä", "x") UnicodeDecodeError: codec 'ascii' cannot decode byte 0xc3 at position 0: serial number not in the range (128)
source share