01 / LANGUAGE

Rust

  • In HTTP(S) URLs, Rust treats \ as a valid delimiter between the scheme and host, or the host and path, and normalizes it to /.
  • Rust normalizes fullwidth Unicode characters to their simpler forms. For example, . (full-width dot) is converted to .(normal dot). This does not apply to URL delimiters: a full-width slash (/) is not treated as a valid URL delimiter.
  • Rust converts many integer-form hosts to dotted IPv4: http://127.1 → 127.0.0.1, http://2130706433 → 127.0.0.1, http://0x7f000001 → 127.0.0.1, http://017700000001 → 127.0.0.1, http://0177.0.0.1 → 127.0.0.1, and http://1234567890 → 73.150.2.210.
  • Rust does not drop Windows drive segments* while normalizing dot segments, as in file://hello/c:/...
  • Rust drops any hostname when the path starts with a Windows drive segment*. For example, after normalizing file://hello/c:/.., the host is empty.
  • Rust converts non-ASCII characters in a hostname to their Punycode equivalents. For example, https://bücher.com/ has the hostname xn--bcher-kva.com.
  • Rust normalizes dot segments through one level of URL encoding in the path.