Using Raku (formerly known as Perl_6)
Default sorting:
~$ raku -e '.put for lines.sort;' file
A
Thor is mighty
foo bar
foo-a baz
foo-c baz
thor is mighty
Þor is mighty
þor is mighty
䨝
坽
OR (sort ASCII):
~$ raku -e '.put for lines.sort({ .match(:global, / <:ASCII>+ /) });' file
坽
䨝
A
Thor is mighty
foo bar
foo-a baz
foo-c baz
þor is mighty
Þor is mighty
thor is mighty
OR (sort Latin script):
~$ raku -e '.put for lines.sort({ .match(:global, / <:Script<Latin>>+ /) });' file
坽
䨝
A
Thor is mighty
foo-a baz
foo bar
foo-c baz
thor is mighty
Þor is mighty
þor is mighty
All sorting forms above can be shortened by using the m:g/ … /form, but the .match(/:global, … /)form is more explicit (and helpful) for new users as the leading . dot indicates the function is called on $_ the topic variable.
Note above, in instances where the "sort criteria" is not encountered that line is "passed thru" and placed at the head of the output. You can replicate the default output by sorting explicitly for the presence/absence of a particular ASCII/Unicode-script, like so (replicates default sorting at top):
~$ raku -e '.put for lines.sort({ m:g/ <-:ASCII>+ /, m:g/ <:ASCII>+ / });' file
A
Thor is mighty
foo bar
foo-a baz
foo-c baz
thor is mighty
Þor is mighty
þor is mighty
䨝
坽
Sample Input:
foo-a baz
foo bar
foo-c baz
þor is mighty
thor is mighty
Þor is mighty
Thor is mighty
坽
䨝
A
https://docs.raku.org/language/unicode
https://docs.raku.org/routine/sort
https://raku.org
LC_COLLATE=C sort file.txtgive you the expected order?