Simple to enter Unicode character that would sort after Z in most cases?
SortingUnicodeSorting Problem Overview
As you probably know most symbols are sorted before the alphabetical letters.
I am looking for one character that is easy to enter from the keyboard that would be sorted after "z" by most sort implementations.
If this is also an ASCII character, the better :)
Any ideas?
Sorting Solutions
Solution 1 - Sorting
On a Mac, these are the only characters I can type using a US keyboard (with and without shift and option modifiers) that sort below Z and z:
- Ω (option+z)
- π (option+p)
- µ (option+m)
- (shift+option+k)
It seems like omega and then pi are the best options for cross-platform compatibility.
Solution 2 - Sorting
On Windows, none of these options work because they all sort before A
.
A solution I ended up using is an Arabic character:
> ٴ This folder comes after z
in windows
Solution 3 - Sorting
A Tilde '~' is ASCII code 126.
This comes after all the standard English usage characters and would therefore out-sort a 'Z' of any case.
It would not out-sort other special characters, however ASCII or unicode sequencing is not sufficient to cover international sorts in any context.
[Example: internationisation in javascript][1]
[1]: http://www.indiscripts.com/post/2010/10/alphabetical-sort-in-javascript-and-indesign "Example: internationisation in javascript"
Solution 4 - Sorting
The answers provided here that worked for me:
- Ξ _Greek capital letter XI (per tonystar's answer);
- π _Greek small letter PI (per DaveC's answer);
- Ω _Greek capital letter OMEGA (per DaveC's answer);
- µ _international symbol for micrometre, previously and AKA micron (per DaveC's answer);
- ٴ _Arabic letter ٴ(unidentified) (per degenerate's answer);
- ﻩ _Arabic letter HEH isolated form (per Bytee's answer);
Notes:
- using macOS 10.14.2.
- a tilde ~ always displays before numbers in an ascending sort.
In macOS Numbers (spreadsheet) app, sort (ascending) displays as follows:
- 0
- 9
- a
- z
- µ
- Ξ
- π
- Ω
- ٴ
- ﻩ
Perhaps worth mentioning that the last two Arabic letters ٴ (unknown) and ﻩ (HEH) are difficult to edit (not as expected) in Numbers.
In macOS Finder, sort (ascending) displays as follows:
- ٴ (appears as a narrow 'blank' space at the beginning of the file name)
- 0
- 9
- a
- z
- µ
- Ξ
- π
- Ω
- ﻩ (appears at the end of the file name in display, at the beginning during edit)
Solution 5 - Sorting
Xi "Ξ
" works nicely!
On Mac: Ctrl+Cmd+Space, then type "xi".
Solution 6 - Sorting
Late to the party, but I was tearing my hair out to find a character that sorted last that wouldn't tweak my OCD either. Finally found this Arabic character "ﻩ" sorts after z. Putting one on either side of the folder name like so...
ﻩ Odds & Ends ﻩ
...looks rather pretty to me, so maybe it'll work for you all too!
Solution 7 - Sorting
If you want to do it somehow invisible you can use no-break-space ascii code:
Windows: ALT+0160 (only works with numpad)
Solution 8 - Sorting
I'm trying to do this to my Amazon Wishlists. None of the suggestions here have worked (I have tried, Ω
, Ξ
, ~
).
I ended up using zzz_
Solution 9 - Sorting
It looks like a sort with LC_ALL=C
sorts by ascii value, so {|}~
and DEL
will come after z.
% echo $'a\nA\n1\n@\n~' | LC_ALL=C sort
1
@
A
a
~
It appears this is default when LC_ALL is not set on mac/bsd sort but must be explicitly set for gnu sort.