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

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 2: ordinal not in range(128)` #81

Closed
georgebrindeiro opened this issue Oct 2, 2018 · 3 comments · Fixed by #110
Assignees
Labels
Milestone

Comments

@georgebrindeiro
Copy link

Hi! Thanks for creating this great tool!

I am currently able to load my Slack Workspace Export, however some channels lead to a 500 Internal Server Error. Investigating the messages output in the terminal, I frequently see messages like:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 2: ordinal not in range(128)

What could that be?

Cheers,
George

@uavpal
Copy link

uavpal commented Oct 29, 2018

same here: UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 7: ordinal not in range(128)

mine seems related to an URL: result = "<a href="{url}">{title}".format(url=url, title=title)

probably similar to ac4eafb
and it's just a missing encoding="utf8" somewhere.

Rgds
SoftIce

@uavpal
Copy link

uavpal commented Oct 30, 2018

I can get around it by adding

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

starting from line 7 in formatter.py.
Probably only required for Python 2.7.

@nylen
Copy link

nylen commented Nov 13, 2018

same error here:

  File "~/.local/venvs/slack-export-viewer/lib/python2.7/site-packages/slackviewer/formatter.py", line 101, in _sub_annotated_mention
    return mention_format.format(annotation)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 1: ordinal not in range(128)

rlazar pushed a commit to rlazar/slack-export-viewer that referenced this issue Jan 4, 2019
@hfaran hfaran added the bug label Jan 6, 2019
@hfaran hfaran self-assigned this Jan 6, 2019
@hfaran hfaran added this to the 0.9.0 milestone Jan 6, 2019
@mikejgray mikejgray mentioned this issue Oct 20, 2019
hfaran pushed a commit that referenced this issue Oct 21, 2019
* Workaround for ASCII encoding error in 2.7 #81

* Added basic parsing and reordering of thread messages #67

* Updating release version per CONTRIBUTE.md

* Allow for no groups

* Changed indentation to get threads in all channels

* Backwards compatibility

* Corrections per hfaran

* Added missing static method

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

Successfully merging a pull request may close this issue.

3 participants