Replace the Rust URL form-encoding callback bridge into C++ TextCodec with a direct encoding_rs encoder. This keeps percent-encode-after-encoding entirely in Rust and removes liburl_rust's dependency on LibTextCodec. It also happens to fix ISO-2022-JP URL encoding of literal U+FFFD. The LibTextCodec reverse lookup treats generated 0xFFFD table holes as real JIS0208 mappings, so literal U+FFFD skipped the encoder-error path. encoding_rs treats U+FFFD as unmappable, so URL encoding emits the required numeric character reference.
16 lines
491 B
CMake
16 lines
491 B
CMake
set(SOURCES
|
|
Host.cpp
|
|
Origin.cpp
|
|
Parser.cpp
|
|
PublicSuffixData.cpp
|
|
RustIntegration.cpp
|
|
Site.cpp
|
|
URL.cpp
|
|
)
|
|
|
|
ladybird_lib(LibURL url)
|
|
target_link_libraries(LibURL PRIVATE liburl_rust LibUnicode LibTextCodec LibRegex PkgConfig::LIBPSL)
|
|
|
|
import_rust_crate(MANIFEST_PATH Rust/Cargo.toml CRATE_NAME liburl_rust FEATURES allocator FFI_HEADER RustFFI.h)
|
|
target_link_libraries(liburl_rust INTERFACE LibUnicode LibRegex)
|
|
target_compile_definitions(LibURL PRIVATE ENABLE_RUST)
|