cbfeeds icon indicating copy to clipboard operation
cbfeeds copied to clipboard

ascii problems

Open pastechecker opened this issue 7 years ago • 2 comments

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 avatar Oct 03 '18 14:10 pastechecker

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

pastechecker avatar Oct 03 '18 15:10 pastechecker

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

edeca avatar Oct 08 '18 08:10 edeca