Feb-21-2020, 12:00 PM
Help collect a string for correct conversion:
It works correctly:
П
And so not right.
\xcf
How is it right to do that?
It works correctly:
a = '\xcf'
t = a.encode("latin-1").decode("cp1251")
print (t):~/Python/5$ ./test1.pyП
And so not right.
b = r'\x' + 'cf'
t = b.encode("latin-1").decode("cp1251")
print (t):~/Python/5$ ./test1.py\xcf
How is it right to do that?
