The encoding_rs_io
crate provides a simple adapter that wraps any io::Read
and provides an io::Read
implementation itself that transcodes from a source encoding to UTF-8. By default, it uses BOM sniffing to automatically transcode UTF-16 with no extra work on the part of the caller. An explicit encoding may also be specified (up to the encodings supported by the encoding_rs
crate).
The “future work” section outlines some possible use cases that this crate doesn’t hit. I don’t have any compelling use cases for them at the moment, but I’d be happy to try and mentor development on that front for folks with use cases the demand them.