encode_rs_fs

Crates.ioencode_rs_fs
lib.rsencode_rs_fs
version0.1.3
sourcesrc
created_at2022-02-28 05:40:52.722875
updated_at2022-02-28 08:17:05.99088
descriptionRead and Write files with encoding_rs.
homepage
repositoryhttps://github.com/johnbrandborg/encode_rs_fs
max_upload_size
id540659
size4,917
(johnbrandborg)

documentation

README

encode_rs_fs

Read and Write files using encodings.

Documentation

Offical documentation can be found at https://docs.rs/encode_rs_fs

I think I would have preferred the library to be called encoding_rs_fs, but once I publishing to crate to crates.io it was to late, and, it can't be changed.

Usage

Add this to your Cargo.toml:

[dependencies]
encode_rs_fs = "0.1"

and this to your crate root:

extern crate encode_rs_fs;

For a full list of encodings that can be used refer to the documentions at Docs.rs.

Example

Use the functions to read and write entire files using a encoding.

extern crate encodingfs;

use::encode_rs_fs::{read, write};

fn main() {
    let test_file = "example.txt";
    let source = "ÁáAaBbCc";
    let codec = "latin1";

    write(test_file, source, codec).unwrap();
    let result = read(test_file, codec).unwrap();
    println!("Results {:?}", result);
}
Commit count: 9

cargo fmt