encoding_rs
encoding_rs copied to clipboard
A Gecko-oriented implementation of the Encoding Standard in Rust
I’ve just written this function: ```rust fn decode_to_utf16(bytes: &[u8], encoding: &'static Encoding) -> Vec { let mut decoder = encoding.new_decoder(); let capacity = decoder.max_utf16_buffer_length(bytes.len()).exepct("Overflow"); let mut utf16 = Vec::with_capacity(capacity); let...
https://github.com/hsivonen/encoding_rs/blob/d4d7d2a99aac266ecf6938c3832aefaaf8c1e52b/src/lib.rs#L2974-L2980 Functionally, `decode()` and `decode_with_bom_removal()` seem pretty much the same? That doesn't seem correct? If there's a variant called "decode_with_bom_removal" then I would expect the standard variant *not* to remove...
[EUC_JP doc](https://docs.rs/encoding_rs/latest/encoding_rs/static.EUC_JP.html) refers to the [euc-jp.html](https://encoding.spec.whatwg.org/euc-jp.html) and [euc-jp-bmp.html](https://encoding.spec.whatwg.org/euc-jp-bmp.html), which are not exist. According to the https://encoding.spec.whatwg.org/#indexes I assume, that the correct link is https://encoding.spec.whatwg.org/jis0212.html and https://encoding.spec.whatwg.org/jis0212-bmp.html
Currently, the ASCII acceleration code manually reinterprets slice memory as wider SIMD or ALU types. This code predates the `align_to` and `align_to_mut` methods on slices. This code should be rewritten...
Please help me understand whether the difference in behavior between Encoder and Decoder is intentional or not. Consider the following code : ``` let t_utf8 = "ハロー世界"; let t_iso_2022_jp =...
Hi @hsivonen, I would like to help integrate this project into [OSS-Fuzz](https://github.com/google/oss-fuzz). - As an initial step for integration I have created this PR: https://github.com/google/oss-fuzz/pull/8652, it contains necessary logic from...
Hi, thank you for maintaining this great crate. This PR adds a minimal CI workflow which will help you notice build breaks easily. Since this crate is very popular (15720778...
I'm performing an unsafe review of encoding_rs. The hope is by the end of this I will have safety documentation for all unsafe blocks in the crate. Opening this issue...
My code is ```rust let (text, _, _) = GBK.encode("abc"); dbg!(&text); ``` Output: ```text &text = [ 97, 98, 99, 38, 35, 56, 50, 48, 54, 59, ] ``` The...