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

Charset problems in Windows 10 #63

Open
ivocarv opened this issue Apr 3, 2020 · 0 comments
Open

Charset problems in Windows 10 #63

ivocarv opened this issue Apr 3, 2020 · 0 comments

Comments

@ivocarv
Copy link

ivocarv commented Apr 3, 2020

When the transform response uses latin chars, canary fails on util.py on this line (marked with a ->):

def message(m, fd=sys.stdout):
"""Write a MaltegoMessage to stdout and exit successfully"""

if sys.platform == 'win32':
    decoding = sys.stdout.encoding if sys.version_info[0] > 2 else 'cp1252'

-> click.echo(MaltegoMessage(message=m).render(fragment=True, encoding='utf-8').decode(decoding), file=fd)
else:
click.echo(MaltegoMessage(message=m).render(encoding='utf-8', fragment=True), file=fd)
exit(0)

Codepage cp1252 doesn't have some chars and sometimes returns "undefined". Adding errors='ignore' makes it work but with the wrong charset.

Example: this string "Ofício 12345", the "í" fails.

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

1 participant