LocaleEditor and StringToLocaleConverter do not restrict variant part through validation (SPR-8637)

This commit is contained in:
Juergen Hoeller
2011-10-20 11:53:02 +00:00
parent 0c9e3fb3bd
commit e2d9142c5a
2 changed files with 22 additions and 7 deletions

View File

@@ -566,6 +566,16 @@ public class StringUtilsTests extends TestCase {
assertNull("When given an empty Locale string, must return null.", locale);
}
/**
* <a href="http://opensource.atlassian.com/projects/spring/browse/SPR-8637">See SPR-8637</a>.
*/
public void testParseLocaleWithMultiSpecialCharactersInVariant() throws Exception {
final String variant = "proper-northern";
final String localeString = "en_GB_" + variant;
Locale locale = StringUtils.parseLocaleString(localeString);
assertEquals("Multi-valued variant portion of the Locale not extracted correctly.", variant, locale.getVariant());
}
/**
* <a href="http://opensource.atlassian.com/projects/spring/browse/SPR-3671">See SPR-3671</a>.
*/