How does the sorting work in a table?

Opinion: each sort order provided should be provided in both places: the database, and the programming language. This allows order-dependent operations to move seamlessly between database and programming language, as the need arises, with no confusion, and no additional code.

The principle of least surprise says that existing Python operators <, >, ==, !=,. etc. should agree with the default ordering. This does not preclude having other, database-provided orderings. They would be provided to Python code via equivalent Anvil-supplied string-comparison functions.

If I understand correctly, Unicode is the Web’s preferred character set, and UTF-8 its preferred encoding. Therefore, I personally would be least surprised if the ordering was consistent with UTF-8.

From what I can tell, it is also the ordering with the least overhead, as there should no indirection (lookup tables) involved, but a direct C memcmp() against the unaltered UTF-8 byte streams.

But am I missing something?