|
|
|
|
|
by adgjlsfhk1
542 days ago
|
|
yeah I think this is an area where rust (and python) just get it wrong. files, the Internet and input devices can all give you invalid Unicode. IMO it's better to have a primary string type that includes invalid Unicode since most algorithms will handle it correctly anyway, and the ones that won't can pretty clearly check and throw errors appropriately (especially since very few algorithms work correctly for all of Unicode in the first place) |
|
If an algorithm works for invalid Unicode, it should probably be an algorithm on bytes, not strings.