Python encoding unicode utf-8
问题 I'm using selenium to insert text input with german umlauts in a web formular. The declared coding for the python script is utf-8. The page uses utf-8 encoding. When i definine a string like that everything works fine: q = u"Hällö" #type(q) returns unicode ... textbox.send_keys(q) But when i try to read from a config file using ConfigParser (or another kind of file) i get malformed output in the webformular ( Hällö ). This is the code i use for that: the_encoding = chardet.detect(q)[