Closed Harding-Stardust closed 1 year ago
might be fixed by using a bytes literal, like: b"".decode("UTF-8").encode("mbcs")
(note leading "b").
Unfortunately not. The first decode "".decode("UTF-8") will return a str and that will in turn fail on the .encode("mbcs")
in Python3 the str class has a method .encode(...)
that returns the string as bytes using the specified encoding. So, I think this would work:
bytes.decode(encoding: str) -> str
str.encode(encoding: str) -> bytes
You are correct, I read it as 2 decodes in a row. My bad!
Good catch, thank you! (will handle this soon)
@aundro , this should have been fixed by now? want to close the issue?
Indeed. Thank you for the heads-up.
https://github.com/idapython/src/blob/d34bb4b45a4b862d9af992e30220e9c344834ce3/pywraps/py_idaapi.py#LL407C10-L407C10
There are some .decode() that will fail on Python 3.