toUnicode method
Format the locale in Unicode format. The identifier can have an empty language field.
See: https://www.unicode.org/reports/tr35/#bcp-47-language-tag-conversion
Implementation
@override
String toUnicode() {
var res = [super.toUnicode(), ...extensions, privateUse].nonNulls.join('-');
if (characterEncoding != null) res += '.$characterEncoding';
if (legacyExtensions != null) res += '@$legacyExtensions';
return res;
}