prataprc / jsondata

JSON processor
https://docs.rs/jsondata
MIT License
9 stars 3 forks source link

Unicode collation #10

Open prataprc opened 5 years ago

prataprc commented 5 years ago

Unicode specification for sorting string has this to say:

Because collation varies by language and not just by script, it is not possible to arrange the encoding for characters so that simple binary string comparison produces the desired collation order for all languages. Because multi-level sorting is a requirement, it is not even possible to arrange the encoding for characters so that simple binary string comparison produces the desired collation order for any particular language.

Note that the current implementation of Ord on JSON string simply does a byte-by-byte comparison.