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

imapcli list UnicodeEncodeError #14

Closed
mndrix opened this issue Jan 14, 2017 · 2 comments
Closed

imapcli list UnicodeEncodeError #14

mndrix opened this issue Jan 14, 2017 · 2 comments

Comments

@mndrix
Copy link

mndrix commented Jan 14, 2017

I run imapcli list inbox and see 14 messages as expected. I run imapcli list inbox --format="{uid:7} {subject}" and see 8 messages then this error:

Traceback (most recent call last):
  File "/usr/local/bin/imap-cli-list", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/imap_cli/list_mail.py", line 78, in main
    display_conf['format_list'].format(**mail_info))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 10: ordinal not in range(128)

The offending message has the following subject:

A special “Thank you” from families you blessed last year

Do I need to do something special to format subjects with Unicode?

@xiconet
Copy link
Contributor

xiconet commented Jan 25, 2017

Hi,
Before all, thank you for providing code free of charge.
I have a similar encoding/decoding problem with the imap-shell , with python 2.7 on the "old", "obsolete", "insecure" but stable WinXP-SP3.
When running list:

 'charmap' codec can't encode character u'\u2013' in position 95: character maps to <undefined> 

@Gentux
Copy link
Owner

Gentux commented Jan 28, 2017

Thank you verry much for the report.

I can't fix it right now because I'm in a foreign country with a poor internet connection.

I'll dig into it when I get back home. Feel free to post a pull request if you have the time :)

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

3 participants