ICU4J MessageFormat should not use java.text.ChoiceFormat

Description

Deleted Component: formatting

ICU4J does not have its own ChoiceFormat at all but just uses java.text.ChoiceFormat.

Aside from the difficulty of fixing issues with the ChoiceFormat implementation (e.g., autoQuoteApostrophe parsing, maybe common base class with PluralFormat & SelectFormat), this also means that all embedded arguments are formatted using the JRE behavior and locale data. So numbers, dates, times, currencies etc. could look different within a choice argument from without, and you couldn't nest ICU-specific plural and select arguments inside a choice argument.

We could add our own copy of ChoiceFormat to ICU4J, or have ICU4J MessageFormat handle a "choice" argument in other ways.

Activity

Show:
TracBot
July 1, 2018, 12:11 AM
Trac Comment 1 by —2010-08-26T22:11:02.441Z

Also, the ICU4C ChoiceFormat documentation says "The Unicode infinity sign ∞ (U+221E) is recognized for positive infinity. It may be preceded by '-' (U+002D) to indicate negative infinity." – but java.text.ChoiceFormat throws an exeption when I try to use ∞ (U+221E) in a limit.

TracBot
July 1, 2018, 12:11 AM
Trac Comment 5 by —2011-04-08T19:07:51.787Z

Part of ticket #8319 implementation.

We do not plan to add an ICU4J ChoiceFormat class. Instead, ICU 4.8 MessageFormat will handle choice/plural/select arguments itself, without creating Format objects for them.

Fixed

Assignee

Markus Scherer

Reporter

Markus Scherer

Components

None

Labels

None

Reviewer

None

Priority

medium

Time Needed

Days

Fix versions