servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.31k stars 325 forks source link

Documentation for IDNA configuration options should explain use cases #898

Open hsivonen opened 8 months ago

hsivonen commented 8 months ago

Describe the bug

The docs for idna::Config don't explain when and why it might be appropriate not to use the default options. Also, idna::domain_to_ascii_strict does not explain when it's appropriate to call in instead of calling the non-strict variant.

The docs should explain the use cases so that callers don't introduce unwanted (from the user perspective) inability to process some names.

The WHATWG URL Standard's beStrict option is only for checking content for conformance, but tools that need to deal with the names out there shouldn't be setting beStrict and the corresponding idna crate options.

(My context for filing this is that I'm investigating the possibility of developing a build-time option for the idna crate to use icu_normalizer to perform a subset of UTS 46 processing, and I'm trying to figure out what features that are unused in a Web browser are actually relevant to the wider crate ecosystem.)