I have a subprocess command that outputs some characters such as \'\\xf1\'. I\'m trying to decode it as utf8 but I get an error.
s = \'\\xf1\' s.decode(\'utf
It's the first byte of a multi-byte sequence in UTF-8, so it's not valid by itself.
In fact, it's the first byte of a 4 byte sequence.
Bits Last code point Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 21 U+1FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
See here for more info.