uni icon indicating copy to clipboard operation
uni copied to clipboard

Give `print` an option to not sort characters (or make it not sort by default?)

Open jwodder opened this issue 2 years ago • 2 comments

$ uni print 43 42 41 43
     CPoint  Dec    UTF8        HTML       Name (Cat)
'A'  U+0041  65     41          A     LATIN CAPITAL LETT… (Uppercase_Let…)
'B'  U+0042  66     42          B     LATIN CAPITAL LETT… (Uppercase_Let…)
'C'  U+0043  67     43          C     LATIN CAPITAL LETT… (Uppercase_Let…)
'C'  U+0043  67     43          C     LATIN CAPITAL LETT… (Uppercase_Let…)

As you can see, the output from print sorts characters by codepoints rather than outputting them in the order given on the command line. This is a problem for scripted use, and it's inconsistent with how uni identify works. It also seems strange that the codepoints are sorted but duplicates are not removed.

jwodder avatar Nov 24 '23 20:11 jwodder

I think sorting it like this by default makes sense, because unlike identify you usually don't really care about the order on the CLI, but rather about printing the ranges, blocks, categories, in any order. Or at least, that's how I use it.

That said, it would be nice to have an option.

arp242 avatar Nov 24 '23 20:11 arp242

Just to set expectations: I probably won't work on this any time soon, but I'll merge patches.

arp242 avatar Nov 24 '23 23:11 arp242