Users submitted those weird characters. How to sort them along with normal text in Dart ?
ℝ
The good old
b.name.toLowerCase().compareTo(a.name.toLowerCase()); does not work
Users submitted those weird characters. How to sort them along with normal text in Dart ?
ℝ
The good old
b.name.toLowerCase().compareTo(a.name.toLowerCase()); does not work
Copyright © 2021 Jogjafile Inc.
UPDATE: Just found https://pub.dev/packages/diacritic, which appears as though it might do roughly what you want, although I'm not sure of how many different characters it supports.
Well, a good place to start might be looking at the internal implementation of the ES6
String.prototype.normalize()function.Interestingly, it only works in Compatibility Decomposition mode - ie. NFKC or NFKD.
Anyway, maybe there is a translation in Dart, or you can use the 'dart:js' library if you're running on the web, or you could find the implementation in the V8 engine (although it'll probably be in C).