4 ms·
Good catch. I kind of slacked on this since I knew it would be a solvable problem once everything else got worked out. Right now the reference implementation s
by seagreen 10y ago
Good catch. I kind of slacked on this since I knew it would be a solvable problem once everything else got worked out.
Right now the reference implementation sorts by comparing codepoints one-on-by one. When it reaches a codepoint that's unequal or nonexistant it orders the string with the lesser or nonexistant codepoint first.
So in your example, after serializing from JSON and deserializing to Son we get `{"op":0,"öp":1}`.
Two remaining questions:
1. What's the most unambiguous way to describe this process?
2. Right now the comparison is on unescaped strings. Should it be on escaped strings instead?
There's an issue open to discuss this here: https://github.com/seagreen/Son/issues/1 https://github.com/seagreen/Son/issues/1
EDIT: I am curious what Unicode recommends for language-aware sorting, even though we're not going to use it. Is this the right place to look? http://unicode.org/reports/tr10/ http://unicode.org/reports/tr10/
EDIT2: RFC 7159 has language about equality that's relevant to comparisons. I'm confident now we're on the right track: https://tools.ietf.org/html/rfc7159#section-8.3 https://tools.ietf.org/html/rfc7159#section-8.3