Commit bf80b6c3ba51173655be6e175dc1f26a90eb60fd
1 parent
07326839
fixed bug in json2ascii (was producing too much output due to wrong test)
Showing
1 changed file
with
2 additions
and
1 deletions
oletools/olevba.py
| ... | ... | @@ -1780,8 +1780,9 @@ def json2ascii(json_obj, encoding='utf8', errors='replace'): |
| 1780 | 1780 | elif isinstance(json_obj, (bool, int, float)): |
| 1781 | 1781 | pass |
| 1782 | 1782 | elif isinstance(json_obj, str): |
| 1783 | + # de-code and re-encode | |
| 1783 | 1784 | dencoded = json_obj.decode(encoding, errors).encode(encoding, errors) |
| 1784 | - if dencoded != str: | |
| 1785 | + if dencoded != json_obj: | |
| 1785 | 1786 | log.info('json2ascii: replaced: {0} (len {1})' |
| 1786 | 1787 | .format(json_obj, len(json_obj))) |
| 1787 | 1788 | log.info('json2ascii: with: {0} (len {1})' | ... | ... |