I have a list of strings that I will be working in PYTHON happens that some strings contain special characters: üäö and so on.
I have 2 solutions:
- Treating the acquired data after by replacing the substring in the list of strings.
Decoding what is acquired in the list in python.
lista_names_d = [ 'L\xc3\xbcneburg Bockelsberg 2', 'L\xc3\xbcneburg Bockelsberg 1', 'L\xc3\xbcneburg Bockelsberg 3','L\xc3\xbcneburg Bockelsberg 5' ]
I tried this
lista_names_d = [name.replace('\xc3\xbc', 'ü') for name in lista_names_d]
This does nothing
I tried this
your_unicode_string = "L\xc3\xbcneburg Kaltenmoor BHKW 1"
correct_unicode_string = your_unicode_string.encode('latin1').decode('utf8')
error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Any help is highly appreciate