• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use of Emojis
#8
So I've explored the emoji issue some more, and if I add a new option to ignore localization sorting rules, you can have the emojis at the end of the list in Android. At the moment, in both Windows 10 and Android, I rely on a Collator object which takes into consideration sorting rules for the current language/locale. This is important as some characters are sorted differently depending upon the language (especially special characters). However, that same Collator that I depend upon changes the sorting of things like the emojis, so you will have to choose which is important to you.

As far as the sorting of special characters in the examples provided, that is a can of worms. I just spent over an hour and a half looking into it and there isn't an easy answer. Like I described above, the collators on each system are returning different sorting results. Furthermore, even if I ignore the collator and just do a straight string based comparison, I'm getting different sorting results in each version. For example, if I do a simple test of comparing "=SortTest" to "0SortTest" using C# for the Windows 10 version, it returns -1 meaning that "=SortTest" should go before "0SortTest". Yet if you simplify that down into the character codes, '=' has a value of 61 while '0' has a value of 48, meaning 0 should come first . So the C# code is doing some stuff with localization, unless I explicitly tell it to do a ordinal comparison which then states that "=SortTest" should go after "0SortTest".  So if I modify the code to do a straight ordinal comparison (which you aren't normally supposed to do for user facing things like sorting lists), I STILL get a different result than what Java returns when comparing strings using the standard compareTo method. Java does not have an equivalent of the ordinal comparison, so I had to write my own, and when I do that, I can get almost identical sorting results to what C# has. The next problem is that the standard sorting method in C# is a non-stable sort, meaning you can get different results every time you sort. If I add a slower stable sort, then I can finally match the results on Android. 

So while I can manage to get sorting with symbols to work out the same on each OS, I can't then use collators or localization rules. I don't think most users are going to want that, but in order to support the emojis as described above, I'll have to add a setting to ignore the collator anyway. You can decide if that's worthwhile for you to use.

Mike
Reply


Messages In This Thread
Use of Emojis - by Ben - 03-19-2018, 06:03 PM
RE: Use of Emojis - by Zubersoft - 03-20-2018, 01:14 AM
RE: Use of Emojis - by Ben - 03-20-2018, 05:50 PM
RE: Use of Emojis - by itsme - 03-21-2018, 04:08 PM
RE: Use of Emojis - by Zubersoft - 03-25-2018, 09:59 AM
RE: Use of Emojis - by Zubersoft - 03-25-2018, 03:06 PM
RE: Use of Emojis - by itsme - 03-25-2018, 05:33 PM
RE: Use of Emojis - by Zubersoft - 03-25-2018, 05:37 PM
RE: Use of Emojis - by itsme - 03-25-2018, 06:58 PM
RE: Use of Emojis - by Zubersoft - 03-26-2018, 05:00 AM
RE: Use of Emojis - by Zubersoft - 03-26-2018, 03:39 PM
RE: Use of Emojis - by Ben - 03-29-2018, 02:40 AM
RE: Use of Emojis - by Ben - 04-05-2018, 11:21 PM
RE: Use of Emojis - by Zubersoft - 04-06-2018, 02:00 PM
RE: Use of Emojis - by Ben - 04-07-2018, 07:00 AM



Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.