Support fetching non-UTF-8 data. #54
Labels
enhancement
New feature or request
question
Further information is requested
tombstone
A reference to an old issue on mattnenterprise/rust-imap
Milestone
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 anOutput
associated type that implementsFrom<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
The text was updated successfully, but these errors were encountered: