Replace the generated C++ legacy codec implementations with a small Rust wrapper around encoding_rs. This keeps the existing LibTextCodec API while moving label lookup, legacy decode/encode, validation, and streaming decoder state to Rust. The generated index data and generator are no longer needed. It also fixes several TextDecoder EOF cases due to a more correct implementation. encoding_rs finalizes decoders according to the Encoding Standard, so incomplete UTF-8/Big5 tails and malformed UTF-16 surrogate tails produce the required single replacement at end-of-queue instead of being dropped, buffered, or double-counted by our old hand-written decoders.
16 lines
211 B
TOML
16 lines
211 B
TOML
[package]
|
|
name = "libtextcodec_rust"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[lib]
|
|
crate-type = ["staticlib"]
|
|
|
|
[dependencies]
|
|
encoding_rs = "0.8.35"
|
|
|
|
[build-dependencies]
|
|
cbindgen = "0.29"
|
|
|
|
[lints]
|
|
workspace = true
|