MISP / MISP-STIX-Converter

A utility repo to assist with converting between MISP and STIX formats
GNU Lesser General Public License v3.0
64 stars 31 forks source link

UnicodeDecodeError: 'ascii' codec can't decode #35

Closed alecisec closed 5 years ago

alecisec commented 5 years ago

When running stix-to-misp.py with any standard STIX file (e.g. https://www.us-cert.gov/sites/default/files/publications/MAR-10219351.r1.v2.stix.xml) I get errors like

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 15269: ordinal not in range(128)

I've tried a few edits on the .py file to force utf-8 encoding but without any success, This still occurs calling the script with python3 as well (which should encode str as utf-8 afaik)

If i'm to pull down a misp event using misp-to-stix.py the default file output is ascii encoded and this will work perfectly with stix-to-misp.py

I suppose I could convert the .xml to ascii before calling stix-to-misp.py but that's suboptimal, surprising no one else has run into this issue.

FloatingGhost commented 5 years ago

UTF-8 is standard on all python .encode() and .decode()

I do not specify ascii at any point.

Your terminal likely does not support utf8

Not a bug.