mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-13209 Made Islamic calendar subtype detection code case insensitive.
X-SVN-Rev: 40456
This commit is contained in:
parent
fa2ddc86c7
commit
9c70152d45
2 changed files with 19 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package com.ibm.icu.impl;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.TreeMap;
|
||||
|
@ -17,7 +18,7 @@ import com.ibm.icu.util.UResourceBundle;
|
|||
|
||||
/**
|
||||
* Calendar utilities.
|
||||
*
|
||||
*
|
||||
* Date/time format service classes in com.ibm.icu.text packages
|
||||
* sometimes need to access calendar internal APIs. But calendar
|
||||
* classes are in com.ibm.icu.util package, so the package local
|
||||
|
@ -40,7 +41,9 @@ public final class CalendarUtil {
|
|||
public static String getCalendarType(ULocale loc) {
|
||||
String calType = loc.getKeywordValue(CALKEY);
|
||||
if (calType != null) {
|
||||
return calType;
|
||||
// Convert to lower case, because getKeywordValue does not
|
||||
// canonicalize keyword value.
|
||||
return calType.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
// Canonicalize, so grandfathered variant will be transformed to keywords
|
||||
|
|
|
@ -1015,6 +1015,20 @@ public class IslamicTest extends CalendarTestFmwk {
|
|||
errln("non civil calc type generated - " + thisCalcType);
|
||||
}
|
||||
|
||||
islamicLoc = new ULocale("ar_SA@calendar=ISLAMIC-UMALQURA");
|
||||
is_cal = new IslamicCalendar(islamicLoc);
|
||||
thisCalcType = is_cal.getType();
|
||||
if (!"islamic-umalqura".equalsIgnoreCase(thisCalcType)) {
|
||||
errln("non umalqura calc type generated - " + thisCalcType);
|
||||
}
|
||||
|
||||
islamicLoc = new ULocale("ar_SA@calendar=ISLAMIC-CIVIL");
|
||||
is_cal = new IslamicCalendar(islamicLoc);
|
||||
thisCalcType = is_cal.getType();
|
||||
if (!"islamic-civil".equalsIgnoreCase(thisCalcType)) {
|
||||
errln("non civil calc type generated - " + thisCalcType);
|
||||
}
|
||||
|
||||
islamicLoc = new ULocale("ar_SA@calendar=islamic-tbla");
|
||||
is_cal = new IslamicCalendar(islamicLoc);
|
||||
thisCalcType = is_cal.getType();
|
||||
|
|
Loading…
Add table
Reference in a new issue