Commit graph

23040 commits

Author SHA1 Message Date
Shane F. Carr
cd3721697a ICU-21654 Fix skeleton output for rounding increment in C++
See #1813
2021-09-14 01:55:58 -05:00
Frank Tang
ff8516b0dd ICU-20870 Fix breakage on UCONFIG_NO_FORMATTING 2021-09-13 20:21:13 -07:00
Peter Edberg
0da0fabfae ICU-20870 If locale/lang name lookup fails, canonicalize lang and try again 2021-09-13 09:50:33 -07:00
Rich Gillam
c37ca411fc ICU-13353 Fixed several problems preventing horizontal resource inheritance from working as intended, and added a
Java version of a unit test I'd previously only added on the C++ side.
2021-09-10 12:47:15 -07:00
Rich Gillam
b38a49fc7e ICU-21735 Fixed two old references to UNUM_CURRENCY_CASH, one in a comment, one in a unit-test failure message--
to refer to the now-correct UNUM_CASH_CURRENCY.
2021-09-09 14:27:10 -07:00
Peter Edberg
7851f708a3 ICU-21581 integrate CLDR release-40-alpha3 to ICU trunk 2021-09-09 10:57:21 -07:00
Andy Heninger
0ec329c6e1 ICU-21662 Improve UVector error handling.
This is the next installment of UVector error handling cleanup. It includes:

- Revise UStack to follow the conventions of UVector, to leave the stack
  unmodified when there is an incoming error code. And, for stacks with a
  deleter function, to delete the incoming object if it cannot be
  succesfully pushed.

 - Review all useage of UStack in ICU; adjust call sites as needed.

 - Review all uses of UVector::addElementX() in the implementation of
   - Regular Expressions
   - Break Iteration
   - toolutil/xmlparser

   changing to the updated functions, and adjusting call sites as needed.
2021-09-08 17:24:52 -07:00
Younies
e03dce66ef ICU-21730 Port testGetPreferencesFor ICU4C tests to ICU4J
See #1850
2021-09-08 23:30:18 +02:00
Shane F. Carr
92db25165f ICU-21545 Add icuwriteuprops tool
See #1741
2021-09-08 15:27:43 -05:00
Markus Scherer
f9beb616a8 ICU-21652 add emoji properties of strings
- 7 new properties: API constants & property names
- u_stringHasBinaryProperty(s, property) & UCharacter.hasBinaryProperty(s, property)
- two additional source data files
- new genprops part for writing new binary data file uemoji.icu
- data for existing emoji properties moved from uprops.icu (hardcoded in C++) to uemoji.icu (always loaded)
- new EmojiProps implementation
2021-09-08 12:15:50 -07:00
Peter Edberg
6244d57559 ICU-21685 In list of currencies from ucurr_openISOCurrencies(): add VES, remove EQE 2021-09-08 10:49:14 -07:00
Peter Varga
1986dcd0d8 ICU-21734 Add missing overrides 2021-09-07 17:42:14 -07:00
Peter Varga
90ee0c788f ICU-21734 Add missing overrides to pure virtual methods
These methods are pure virtual in the base class too.
2021-09-07 15:34:48 -07:00
Peter Varga
80d42a13fc ICU-21734 Add missing overrides in tests 2021-09-07 13:56:33 -07:00
Rich Gillam
19b8b076f9 ICU-20992 Added new API for iterating child resources while following aliases, and changed DateTimePatternGenerator
to use it.
2021-09-03 12:47:24 -07:00
Rich Gillam
01e1adc9e4 ICU-21460 Changed the ULocale initializers to allow locale IDs that use BCP47 syntax, but with '_' as a field delimiter.
(APIs that specifically require BCP47 syntax are unaffected-- they still require '-').
2021-09-03 12:47:02 -07:00
yumaoka
369357aaa7 ICU-21530 Added U_HIDE_DEPRECATED_API to deprecated methods. 2021-09-03 09:04:54 -04:00
Andy Heninger
081cf77330 ICU-21662 Improve UVector error handling.
- Add updated versions of UVector::addElement() and ensureCapacity() that respect
  incoming errors.
  Follow on to c26aebe, which renamed the original versions.

- Add UVector::adoptElement() as a replacement for addElement() when the vector
  has a deleter function set, meaning that it adopts ownership of its elements.

  The intent is to make the behavior clearer at the call sites when looking
  at unfamiliar code.

- Make all functions with an incoming failure, as indicated by a UErrorCode parameter,
  leave the vector unchanged.

- Change all functions that store object pointers into the vector such that,
  when the store cannot be completed for any reason _and_ the vector has a deleter function,
  then the incoming object is deleted.

  This change can simplify the error handling code around calls to the affected functions
  (addElement() and insertElementAt(), in particular)

- Add index bounds checking on functions where it was possible - that is, on functions
  with both U_ErrorCode and index parameters.

- Changed to more modern C++ idioms in some parts of the UVector implementation.

- Review & update as required all uses of the UVector functions
  setElementAt(), insertElementAt(), setSize(), sortedInsert()
  these being the functions with changed behavior on error conditions
  (aside from addElement()).

This PR will be followed by more, switching call sites in various ICU services
from UVector::addElementX() (old behavior on errors)
to   UVector::addElement()  (new behavior on errors)
2021-09-02 19:15:36 -07:00
Younies Mahmoud
33e1d87041 ICU-21551 Fixing unit prefix normalization order to match LDML spec
See #1754
2021-09-02 12:23:33 +02:00
Jeff Genovy
08dbf093ce ICU-21747 Upgrade WarningsAsErrors build bot to Clang-13 on Ubuntu 20.04 2021-09-01 17:04:42 -07:00
Peter Edberg
bbd72fb93e ICU-21581 integrate CLDR release-40-alpha2 to ICU trunk 2021-09-01 16:49:45 -07:00
Markus Scherer
e121dde220 ICU-20769 getAliasTargetAsResourceBundle() only needs ResourceData 2021-09-01 13:56:11 -07:00
Jeff Genovy
cb351ee077 ICU-21740 Output source code line when an error occurs when building with MSVC. 2021-09-01 11:48:17 -07:00
Jeff Genovy
b10a467212 ICU-21579 Fix compiler warnings with MSVC. 2021-08-31 14:03:21 -07:00
Younies
f811ae946f ICU-21730 Check unit aliases support.
See #1804
2021-08-31 18:34:12 +02:00
Markus Scherer
a300d8dd02 ICU-20769 refactor UResourceBundle.fResData & init_resb_result()
- replace UResourceBundle.fResData with access via fData
- change ResourceDataValue.resData into a pointer
- move C tests to C++ that stack-allocate now-C++ UResourceBundle
- init_resb_result():
  - remove redundant ResourceData parameter
  - simplify memory management, and various small simplifications
  - /LOCALE/path reuse valid locale, no ures_open()
  - pull alias-fetching code into separate function getAliasTargetAsResourceBundle()
  - `const char *` for keyPath pieces
  - s/noAlias/recursionDepth/
- getAllItemsWithFallback() set correct parentBundle.fValidLocaleDataEntry
2021-08-31 02:26:33 +00:00
Jeff Genovy
5b96c2e847 ICU-21710 Additional clean up after removing BOYER_MOORE code from usearch.cpp
Changes:
- We can completely remove the shift tables and related fields from
  data structs.

- Creation of UStringSearch objects should be faster now,
  as it doesn't waste time computing the unused shift tables.

- The sizeof(UStringSearch) is decreased from 5240 to 3192, so
  this should help to reduce memory for applications that create many string search objects.

Note regarding the comments on initialize(). It actually does not set illegal argument error if pattern is all ignoreables. Added a test case for it.
2021-08-30 15:08:16 -07:00
Erik Torres
2b895a71e1 ICU-21555 Fix typos in repo from letter d to i
Fix typos in repo from letter d to i
2021-08-30 16:45:43 -05:00
Fredrik Roubert
0a1cfa398c ICU-20973 Use standard keywords true & false to initialize type bool.
Now when all equality operators return standard bool (commit 633438f),
it no longer makes any sense to use the ICU4C constants TRUE & FALSE
or local variables of type UBool for their return value.
2021-08-26 18:53:10 +02:00
Jeff Genovy
6d850be783 ICU-21710 Remove BOYER_MOORE dead code from usearch.cpp 2021-08-25 19:48:17 -07:00
Jeff Genovy
9ddda243d7 ICU-21705 ICU-21706 Fix crash if ICU's default locale has BCP47 Unicode Extensions, and fix ures_openDirect crash with NULL locale ID.
Add test case for ures_openDirect with NULL locale ID.
2021-08-25 19:47:15 -07:00
Fredrik Roubert
3534d337c6 ICU-20973 Rewrite polymorphic CacheKeyBase equality operators for C++20.
The existing polymorphic equality operators that use different types for
the `this` and `other` objects are ambiguous with C++20 resolution rules
that require equality for reversed arguments.

In order to resolve that, while also possibly making the implementation
somewhat simpler overall, the implementation classes (LocaleCacheKey
and DateFmtBestPatternKey) now get normal (non-polymorphic) equality
operators that are trivially non-ambiguous (and as a bonus also don't
need any type casts), while the dynamic type checking logic is moved
into protected helper functions, which in the end are invoked
(without any ambiguity) by friend operators in the base class.

This way, all equality testing of cache key objects ends up taking one
of these two possible paths:

1. Both sides of the equality operator are of the same implementation
   type (ie. LocaleCacheKey or DateFmtBestPatternKey):

   The type specific equality operator is called directly, comparing the
   relevant attributes of the two objects directly.

2. The two sides of the equality operator are either of different types
   or of some base class type:

   The friend equality operators of CacheKeyBase call the virtual helper
   function to figure out whether the two objects are actually of the
   same type and if they are and this type is an implementation type
   then does the necessary type cast to get to 1.
2021-08-26 00:12:04 +02:00
Shane F. Carr
c12c5b5a4c ICU-21215 Add default constructor to FormattedNumberRange 2021-08-25 13:34:48 -05:00
Shane F. Carr
8cd025bb9c ICU-21590 Add skeleton syntax for integer-width-trunc 2021-08-25 12:51:51 -05:00
Markus Scherer
486e2d36ac ICU-21648 limit backslash-uhhhh escapes to ASCII hex digits 2021-08-25 17:04:24 +00:00
Markus Scherer
ae3f2ae7ca ICU-21663 UnicodeSetIterator: make protected members private 2021-08-25 00:51:14 +00:00
Shane F. Carr
e2acbdee22 ICU-21693 Fix FormattedNumber::toDecimalNumber on 0 2021-08-23 21:10:07 -05:00
Markus Scherer
41aa7159ea ICU-21635 Unicode 14 data files 20210820, line break LB30b.2
See #1807
2021-08-23 22:11:49 +00:00
Peter Edberg
7e07633997 ICU-21581 lingering exhaustive fail, need to separately skip sd_Deva month name exemplar test 2021-08-19 22:09:48 -07:00
Peter Edberg
f6d47953c0 ICU-21581 integrate CLDR release-40-alpha1 to ICU trunk 2021-08-19 15:27:38 -07:00
Shane F. Carr
4e01fba906 ICU-21358 Use sign position to format approximate numbers
See #1635
2021-08-19 16:18:19 -05:00
Peter Edberg
49dda34fb1 ICU-21581 integrate CLDR 40a0 to ICU trunk 2021-08-18 23:59:19 -07:00
Fredrik Roubert
51c11da869 ICU-20973 Delete unnecessary deprecated TimeUnitFormat::operator!=().
An operator!=() is already defined by a base class so this class doesn't
need to define it again and not doing so avoids a C++20 ambiguity.

This simplifies the code.
2021-08-19 01:22:48 +02:00
Frank Tang
126af02948 ICU-21729 Fix setLanguageTag doc matching Java 2021-08-18 16:16:10 -07:00
Rich Gillam
1ec55bf021 ICU-21202 Fixed error in alias resolution in uresbund.cpp. 2021-08-18 10:12:20 -07:00
Fredrik Roubert
88896d005d ICU-20973 Update configure files from configure.ac using autoreconf. 2021-08-17 00:35:00 +02:00
Fredrik Roubert
dc1b8ca26e ICU-20973 Use the Clang -Wno-ambiguous-reversed-operator flag. 2021-08-17 00:35:00 +02:00
Fredrik Roubert
2166b512fc ICU-20973 Manually resolve C++20 reversed argument order ambiguity. 2021-08-17 00:35:00 +02:00
Fredrik Roubert
633438f8da ICU-20973 Change all equality operator return types from UBool to bool. 2021-08-17 00:35:00 +02:00
Gregorio Litenstein
ee7468a565 ICU-21064 Fix declspec macro conflict on clang. 2021-08-16 11:06:46 -07:00