Uh, no? Most if not all scripts do have letter order, CJK(V) "ideographs" included. The actual problem is twofold: the letter order might not be unique, and the word order might be completely different from the letter order. CJK(V) "ideographs" exhibit both problems---their word order is phonetic, while letter order is based on shapes and different dictionaries use different rules---and it is very common in Chinese and Japanese that the string meant to be sortable has pronunciation attached (e.g. Wikipedia).
Also, believe it or not, even emojis do have order too [1], albeit arbitrary one.
Even in Latin scripts, sorting order is language-specific and can even be domain specific (e.g. some languages sort phone books differently from dictionaries).
For "CJKV" systems there are ordering methods such as radicals and, as in European languages, ordering can depend on what you want to accomplish.
https://en.m.wikipedia.org/wiki/Goj%C5%ABon
Eg. Words starting with 一人 can be read as both いちにん (ichinin as in 一人前 - food for one person) or ひとり (hitori - 一人暮らし - living alone)
(2) 大人気 (だいにんき, daininki) - very popular
(not enumerable as in written text as strokes can be combined and invented on the fly, enumerable if you think it's a finite charset on computers)
It can also be sorted using the radical and stroke count, although then you can't enumerate it in order because there's an infinite number of possible characters for each radical.
There might also be an issue if old Hanja-only texts need to be handled differently from Hanzi rendering/processing. That would not surprise me.
Still, I agree it seems pretty weird.
Buuuut historically, there have been several ways to arrange Hangul linearly, and the prevailing sorting in dictionaries differes between North and South Korea.
ASCII ordering is just an arbitrary standard that mapped numbers to letters so people could make computer hardware interoperate. It's not always a sensible sort ordering.
This isn't really true; there are well-defined, standardized answers to all of those:
- For purposes of alphabetizing, punctuation marks are completely ignored, as if they weren't present. "Stop me!" and "Stop, me!" are identical strings.
- Case is also ignored. "AAAAAGH" and "aaaAagh" are identical strings.
- Spaces are not ignored. Sort order is determined by the text before the first space. Shorter sorts before longer. "A bird", "a cat", and "a deer" all sort under "a" and above "ab".
Note that these are rules for English, not rules for arbitrary sequences of binary data. They look the way they do because they model the data as a sequence of English words.
You can't just say "Stop me!" and "Stop, me!" are identical. You have to define which comes first.
Why? All real-world applications of sorting must handle sorting identical objects. Saying that "Stop me!" and "Stop, me!" are identical doesn't cause any problems that aren't also caused by saying "Stop me!" and "Stop me!" are identical.
It's a desired feature of sorting algorithms that they should be deterministic, in which case arbitrarily ordered input should produce identical output.
Otherwise, having non-deterministic output just makes everything harder -- harder to make comparisons, more work to write tests, etc.
This makes as much sense as saying that "Stop me!" and "Stop me!" aren't identical, because one of them is first and the other is second.
It's true, but it's not relevant to sorting them.
Your "desired feature of sorting algorithms" is most commonly realized as the question of whether the algorithm provides a "stable" sort -- that is, whether two values that compare equal are guaranteed to occur in the same order in the (sorted) output that they did in the (unsorted) input. There are applications where this is considered desirable, and many other applications where it isn't. But there are no applications in which it's not possible for two values to compare equal. For the question of stable sorting to arise in the first place, you have to have already realized that you're going to be sorting things that compare equal.
Stability is about preserving the order of items that compare equally. That's a different topic.
I'm talking about it being desirable not to underspecify the comparison function (sorting rules), so that unequal items are never compared as equal.
E.G. of sorting how English humans tend to:
`A string with non-letters ignores the non-letters.
Ace
It's not a bug, it's by design.