UriParseException if an invalid character is found.validateComponentChars
private fn
void validateComponentChars(string s, Component comp, bool allowNonAscii, string what) @safeValidate that s contains only RFC 3986-allowed characters for comp.
In strict parsing, this rejects ASCII control characters, non-ASCII bytes (unless allowNonAscii is true), and any characters not permitted by the RFC 3986 ABNF for the selected component.
Notes: This does not validate overall structural syntax (e.g., path segment rules); it only checks per-character admissibility and assumes %HH escapes were already validated by validatePctEscapes.
Parameters
s | Component string to validate. |
comp | Component context. |
allowNonAscii | Whether to allow bytes >= 0x80 (extension behavior). |
what | Human-readable component name used for error messages. |