4 ms·
Anything with case insensitivity, like domain names and email addresses, require knowledge of strings as strings. Case sensitivity, ordering, and case changing
by joe_guy 5y ago
Anything with case insensitivity, like domain names and email addresses, require knowledge of strings as strings.
Case sensitivity, ordering, and case changing rules, are reasons not only to have strings, but extensive culture support built into them. String types also let you compare utf16 bytes to utf8 bytes, for example.
To think that strings are opaque bytes is massively naive. It presumes one encoding exists, the input is always valid, in addition to what is said above.
An example of what you're setting yourself up for, is an exploit based around differences in handling invalid utf8.