Ignore:
Timestamp:
2024-04-23T16:13:30+02:00 (6 weeks ago)
Author:
taylor.smock
Message:

See r19043: Drop COMPAT locale provider

The CLDR provider does not currently return the CET for GMT+01:00. Using only SPI
will result in the "correct" CET timezone abbreviation. If using both, CLDR wins
and returns GMT+01:00. In addition, there are locales that do not use the Western
Arabic numeral system. Specifically, Arabic uses the Eastern Arabic numeral
system, Persian uses the Urdu numeral system, and Marathi uses the Devanagari
numeral system. Of note, while the first character for the Eastern Arabic and
Urdu numeral systems looks the same, it is a different character.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java

    r18870 r19054  
    160160
    161161        setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
    162         assertEquals("1:00:00 AM CET", DateUtils.formatTime(new Date(0), DateFormat.LONG));
     162        assertEquals("1:00:00 AM GMT+01:00", DateUtils.formatTime(new Date(0), DateFormat.LONG), "This is mostly dependent upon java.locale.providers. CET is also OK.");
    163163    }
    164164
     
    308308        }
    309309    }
     310
     311    /**
     312     * Some Java version use narrow no-break space ("NNBSP") instead of a space.
     313     * @param time The time string with NNBSP instead of a space
     314     * @return The time with spaces instead of NNBSP
     315     */
     316    private static String replaceWhitespace(String time) {
     317        return time.replace((char) 8239 /* "NNBSP" */, ' ');
     318    }
    310319}
Note: See TracChangeset for help on using the changeset viewer.