idapython/src

Python3 str does not have .decode(), this will cause the idaapi.has_mbcs to always be False

Harding-Stardust opened this issue · 7 comments

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:
image

bytes.decode(encoding: str) -> str
str.encode(encoding: str) -> bytes

You are correct, I read it as 2 decodes in a row. My bad!

aundro commented

Good catch, thank you! (will handle this soon)

0xeb commented

@aundro , this should have been fixed by now? want to close the issue?

aundro commented

Indeed. Thank you for the heads-up.