decoder/decoder.rs
1use std::io::Read;
2use trivet::decoder;
3
4/// This just copies the input to the output. It can be used to re-encode a file on
5/// Windows, but will likely do nothing to a text file on Linux.
6pub fn main() {
7 // Read and echo the input to the output, decoding the input.
8 let mut bytes = vec![];
9 std::io::stdin().read_to_end(&mut bytes).unwrap();
10 let decode = decoder::Decode::new(bytes);
11 for ch in decode {
12 print!("{}", ch);
13 }
14}