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

Decode modified UTF-7 encoded mailbox names #126

Closed
asutherland opened this issue Nov 16, 2012 · 5 comments
Closed

Decode modified UTF-7 encoded mailbox names #126

asutherland opened this issue Nov 16, 2012 · 5 comments

Comments

@asutherland
Copy link

Non-ASCII characters in mailbox names get encoded into a funky modified utf-7 encoding:
https://tools.ietf.org/html/rfc3501#section-5.1.3

Here's a patch where I decode the name and cram it in a 'displayName' field for each box for getBoxes in our somewhat divergent fork of imap.js. It has some unit tests in our idiom too.
https://github.com/mozilla-b2g/gaia-email-libs-and-more/pull/80/files

If you like the idea of adding displayName or otherwise exposing the decoded name in the library, I am happy to provide a pull request against the current master branch. Or if you just want to transform what's on that patch, that's also cool.

@mscdex
Copy link
Owner

mscdex commented Nov 16, 2012

I'd accept a pull request for that. Exporting the decoding function in imap.utilities.js would be great.

@chotiwat
Copy link
Contributor

There is already a module for encoding/decoding UTF-7 for IMAP here https://github.com/kkaefer/utf7.

@mscdex
Copy link
Owner

mscdex commented Nov 30, 2012

@asutherland Would kkaefer's utf7 module work for you as well? If so, I can just add it as a dependency and use that.

@asutherland
Copy link
Author

@mscdex It's got unit tests! I can't argue with unit tests!

@mscdex
Copy link
Owner

mscdex commented Nov 30, 2012

Resolved in ec01e96. Thank you both :-)

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