Commit graph

24103 commits

Author SHA1 Message Date
Tim Chevalier
724e658440 Fix use-after-free in TimeZoneDelegate destructor 2025-03-04 19:35:40 -08:00
Tim Chevalier
ea93684e24 Share DateFormat objects across threads 2025-03-04 19:35:08 -08:00
Tim Chevalier
b2ae9f8b5d Add comment on hasTzOffset() 2025-03-04 19:34:46 -08:00
Tim Chevalier
d45f9e9b8e Cache DateFormat objects in the DateTimeFactory object and lazily initialize them 2025-03-04 19:34:46 -08:00
Tim Chevalier
6c20aea7c5 Detect 'Z' literal correctly; add test case 2025-03-04 19:34:46 -08:00
Tim Chevalier
908dfc0b3b Remove calendar name harder 2025-03-04 19:34:46 -08:00
Tim Chevalier
799a47abaa Removed calendarName field from DateInfo 2025-03-04 19:34:46 -08:00
Tim Chevalier
6e941b7627 Add clarifying comments to DateInfo struct; rename zoneName field to zoneId 2025-03-04 19:34:46 -08:00
Tim Chevalier
0dd6d30777 Address review feedback 2025-03-04 19:34:46 -08:00
Tim Chevalier
73b3f85c13 Add comment about meaning of calendarName 2025-03-04 19:34:46 -08:00
Tim Chevalier
6d9d8a2b18 Make createTimeZone() a static method instead of a method on DateInfo 2025-03-04 19:34:46 -08:00
Tim Chevalier
dea6034c66 Fix MSVC compilation errors 2025-03-04 19:34:46 -08:00
Tim Chevalier
325474c454 Fix doc comment 2025-03-04 19:34:46 -08:00
Tim Chevalier
93637ddfc5 Avoid creating time zone where not necessary 2025-03-04 19:34:45 -08:00
Tim Chevalier
4b6f5171b9 Add comments 2025-03-04 19:34:45 -08:00
Tim Chevalier
002f9b2425 Fix comment 2025-03-04 19:34:45 -08:00
Tim Chevalier
e50813438f Remove obsolete comment 2025-03-04 19:34:45 -08:00
Tim Chevalier
c0b6c0d16b Docs 2025-03-04 19:34:45 -08:00
Tim Chevalier
2c97c1273f Eliminate GregorianCalendar usage 2025-03-04 19:34:45 -08:00
Tim Chevalier
c42fe17a3a Tests pass with new DateInfo struct 2025-03-04 19:34:44 -08:00
Tim Chevalier
f8c67ece8b ICU-22763 MF2: Handle time zones correctly in :datetime
Previously, the time zone components of date/time literals were ignored.
In order to store the time zone properly for re-formatting,
this change also changes the representation of `Formattable` date
values to use a `GregorianCalendar` rather than a `UDate`.
(This is a public API change.)
2025-03-04 19:34:14 -08:00
Tim Chevalier
0748442ed6 ICU-23059 ICU4C MF2: Update spec tests
This updates the MF2 spec tests to 943479b602 with the following exceptions:

- functions/currency.json and functions/math.json are omitted because these are not yet implemented

- bidi.json will be handled in a future PR

- u-options.json will be handled in a future PR

Changes include:
* `:integer` now returns a value encapsulating the rounded numeric value of the argument, rather than
  the value itself.
* Fallbacks are handled according to the current spec.
* Fallback values are not passed into functions.
* Characters inside literal fallbacks are properly escaped.
* The test runner skips null values properly.
* The test runner handles boolean `expErrors` in defaultTestProperties.
* `:string` normalizes its input and normalizeNFC() has been refactored so it can be called there.
2025-02-25 12:24:07 -08:00
sven-oly
1b48d262c2 ICU-22922 Scrubbing closed issues
See #3399
2025-02-21 11:24:10 -08:00
Mihai Nita
6cc1618136 ICU-22922 ICU4C produce search doxygen doc by default 2025-02-21 10:09:51 -08:00
sven-oly
cfc208f546 ICU-22922 ICU4C RC APIChangeReport updates 2025-02-19 16:50:14 -08:00
Mihai Nita
d69d452382 ICU-22922 BRS_77_RC: Update version number to 77.1-SNAPSHOT 2025-02-19 15:59:57 -08:00
Robin Leroy
215131c1a4 ICU-22984 Remove some obnoxious tests from 2003 2025-02-19 23:30:34 +01:00
Fredrik Roubert
61b2dbc980 ICU-22901 Replace fixed size buffer with CharString. 2025-02-14 21:42:22 +01:00
Fredrik Roubert
7da5e90a3d ICU-22901 Update Locale::init() to use StringPiece. 2025-02-14 20:52:40 +01:00
Younies Mahmoud
3c85be19ec ICU-22781 Uncomment and enable constant denominator tests
See #3385
2025-02-14 10:34:51 +01:00
Fredrik Roubert
3f5fd0df73 ICU-22901 Update ulocimp_canonicalize() &co. to use std::string_view. 2025-02-13 15:50:54 +01:00
Fredrik Roubert
afa06d2bcd ICU-22901 Update _canonicalize() to use std::string_view. 2025-02-13 15:50:54 +01:00
Fredrik Roubert
5463eac8b4 ICU-22901 Update ulocimp_getKeywords() to use std::string_view. 2025-02-13 15:50:54 +01:00
Fredrik Roubert
aa724e1e3f ICU-22901 Move calls to uloc_getDefault() out of _canonicalize(). 2025-02-13 15:50:54 +01:00
Fredrik Roubert
83726260ef ICU-23031 Reinstate special case for "-u-va-posix" lost by ICU-22520.
Inside of locimp_forLanguageTag() in _appendKeywords() in uloc_tag.cpp
there's a hardcoded special case for "-u-va-posix" which appends the
"_POSIX" variant but this was missed during the refactoring made for
ICU-22520 (there isn't any test case that covers this).

So the call to locimp_forLanguageTag() did more than previously
understood, but we still don't want to have to call that for every
language tag that has BCP-47 extensions just in order to get to this
special case. Instead, add a special case also to ulocimp_getSubtags().

For this to work nicely, the loop in _getVariant() that copies variants
needs to be refactored so that it easily can break when encountering the
start of any BCP-47 extension (which also has the welcome side-effect of
making it more efficient, being able to append an entire variant at once
to the output sink).

This was broken by commit 678d5c1273.
2025-02-13 08:50:17 +01:00
Frank Tang
59719f09d9 ICU-22934 Fix typo in PR#3230
ICU-22934 Fix error handling while new return nullptr

ICU-22934 Simplfied

ICU-22934 more

ICU-22934 fix leak
2025-02-12 16:56:20 -08:00
David Barts
b81956ebcc ICU-22808 Correct a factually incorrect doc comment. 2025-02-12 16:37:33 -08:00
Younies Mahmoud
e20b71af50 ICU-22781 Add CLDR-18274 failing comments to portion unit formatting tests
See #3393
2025-02-12 23:12:13 +01:00
Younies Mahmoud
35c9778781 ICU-22781 Support Arbitrary Constant Unit Formatting
See #3381
2025-02-12 01:45:16 +01:00
Frank Tang
59af52bb6f ICU-23043 Propogate error in Calendar. 2025-02-11 15:14:27 -08:00
Younies Mahmoud
42e3b43c78 ICU-22781 Add test for portion format with parts per billion (C++)
See #3389
2025-02-11 23:37:53 +01:00
Mihai Nita
84599e1117 ICU-22781 Comment out the failing tests 2025-02-10 10:46:19 -08:00
Mihai Nita
339ebb368f ICU-22781 Data generated with the concentr/perbillion on, code update
Following the steps in docs/processes/release/tasks/updating-measure-unit.md
2025-02-10 10:46:19 -08:00
Mihai Nita
fe4549dc62 ICU-22781 Data generated with the concentr/perbillion on, tests 2025-02-10 10:46:19 -08:00
Mihai Nita
19458b75f4 ICU-22781 Data generated with the concentr/perbillion on, ICU4C 2025-02-10 10:46:19 -08:00
Mihai Nita
5ae7f068b1 ICU-23042 CLDR-to-ICU, generate rbnf data for Gujarati 2025-02-08 21:55:43 -08:00
Tim Chevalier
7b8110f003 ICU-22907 MF2: Finish updating spec tests and implement required test functions
Implement :test:format, :test:select, and :test:function, which are
required by the new `pattern-selection.json` tests.

Change the internal value representation in the formatter in order to
support some of the test cases (binding the results of selectors to a
variable).
2025-02-08 21:42:03 -06:00
Vladyslav Yeremeichuk
624a26030b ICU-22950 Do not initialize currency redundantly
resolveCurrency() slows down simple number formatting requests like:
for (int i = 0; i < 9999; i++) u_snprintf_u(buff, 100, u"%d", i);
Since we don't use currency here, we can skip its initialization.
2025-02-07 14:45:43 -08:00
Burkov Egor
40c325322e ICU-23035 Fix bound check at u_strToPunycode 2025-02-07 13:03:27 -08:00
Fredrik Roubert
db42c87936 ICU-22954 A build test for C++ header-only APIs with C++ APIs disabled. 2025-02-07 20:14:20 +01:00