Normalized Locale IDs
The rules for locale identifiers are specified in RFC 4646, and they are pretty loose: order (after the language) and capitalization don't matter.
However, in order to make comparisons possible, I normalize the locale identifiers to be xx-XX-Xxxx.
Also see Unicode's Normalization Process.
ICU: underscores to dashes,
extraneous script removed if non-script version doesn't exist.
Java: underscores to dashes,
reorder script to be at the end,
hi has no language-only variant, only
.Net: no changes