I am trying to extract a line from neofetch
with regex , which works but it also outputs some garbled mess:
['OS:\x1b[0m Raspbian 10 buster\x1b[0m']
Now I was wondering if you could convert that to plain ASCII. I know it isn't possible directly, but maybe there is a library or something that leaves out the non-convertible things?
I tried:
output = output.read().decode('ascii')
As expected it returns:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 611: ordinal not in range(128)