Commit graph

30285 commits

Author SHA1 Message Date
Shane Carr
25cdf71e5c ICU-11276 Replying to code review comments. 2018-09-14 19:08:11 -07:00
Shane Carr
4821f614a4 ICU-11276 Fixing Javadoc warnings in NumberRangeFormatter. 2018-09-14 19:08:11 -07:00
Shane Carr
33c681cb44 ICU-11276 Feedback from ICU-TC. Fixing doxygen warnings. 2018-09-14 19:08:11 -07:00
Shane Carr
a474b70ad2 ICU-11276 Adding C++ base implementation of NumberRangeFormatter, including unit test. 2018-09-14 19:08:11 -07:00
Shane Carr
45d40a9275 ICU-11276 Fixing typos in numberformatter.h 2018-09-14 19:05:13 -07:00
Shane Carr
ba0f540ea7 ICU-11276 Assorted Java NumberRangeFormatter API improvements. 2018-09-14 19:05:13 -07:00
Shane Carr
efb9934b9b ICU-11276 Adding initial header files for NumberRangeFormatter. 2018-09-14 19:05:13 -07:00
Shane Carr
62c804f8f7 ICU-11276 Adding enums and more API docs. 2018-09-14 19:05:13 -07:00
Shane Carr
9c4c5268fd ICU-11276 Adding placeholder implementation and more API functions. 2018-09-14 19:05:13 -07:00
Shane Carr
97ee695614 ICU-11276 Adding initial Java NumberRangeFormatter boilerplate. 2018-09-14 19:05:13 -07:00
Fredrik Roubert
a90ef6c6f1
ICU-13645 Clean up implementation of Locale::operator=(const Locale&).
Organizing the implementation like this instead will (hopefully) make it
more clear what's being done and make it possible to use analogous
control flow in the copy and move implementations of operator=().
2018-09-14 17:17:29 -07:00
Fredrik Roubert
ebd8d90522
ICU-13417 Add the Locale::get(Unicode)?Keywords() functions.
They are C++ template wrappers around Locale::createKeywords() and
Locale::createUnicodeKeywords() respectively, that write to any
container for which an STL style output iterator can be provided.

The simplest imaginable usage would just look like this:

    std::string keys[16];
    l.getKeywords<std::string>(keys, status);

The unit test has a more elaborate invocation, writing to an std::set<>.
2018-09-14 17:12:06 -07:00
Fredrik Roubert
9451eee807 ICU-13417 Add the Locale::(addLikely|minimize)Subtags() functions.
They are C++ wrappers of uloc_addLikelySubtags() and uloc_minimizeSubtags()
respectively, that take care of dynamic memory management.
2018-09-14 14:26:18 -07:00
Fredrik Roubert
8cfd001b1a
ICU-13417 Add the Locale::(get|set)(Unicode)?KeywordValue() functions. 2018-09-14 14:25:35 -07:00
Fredrik Roubert
abde36096e ICU-13417 Improved error handling in Locale::create(Unicode)?Keywords().
Follow-up from pull request #117:

Specify buffer size in only one place, explicitly check status before
proceeding and set status = U_MEMORY_ALLOCATION_ERROR if new fails.
2018-09-14 14:08:42 -07:00
Fredrik Roubert
d86e0faaaa ICU-13417 Add the Locale::createUnicodeKeywords() function.
This is a wrapper of Locale::createKeywords() that under the hood calls
uloc_toUnicodeLocaleKey() for each key before returning it, so that the
caller won't have to do this.
2018-09-14 11:52:03 -07:00
Shane Carr
ce105b4565 ICU-20119 Small refactor to ICU4J travis file. 2018-09-13 20:08:12 -07:00
Andy Heninger
3605117c21
ICU-13801 Clarify Javadoc for BreakIterator.setText() (#69) 2018-09-13 12:46:17 -07:00
Fredrik Roubert
e71ae54e88
ICU-13417 Add the Locale::(for|to)LanguageTag() functions.
They are C++ wrappers of uloc_forLanguageTag() and uloc_toLanguageTag()
respectively, that take care of dynamic memory management.
2018-09-12 20:41:53 -07:00
Fredrik Roubert
6e903756da
ICU-13417 Add the internal helper class CharStringByteSink.
This is an implementation of the public ICU ByteSink interface that
writes to the ICU internal class CharString.
2018-09-12 20:40:14 -07:00
Markus Scherer
45364cbe77
ICU-20116 remove @deprecated from Edits.Iterator.toString() (#98)
but keep @internal
2018-09-12 20:11:26 -07:00
Yoshito Umaoka
61d446f710
ICU-12973 CLDR Japanese Era data and tentative Japanese new era support (#111)
* Updated era data format in supplementalData.

* Include tentative era names in data. Implemented Japanese era loaded from CLDR data in ICU4J.

* ICU4C implementation, ICU4C refactoring. WIP.

* VS project updates and some bug fixes

Also added API comments.

* Review feedback and bug fixes

- NULL to nullptr
- use of LocalUResourceBundlePointer
- TYPO "name" to "named"
- env var checking stricmp() == 0

* API comment correction based on feedback

* Duplicate the comment in ucal.h to calendar.h

* Fixed spelling errors in API comment
2018-09-12 17:13:30 -04:00
Jeff Genovy
0d047c390b
ICU-13812 Define U_FALLTHROUGH for GCC 7+ for ICU4C. (#100)
Currently U_FALLTHROUGH is not defined for GCC, meaning that any switch case statements with fall-throughs will generate warnings when building ICU4C.

In GCC 7, they added support for: "_attribute_((fallthrough))" which we can now use for U_FALLTHROUGH, which eliminates many warnings when building with GCC.
2018-09-12 10:17:35 -07:00
Jeff Genovy
b34b81f243
ICU-13687 ICU4C Enable Windows UWP version to use TZ update/override files. (#31)
Enable the Windows UWP version of ICU4C to use TZ update/override files (.res files) for out-of-band timezone data updates. Also use the *W version of the Windows APIs to avoid code-page conversion.
2018-09-11 09:42:49 -07:00
jungshik
f64725cc75 ICU-20098 Fix BCP47 validity check for extlang and privateuse singleton (#102)
* ICU-20098 Fix the validty check for extlang in uloc_forLanguageTag

BCP 47 has the following for language. extlang subtag can only be
preceded by 2*3ALPHA. Add a check for the length of language subtag
before extlang subtag.

language      = 2*3ALPHA            ; shortest ISO 639 code
                 ["-" extlang]       ; sometimes followed by
                                     ; extended language subtags
               / 4ALPHA              ; or reserved for future use
               / 5*8ALPHA            ; or registered language subtag

 extlang       = 3ALPHA              ; selected ISO 639 codes
                 *2("-" 3ALPHA)      ; permanently reserved}}

With this change, 'hant-cmn-CN' would drop '-cmn-CN' keeping only
'hant'.

* ICU-20098 Fix the validty check for extlang for ICU4J

* ICU-20098 Fix the compiler failure for ICU4J

* ICU-20098 Fix a compile error and test.

* ICU-20098 Add a test for invalid private use  singleton

ICU4C's check for private use singleton subtag ('x') is wrong and
treats invalid language tags as valid.

ICU4J's check is correct and does not require any change.

Fix that and add tests to both ICU4C and ICU4J.
2018-09-11 02:45:14 -04:00
David Corbett
185ef18550 ICU-12979: Fix \Q...\E in UnicodeRegex#transform (#23) 2018-09-10 15:19:10 -07:00
Frank Tang
1a6f0bf768
ICU-13754 Add a ListFormatter FieldPositionIterator format method (#109)
ICU-13754 Reapply PR#106 after sffc rewinding master it.
2018-09-09 19:14:16 -07:00
William Zhao
77270de4cd
ICU-20103 Using GetLocaleInfoEx to get user default locale instead of using language for UWP app. (#86)
This pull request is to remove COM dependency in ICU, so that ICU does not need to care about if the caller is a UWP or not.
2018-09-07 13:59:03 -07:00
Andy Heninger
2988a497a9
ICU-13834 add pinCapacity() for safer output buffer capacity checking. (#105)
* ICU-13834 add pinCapacity() for safer output buffer capacity checking.

* ICU-13834 pinCapacity, fix typo in comment.
2018-09-07 13:42:21 -07:00
Markus Scherer
5e3cdcc028
ICU-20086 C++ sets & maps for Unicode properties (#93)
also create ucpmap.h from renamed parts of ucptrie.h
2018-09-07 13:40:19 -07:00
Jeff Genovy
43538a806e
ICU-20017 Fix line endings in Visual Studio *.props files. (#101) 2018-09-06 18:45:18 -07:00
Frank Tang
9138467908 ICU-20022 support quarter in RelativeDateTimeFormatter (#77)
also add UDAT_ABSOLUTE_QUARTER to UDateAbsoluteUnit
2018-09-06 16:47:50 -07:00
Andy Heninger
e126a2c42b
ICU-8151 Simplify Finnish Line Break Tailoring, move to root. (#99) 2018-09-06 14:23:28 -07:00
Frank Tang
23247dc9d5 ICU-13754 Move listformatter from common to i18n (#96) 2018-09-06 13:31:40 -07:00
Paul Smith
ff726ccbdf ICU-20027: Support parallel builds with MSYS/MSVC and Cygwin/MSVC (#104) 2018-09-06 12:20:43 -07:00
Victor Chang
ad15cb3d00 ICU-13808 Document ArithmeticException thrown by DecimalFormat
- Document the exception in the following methods
setMultiplier, setMathContext, setMathContextICU
- Add test to check the documented behavior
2018-09-06 12:01:59 -07:00
Shane Carr
55ecf77306 ICU-20110 Adding const to FormattedNumber#appendTo 2018-09-05 11:19:05 -07:00
Markus Scherer
e59a297a7a
ICU-8966 ICU-12850 add API/data/code for text layout properties InPC, InSC, vo (#92)
ICU-8966: Indic_Positional_Category & Indic_Syllabic_Category

ICU-12850: Vertical_Orientation
2018-08-31 19:23:52 -07:00
Jeff Genovy
49443f7d6f
ICU-13712 ICU4C does not report OOM if it fails to memory map the data file(s) (#30)
ICU does not report Out-Of-Memory (OOM) if it fails to memory map the data file(s) when calling the various platform API(s) to do so.

When you are using ICU with memory-mapped data file(s), and ICU fails to map the data file due to being out-of-memory, it does not bubble this failure up to the API that was called. You will instead get back the error U_MISSING_RESOURCE_ERROR, rather than U_MEMORY_ALLOCATION_ERROR, which might be a bit surprising to the caller of the API. This can lead to the application thinking that there are no resources for "en_US" or "en" (or even "root").

This change modifies ICU4C so that it will report back U_MEMORY_ALLOCATION_ERROR if OOM happens when attempting to load the data files.
2018-08-29 18:50:50 -07:00
gnrunge
207367d1bc
Merge pull request #75 from gnrunge/langmatcher
ICU-20092 Integrates new languagematcher enhancements into ICU4J.
2018-08-29 16:24:40 -07:00
Fredrik Roubert
a49b456ec0 ICU-20006 Parameterize the TestSourceTargetSet2 test case.
By extracting this test case into a separate class and separating the
complex and time consuming building of the UnicodeSet disorderedMarks
data structure into an @BeforeClass shared setup method it becomes
possible to test the 18 different transliteration rules as a
parameterized test case.

This will lower the running time per test case and also aid in debugging
as it will make it immediately obvious which transliteration rules cause
test failures (and which don't).
2018-08-29 21:18:54 +02:00
Fredrik Roubert
a01bad5888 ICU-13483 Use a real time zone to make tests work in Android.
When running in Android, java.util.TimeZone.getDefault() will only
return a TimeZone object for a time zone that actually exists, so when
passing a bogus test TimeZone object to setDefault() and afterwards
calling getDefault() it won't return that same time zone.

Changing our tests to instead use a real existing (but otherwise unused)
time zone instead makes the tests work in Android as well.

Neither of these tests was testing the ability to set an arbitrarily
made up time zone as the default, so no test coverage is lost.
2018-08-29 21:18:30 +02:00
Markus Scherer
617c744867
ICU-13530 fix doxygen warnings: hide internals, hide struct/enum typedefs, avoid fwd+real struct decl (#84) 2018-08-28 15:07:03 -07:00
Markus Scherer
266460a3cd
ICU-13530 fix bugs, add tests, clarify docs (#83)
* ICU-13530 test & fix cptrie.getRange() when small null data block matches the start of a non-null fast data block

* ICU-13530 fix test bug

* ICU-13530 test & fix bug calculating worst-case data array capacity at start of compaction

* ICU-13530 docs: clarify buildImmutable() discards upper bits, trie then returns unsigned ints; range iteration slower than if ranges were stored directly

* ICU-13530 accept feedback on docs
2018-08-28 12:53:34 -07:00
Andy Heninger
28784c1666
ICU-13844 Regex unicode properties, add IsXXX forms for Java compatib… (#61)
* ICU-13844 Regex unicode properties, add IsXXX forms for Java compatibility.

* ICU-13844 Regex Property Review fixes from Markus.
2018-08-28 11:15:51 -07:00
Markus Scherer
2bc7b8dcfd
ICU-13530 add ucptrie.h & umutablecptrie.h to docmain.h (#72) 2018-08-27 14:57:22 -07:00
Markus Scherer
32d0a65a12
ICU-13530 CodePointMap docs fix s/trie/map/ (#73) 2018-08-27 14:41:13 -07:00
Andy Heninger
645f7cfa72
ICU-11637 Thread sanitizer added to Travis build. (#81) 2018-08-24 17:45:22 -07:00
Andy Heninger
0290f6e900
Merge pull request #80 from aheninger/ICU-13664
ICU-13664 RBBI, add regression test for reported problem. #80
2018-08-24 16:27:10 -07:00
Andy Heninger
d8ee84f00c ICU-13664 RBBI, add regression test for reported problem (already fixed.) 2018-08-24 15:41:59 -07:00