any API that accepts "string" inherits so much baggage - what do you do to surrogate pairs? what do you do for non-canonical UTF-8 encodings? What do you do for invalid UTF-8? What do you do for null bytes? What do you do for BOMs? Don't even think about case folding rules
"string" invites people to write parsers, often without realising they're writing parsers, without well-defined format rules. If the same string gets parsed in two different ways in two different locations, you have a recipe for disaster
Comments