The decompiler output can legitimately contain Unicode (e.g. Unicode strings). Currently, the script will crash with an error like this:
Traceback (most recent call last):
File "ghidra2dwarf.py", line 512, in <module>
write_source()
File "ghidra2dwarf.py", line 343, in write_source
src.write("\n".join(decomp_lines))
UnicodeEncodeError: 'ascii' codec can't encode character u'\uefbe' in position 14630: ordinal not in range(128)
This fix makes the output UTF-8, which solves this issue for all valid Unicode characters.
The decompiler output can legitimately contain Unicode (e.g. Unicode strings). Currently, the script will crash with an error like this:
This fix makes the output UTF-8, which solves this issue for all valid Unicode characters.