encoding_rs_rw
std::io::{Read, Write} wrappers for encoding_rs
This crate provides std::io::Read
and std::io::Write
implementations for
encoding_rs::Decoder
and encoding_rs::Encoder
, respectively, to support
Rust's standard streaming API.
use ;
use ;
use ;
let file_r = new;
let mut reader = new;
let mut utf8 = String new;
reader.read_to_string?;
let file_w = create?;
let mut writer = new;
write!?;
writer.flush?;
This crate is an alternative to encoding_rs_io
but provides a simpler API
and more flexible error semantics.
This crate also provides a lossy
variant of the decoding reader that replaces
malformed byte sequences with replacement characters (U+FFED) and a
with_unmappable_handler
variant of writer that handles unmappable characters
with the specified handler.
use ;
use ;
use ;
let file_r = new;
let mut reader = new;
let mut utf8 = String new;
reader.lossy.read_to_string?;
let file_w = create?;
let mut writer = new;
License
Licensed under the Apache License, Version 2.0.