TreeMap<String, String> kwds = new TreeMap<String, String>();
for (Character key : extKeys) {
Extension ext = exts.getExtension(key);
if (ext instanceof UnicodeLocaleExtension) {
UnicodeLocaleExtension uext = (UnicodeLocaleExtension)ext;
Set<String> ukeys = uext.getUnicodeLocaleKeys();
for (String bcpKey : ukeys) {
String bcpType = uext.getUnicodeLocaleType(bcpKey);
// convert to legacy key/type
String lkey = bcp47ToLDMLKey(bcpKey);
String ltype = bcp47ToLDMLType(lkey, ((bcpType.length() == 0) ? "true" : bcpType)); // use "true" as the value of typeless keywords
// special handling for u-va-posix, since this is a variant, not a keyword
if (lkey.equals("va") && ltype.equals("posix") && base.getVariant().length() == 0) {
id = id + "_POSIX";
} else {
kwds.put(lkey, ltype);
}
}
// Mapping Unicode locale attribute to the special keyword, attribute=xxx-yyy
Set<String> uattributes = uext.getUnicodeLocaleAttributes();
if (uattributes.size() > 0) {
StringBuilder attrbuf = new StringBuilder();
for (String attr : uattributes) {
if (attrbuf.length() > 0) {
attrbuf.append('-');