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 Oct 19, 2017 · 2 comments
Closed

Support fetching non-UTF-8 data. #54

jonhoo opened this issue Oct 19, 2017 · 2 comments
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@jonhoo
Copy link
Collaborator

jonhoo commented Oct 19, 2017

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 #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 #11 (comment).

@jonhoo
Copy link
Collaborator Author

jonhoo commented Nov 22, 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?

@jonhoo jonhoo added enhancement New feature or request question Further information is requested labels Nov 22, 2018
@jonhoo jonhoo added this to the imap 1.0 milestone Nov 22, 2018
@jonhoo
Copy link
Collaborator Author

jonhoo commented Nov 23, 2018

Moved to jonhoo/rust-imap#54.

@jonhoo jonhoo closed this as completed Nov 23, 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
Projects
None yet
Development

No branches or pull requests

1 participant