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

Support fetching non-UTF-8 data. #54

Closed
jonhoo opened this issue Nov 23, 2018 · 2 comments
Closed

Support fetching non-UTF-8 data. #54

jonhoo opened this issue Nov 23, 2018 · 2 comments
Labels
enhancement New feature or request question Further information is requested tombstone A reference to an old issue on mattnenterprise/rust-imap
Milestone

Comments

@jonhoo
Copy link
Owner

jonhoo commented Nov 23, 2018

The code currently assumes that all data is valid UTF-8, which is not true for a number of services (#11). A past PR (#33) tried to address this by changing all return types to Vec<u8>, but this makes for a much less pleasant API. Some further discussion on this can be found in mattnenterprise/rust-imap#33 (comment). Ideally we'd like more structured responses (#28), though that will also eventually have this issue.

Some good points have been brought up in various comments from the aforementioned threads:

I think what we'd want is a way for the user to choose whether they want data to be parsed as UTF-8 or not, and if they choose not, to just get the raw bytes. Crucially though, the interface for when you do have UTF-8 data should not be significantly more complex than today. One way of achieving this is by using a trait that is implemented for Client with an Output associated type that implements From<Vec<u8>> (or something along those lines). @sanmai-NL also discussed a related solution in mattnenterprise/rust-imap#11 (comment).

See the original issue here: mattnenterprise/rust-imap#54

@jonhoo jonhoo added enhancement New feature or request question Further information is requested tombstone A reference to an old issue on mattnenterprise/rust-imap labels Nov 23, 2018
@jonhoo jonhoo added this to the imap 1.0 milestone Nov 23, 2018
@jonhoo
Copy link
Owner Author

jonhoo commented Nov 23, 2018

I think this is now done? All message data is returned as &[u8], and imap-proto should deal with non-UTF-8 stuff in the protocol just fine?

@sanmai-NL
Copy link

I think this is not an issue anymore indeed.

@jonhoo jonhoo closed this as completed Nov 24, 2018
@jonhoo jonhoo added refactoring For when stuff needs to move around and removed refactoring For when stuff needs to move around labels Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested tombstone A reference to an old issue on mattnenterprise/rust-imap
Projects
None yet
Development

No branches or pull requests

2 participants