Python 3 Decode string staße

how can I decode a string containing things like this:

staße

to

staße

using python.

(EDIT: Interpreting the source as html objects does not produce the desired result, but "staÃe")

Reference Information. I'm trying my best to work with amazon mws response chains using the mws client that you get when you run it pip install mws. Particularly interesting, because the sourcestring looks like it contains 2 special characters, but the target is just "ß".

In the documents they talk about the meaning of the Unicode character, I did not understand

+4
source share
1 answer

, , ß UTF-8 : C3 9F hex 195 159 . , HTML, Unicode code points 195 159, 195 - Ã. , , str bytes, bytes (Unicode) str. :

print('\xc3\x9f')

print(bytes('\xc3\x9f', 'Latin-1').decode())
+3

Source: https://habr.com/ru/post/1685592/


All Articles