Using python 3.2, I am trying to decode bytes using str(bytes, "cp1251") but I get this error:
Traceback (most recent call last):
File "C:\---\---\---\---.py", line 4, in <module>
writetemp.write(str(f.read(), "cp1251"))
File "C:\Python32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 19-25: character maps to <undefined>
As you can see, I specified "cp1251", but it attempts to use "cp1252.py" to decode instead of "cp1251.py", which causes the error, I think. Same thing occurs if I try "Windows-1251" instead of "cp1251".