Java Properties for Rust
This is a library for reading and writing Java properties in Rust.
- support UTF-8 and ISO 8859-1 encoding, including mixed (for reading).
- without any dependence, which also means no other encoding support, simple but enough.
- 100% compatible with java.
- almost 100% unit testing (not covered for some error code).
- support fuzz testing
Examples
use Properties;
And more examples under examples directory, you could simply run with cargo run --example store command.
Encoding/Decoding
Java has different implements for OutputStream and Writer, which could
test from the following code.
;
;
;
For OutputStream, the properties is encoded in ISO 8859-1 character encoding.
Characters that cannot be directly represented in this encoding can be written
using Unicode escapes.
And for Writer, it's determined by the file encoding or -Dfile.encoding=xxx
argument when start your program. In most case, it will be UTF-8.
So, in this library, support UTF-8 which is the encoding for Rust. And also support
ISO 8859-1 with the escape_unicode option.