Binary, List and Tuple Inequalities (Paradox?)

Raimo Niskanen raimo.niskanen@REDACTED
Fri Nov 1 09:40:44 CET 2019


On Thu, 2019-10-31 at 20:20 +0400, Antonio Nikishaev wrote:
> > On 31 Oct 2019, at 14:52, Raimo Niskanen <
> > raimo.niskanen@REDACTED> wrote:
> > 
> > 
> > As for now, Elixir uses binaries as their default representation
> > for
> > strings, so having them sort as strings is vital for Elixir.
> > (Unicode has shot a big hole in that argument, but still true for
> > latin-1)
> 
> It has not.  UTF-8 does preserve order.

Ah, yes!  That clever property of UTF-8 slipped my mind.

So in both Erlang and Elixir; codepoint lists sorts the same way as
their corresponding UTF-8 binaries (which is the default format for
binaris as strings in both Erlang and Elixir).

Not true for other Unicode binary encodings, though...

/ Raimo



> 
> 
> 
> 
> -- lelf
> 


More information about the erlang-questions mailing list