Files
moli/moli-encoding/src/lib.rs
T
ldm0 0a417976e1 feat(encoding): expose CSS stylesheet byte decoding
Extract the existing CSS byte-decoding utility: protocol label, initial @charset and environment fallback selection, BOM precedence and the actual encoding returned for imports. Include its existing 1024-byte charset-sniffing regression test.

Source-commit: ccf589ee8a
2026-11-10 20:32:30 +08:00

33 lines
1006 B
Rust

//! Browser-compatible text, document, form, script, and URL encoding helpers.
mod document;
mod form;
mod labels;
mod legacy_text;
mod percent;
mod query;
mod script;
mod stylesheet;
mod xhr;
pub use document::{
DocumentStreamingDecoder, LegacyEncodingDetector, decode_html_document,
decode_html_document_with_fallback,
};
pub use form::{
encode_text_for_legacy_web, form_output_encoding, form_output_encoding_for_label,
form_submission_encoding, form_urlencoded_serialize_pairs, is_charset_sentinel_name,
};
pub use labels::{
charset_from_content_type, charset_from_headers, encoding_for_label,
encoding_for_response_charset, encoding_from_response_headers,
};
pub use legacy_text::decode_text_for_legacy_web;
pub use query::{encode_url_query_for_legacy_web, encode_url_query_for_url_parser};
pub use script::{decode_classic_script_source, decode_utf8};
pub use stylesheet::decode_css_stylesheet;
pub use xhr::{XhrResponseDecoder, XhrResponseTextKind};
#[cfg(test)]
mod tests;