#include "unicode/uchar.h"
#include "unicode/udat.h"
#include "unicode/ustring.h"
+#include "unicode/utf16.h"
#include "tzgnames.h"
#include "cmemory.h"
#include "cstring.h"
#include "uvector.h"
#include "zonemeta.h"
#include "tznames_impl.h" // TextTrieMap
+#include "patternprops.h"
U_NAMESPACE_BEGIN
if (fieldType == GMTOffsetField::TEXT) {
const UChar* patStr = field->getPatternText();
len = u_strlen(patStr);
+ if (i == 0) {
+ // When TimeZoneFormat parse() is called from SimpleDateFormat,
+ // leading space characters might be truncated. If the first pattern text
+ // starts with such character (e.g. Bidi control), then we need to
+ // skip the leading space charcters.
+ if (!PatternProps::isWhiteSpace(text.char32At(idx))) {
+ for (;;) {
+ UChar32 ch;
+ int32_t chLen;
+ U16_GET(patStr, 0, 0, len, ch)
+ if (PatternProps::isWhiteSpace(ch)) {
+ chLen = U16_LENGTH(ch);
+ len -= chLen;
+ patStr += chLen;
+ }
+ else {
+ break;
+ }
+ }
+ }
+ }
if (text.caseCompare(idx, len, patStr, 0) != 0) {
failed = TRUE;
break;
Locale("en"),
Locale("en_CA"),
Locale("fr"),
- Locale("zh_Hant")
+ Locale("zh_Hant"),
+ Locale("fa")
};
const Locale *LOCALES;
if (uprv_strcmp(LOCALES[locidx].getLanguage(),"ccp")==0 && logKnownIssue("13366", "Skip handling ccp until TimeZone offset roundtrip is fixed")) {
continue;
}
- if (uprv_strcmp(LOCALES[locidx].getLanguage(),"fa")==0 && logKnownIssue("13374", "Skip handling fa until TimeZone offset roundtrip is fixed")) {
- continue;
- }
UnicodeString localGMTString;
SimpleDateFormat gmtFmt(UnicodeString("ZZZZ"), LOCALES[locidx], status);
if (U_FAILURE(status)) {
if (TEST_ALL || TestFmwk.getExhaustiveness() > 5) {
LOCALES = ULocale.getAvailableLocales();
} else {
- LOCALES = new ULocale[] {new ULocale("en"), new ULocale("en_CA"), new ULocale("fr"), new ULocale("zh_Hant")};
+ LOCALES = new ULocale[] {new ULocale("en"), new ULocale("en_CA"), new ULocale("fr"), new ULocale("zh_Hant"), new ULocale("fa")};
}
String[] tzids;