Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ascii problems #18

Open
pastechecker opened this issue Oct 3, 2018 · 2 comments
Open

ascii problems #18

pastechecker opened this issue Oct 3, 2018 · 2 comments

Comments

@pastechecker
Copy link

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
Copy link
Author

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
Copy link

edeca commented Oct 8, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants