Ticket #6491 (new defect)

SVN Diffs for #6491

 

Opened 3 weeks ago

Last modified 1 week ago

ucal_open accepts bogus time zone names with no error

Reported by: pedberg Assigned to: yoshito
Priority: assess Milestone: UNSCH
Component: unknown Version: 4.0
Keywords: Cc:
Load: Xref:
Java Version: Operating System:
Project (C/J): ICU4C Weeks:
Review:

Description

If ucal_open() is called with a bogus time zone ID such as "Q8" or "XZA61" it still returns a non-NULL UCalendar* and leaves the UErrorCode status as U_ZERO_ERROR (it it was U_ZERO_ERROR on entry). The only consequence is that the offsets corresponding to UCAL_ZONE_OFFSET and UCAL_DST_OFFSET are 0 in this case. If it was just a problem with obviously bogus time zone IDs such as those mentioned above it might not be so bad, but the same is true for time zone IDs such as "ET" or "PDT" that are plausible but not in the enumeration returned by ucal_openTimeZones(); it seems to accept these, but the offsets end up as 0. If it does not understand the time zone ID, it should return an error.

Attachments

Change History

08/07/08 15:02:02 changed by srl

Some ICU time zone APIs treat "bogus" as "GMT".

08/13/08 11:31:44 changed by srl

  • owner changed from somebody to yoshito.

JDK works this way. java.util.TimeZone

TimeZone::getCanonicalID and ucal_getCanonicalTimeZoneID will verify that an id is valid.

08/20/08 10:09:33 changed by pedberg

It would be helpful to have a comment in the ucal_open() documentation describing this behavior, and suggesting ucal_getCanonicalTimeZoneID() as a way of checking timezone validity.


Add/Change #6491 (ucal_open accepts bogus time zone names with no error)




Anti spam check: