Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

By the way, there seems to be a "standard" way to sort strings:

> Unicode Technical Report #10 also specifies the Default Unicode Collation Element Table (DUCET). This data file specifies a default collation ordering.

https://en.wikipedia.org/wiki/Unicode_collation_algorithm

I assume this mainly aims at giving a reasonable compromise between the different dictionary and phone book sorting rules of various languages (and even locales), which should give reasonable results for most languages. I assume this also puts "Alice2" before "Alice10".



> I assume this also puts "Alice2" before "Alice10".

It doesn't (per https://www.unicode.org/reports/tr10/#Non-Goals):

  > 1.9.2 Non-Goals
  >
  > The Default Unicode Collation Element Table (DUCET) explicitly does not provide for the following features:
  > [ ... ]
  > Numeric formatting: numbers composed of a string of digits or other numerics will not necessarily sort in numerical order.


Oh, that surprises me.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: