I have one (non-python) script that encodes a string a certain way, and I need a python script to use the same method of encoding.
The original string is Hügelkultur and the original script converts that to Hügelkultur.
Right now my python script isn't doing any type of encoding and the output file shows Hügelkultur.
If I run this script:
string = "Hügelkultur"
string = string.encode()
print(string)
It outputs H\xc3\xbcgelkultur.
How would I want to encode the string to give me one that matches the original?
ü, for example, could beüorü. Whether you need an entity depends on the encoding of your file; as long as you can produce a UTF-8 encoded file, you can simply specifyüas the bytes\xc3\xbcdirectly instead of an entity.