Using the Elm 0.17 REPL, sorting is not in the expected order (Ubuntu 15.10):
$ elm repl
---- elm repl 0.17.0 -----------------------------------------------------------
:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> import List
> import String
> List.sortBy String.toLower ["R", "É", "D"]
["D","R","É"] : List String
The "UPPERCASE E WITH ACUTE ACCENT" should be between D and R.
In the browser, I get the same behaviour:
accounts: ["R","É","D"]
sorted accounts: ["D","R","É"]
Pure JavaScript does the same thing:
var a = ["R", "É", "D"]
var b = a.map(function(s) { return s.toLowerCase() })
b
//=> ["r", "é", "d"]
b.sort()
//=> ["d", "r", "é"]
Node v4.4.3 incorrectly sorts as well:
> var a = ["D", "É", "R"]
undefined
> var b = a.map(function(s) { return s.toLowerCase() })
undefined
> b.sort()
[ 'd', 'r', 'é' ]
PostgreSQL is the only software which does the correct thing:
SELECT a FROM (VALUES ('R'), ('É'), ('D')) t0(a) ORDER BY lower(a);
# a
# ---
# D
# É
# R