carbonblack / cbfeeds

Carbon Black Feeds
Other
70 stars 31 forks source link

ascii problems #18

Open pastechecker opened 6 years ago

pastechecker commented 6 years ago

Hello. I was attempting to create DNS feed using the data from the webstite: http://cybercrime-tracker.net/all.php

Traceback (most recent call last): File "/scripts/validate_feed.py", line 141, in print e UnicodeEncodeError: 'ascii' codec can't encode characters in position 23-29: ordinal not in range(128)

How can I fix that?

pastechecker commented 6 years ago

I was able to find a line that is causing it:

On the beginning of the file I had to add:

cat validate_feed.py

encoding=utf8

import sys import json import optparse reload(sys) sys.setdefaultencoding('utf8')

-> Validated that file exists and is readable -> Validated that feed file is valid JSON -> Unable to validate that the file is a valid CB feed -> Details:

Malformed domain name (шляхтен.рф) in IOC list for report LAtKOmYBqOyRFMJBDaZe

edeca commented 6 years ago

Encode your domain in punycode. If that's a valid domain name, then xn--e1alhsoq4c.xn--p1ai is the correct encoding.