1 unstable release
0.1.0 | Mar 11, 2022 |
---|
#1294 in Encoding
271 downloads per month
18KB
309 lines
local-encoding-ng
This is local-encoding-ng, a library which wastly simplifies dealing with the unfamous Windows 8-bit encodings.
For example, in Russian version:
Windows have functions which help in these conversions:
MultiByteToWideChar
and
WideCharToMultiByte
.
This library provides a simple API for these functions.
Usage
Put this in your Cargo.toml
:
[dependencies]
local-encoding-ng = "*"
Or, better, use cargo-edit to add it with a correct version and use it to keep the version up-to-date.
For example:
use local_encoding_ng::{Encoding, Encoder};
fn main()
{
println!("Unicode string: {}", Encoding::ANSI.to_string(b"ANSI string").unwrap());
println!("Unicode string: {}", Encoding::OEM.to_string(b"OEM string").unwrap());
}
Dependencies
~175KB