I am looking to use localeCompare for strictly sorting strings but I am finding it is returning 0 when given two different unicode characters which erroneously indicates they are the same e.g.
ℜ U+211C (alt-08476) BLACK-LETTER CAPITAL R = real part
ℝ U+211D (alt-08477) DOUBLE-STRUCK CAPITAL R = the set of real numbers
"ℜ".localeCompare("ℝ", "en")
> 0
"ℜ" === "ℝ"
> false
"ℜ".charCodeAt(0)
> 8476
"ℝ".charCodeAt(0)
> 8477
I have looked at the docs but the defaults are already for "sort" and "variant" which appear to be the strictest available:
Is localeCompare unable to give a strict a ordering?
