ICU-8383 Fixed the locale field truncation problem in ULocale.forLocale(Locale).
X-SVN-Rev: 29495
This commit is contained in:
parent
6b7bfaa8cc
commit
82e0351c46
@ -3704,7 +3704,7 @@ public final class ULocale implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
return new ULocale(buf.toString());
|
||||
return new ULocale(getName(buf.toString()), loc);
|
||||
}
|
||||
|
||||
private ULocale toULocale6(Locale loc) {
|
||||
@ -3721,7 +3721,7 @@ public final class ULocale implements Serializable {
|
||||
break;
|
||||
}
|
||||
}
|
||||
uloc = new ULocale(locStr, loc);
|
||||
uloc = new ULocale(getName(locStr), loc);
|
||||
}
|
||||
return uloc;
|
||||
}
|
||||
|
@ -4041,6 +4041,7 @@ public class ULocaleTest extends TestFmwk {
|
||||
{new Locale("", "US"), "_US"},
|
||||
{new Locale("en", "", "POSIX"), "en__POSIX"},
|
||||
{new Locale("no", "NO", "NY"), "nn_NO"},
|
||||
{new Locale("en", "BOGUS"), "en__BOGUS"}, // ill-formed country is mapped to variant - see #8383 and #8384
|
||||
};
|
||||
|
||||
for (int i = 0; i < DATA.length; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user