3 ms·
> Why would "the path name you entered is not valid Unicode/UTF-8" be a good error message, if the path actually exists on the system? On Windows NT (which use
by zzo38computer 2y ago
> Why would "the path name you entered is not valid Unicode/UTF-8" be a good error message, if the path actually exists on the system?
On Windows NT (which uses Unicode file names), it is a good error message (although it should allow UTF-8 with possible mismatched surrogates, which is called WTF-8). However, on UNIX, and other systems that don't use Unicode file names, it is not a good error message; the program should not care if the path is valid UTF-8 and should just use it as is. (If the system disallows certain bytes in file names (or if the user entered a file name that is too long for the file system in use) then the error message can say that, if that is the case, though)
> There's really no good general concept of string equality that you can bake into a language except for the byte equality one, which doesn't care for UTF-8.
I agree.
How you compare text (or other data) would depend on the application-specific details, and Unicode makes it especially complicated (and probably even impossible to do "correctly" in any way other than just comparing bytes, anyways).
(Even, in my own operating system design, which does not use Unicode but uses Extended TRON Code instead (it also supports arbitrary 8-bit character sets, which in some contexts are much more useful than large character sets), I had considered that comparing text still depends on application-specific details (and other details); while many of the problems of Unicode are avoided, there are still problems, including some of its own, although they are not as complicated to deal with than Unicode, and I had considered how to deal with them.)