Commit Graph

274 Commits

Author SHA1 Message Date
jungshik
4ed35d7bb5
ICU-20140 Allow duplicated keys in U-extension per RFC 6067 (#136)
* ICU-20140 Allow duplicated keys in U-extension per RFC 6067

RFC 6067 [1] does allow duplicate keywords, but ICU4C's
uloc_forLanguageCode rejects it as invalid.

Change it to accept duplicate keywords and honor only the
1st one while ignoring subsequent ones per RFC 6067.

[1] Unicode extension to BCP 47:
    https://tools.ietf.org/html/rfc6067

* ICU-20140 Add ICU4J test and tweak ICU4C test

ICU4J test diverges from ICU4C tests:

1. Handling of duplicate variants in ICU4J seem to be wrong:
   https://unicode-org.atlassian.net/browse/ICU-20148
2. ULocale.forLanguageTag only throws NullPointException so
   that ICU4C's test for duplicate attributes cannot be ported.
2018-09-27 14:27:40 -07:00
jungshik
5cfdf4a519
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-27 14:27:39 -07:00
Peter Edberg
3bfe134a86 ICU-13359 Integrate CLDR 32 alpha data into ICU for ICU 60rc; known issues #13366,#13368
X-SVN-Rev: 40463
2017-09-26 21:20:01 +00:00
Fredrik Roubert
a7123ed229 ICU-13094 Handle empty language subtag in parseTagString().
X-SVN-Rev: 40076
2017-04-26 20:12:01 +00:00
Peter Edberg
0f4572a7e6 ICU-13018 uloc_get/setKeywordValue have stricter input conditions; setKeywordValue uses CharString to assemble updated output
X-SVN-Rev: 39891
2017-03-21 23:08:37 +00:00
Peter Edberg
653750ca58 ICU-12969 protect against using negative ID for resource
X-SVN-Rev: 39654
2017-02-09 19:33:51 +00:00
Andy Heninger
242e02c388 ICU-12764 icu4c utf-8 source files, update Copyright notices.
X-SVN-Rev: 39583
2017-01-20 00:20:31 +00:00
Steven R. Loomis
d255867071 ICU-12752 IBM i now passes
X-SVN-Rev: 39326
2016-09-22 01:25:52 +00:00
Peter Edberg
f82d62a85c ICU-12729 CLDR release-30-d02 integration, merge icu4c branch into trunk
X-SVN-Rev: 39273
2016-09-19 05:09:40 +00:00
Steven R. Loomis
20f11347f7 ICU-12652 fix for null termination in uloc_acceptLanguageFromHTTP
X-SVN-Rev: 39109
2016-08-31 14:53:53 +00:00
Yoshito Umaoka
8a5b579dd2 ICU-12671 Fixed a problem in uloc_toLanguageTag. When LDML attribute is used withtout LDML keywords, the function did not prodce -u- at the right place. This change fixed the LDML attribute handling. The test cases in the ticket were integrated to cintltst.
X-SVN-Rev: 39076
2016-08-19 23:29:17 +00:00
Michael Ow
61607c2773 ICU-12564 Update copyright notice in trunk
X-SVN-Rev: 38848
2016-06-15 18:58:17 +00:00
Yoshito Umaoka
00ca13e126 ICU-12564 Reverted r38761 and r38762, because we want to prepend the Unicode copyright for existing source files, instead of replacing copyright comments.
X-SVN-Rev: 38776
2016-05-31 21:45:07 +00:00
Michael Ow
c9f199a30f ICU-12564 Update copyright notice in ICU4C
X-SVN-Rev: 38761
2016-05-26 22:32:17 +00:00
Fredrik Roubert
ebc0f5b22a ICU-12012 Replace all sizeof p / sizeof T with UPRV_LENGTHOF().
R=markus.icu@gmail.com

Review URL: https://codereview.appspot.com/288320043 .

X-SVN-Rev: 38347
2016-02-24 21:48:56 +00:00
Fredrik Roubert
7f4b8d106b ICU-12012 Replace all sizeof p / sizeof *p with UPRV_LENGTHOF().
R=markus.icu@gmail.com

Review URL: https://codereview.appspot.com/285520043 .

X-SVN-Rev: 38337
2016-02-23 10:40:09 +00:00
John Emmons
3af6ddd9d8 ICU-12170 Merge data from CLDR release-29-beta1
X-SVN-Rev: 38332
2016-02-23 02:26:57 +00:00
Peter Edberg
8c643b3395 ICU-12085 Update C TestToUnicodeLocaleType/TestToLegacyType for "rg"
X-SVN-Rev: 38315
2016-02-16 19:51:26 +00:00
Peter Edberg
086ee675a8 ICU-12085 manually integrate branch > trunk (had network problems committing updated branch)
X-SVN-Rev: 38311
2016-02-15 17:58:23 +00:00
Yoshito Umaoka
47a3db9eb6 ICU-11602 Fixed a wrong condition used for detecting keyword without value in uloc internal function for parsing keywords. TestKeywordVariants was updated to include a case hitting the code path. The test code was also updated to handle error status. A follow up ticket #11690 was created for recording some issues with the test case found in this time.
X-SVN-Rev: 37454
2015-05-20 23:44:16 +00:00
John Emmons
368eb4bb16 ICU-11555 Integrate CLDR 27 data
X-SVN-Rev: 37169
2015-03-06 22:58:33 +00:00
Michael Ow
7e3befc1a6 ICU-10992 Ensure ICU4C 54 test suite passes without data
X-SVN-Rev: 36516
2014-09-15 21:51:57 +00:00
John Emmons
8716672a2d ICU-11251 Last minute CLDR data changes
X-SVN-Rev: 36475
2014-09-11 22:25:12 +00:00
Yoshito Umaoka
04df1aa651 ICU-8951 Fixed a typo in a comment.
X-SVN-Rev: 36460
2014-09-11 14:55:53 +00:00
Yoshito Umaoka
8885f1ef78 ICU-8951 BCP 47 key/type converter APIs merged from the work branch.
X-SVN-Rev: 36320
2014-09-03 04:42:21 +00:00
Peter Edberg
1b8eb15e1a ICU-11173 CLDR tags/release-26-d01 into ICU4C trunk with related test & lib code updates
X-SVN-Rev: 36313
2014-09-02 23:18:20 +00:00
Steven R. Loomis
7594250cc5 ICU-7653 changed uprv_lengthof to UPRV_LENGTHOF, also added apidoc
X-SVN-Rev: 36275
2014-08-28 22:13:45 +00:00
Markus Scherer
53dcbe6141 ICU-10736 Locale.isRightToLeft(), uloc_isRightToLeft(locale)
X-SVN-Rev: 36269
2014-08-28 18:28:30 +00:00
Tom Zhang
ee1f29b584 ICU-7653 move LENGTHOF(array) to common, internal header
X-SVN-Rev: 36265
2014-08-28 14:55:34 +00:00
Andy Heninger
301814f85f ICU-10624 Compiler warning cleanups, continued.
X-SVN-Rev: 34855
2014-01-10 08:35:00 +00:00
Michael Ow
e5a9a38924 ICU-10398 Fix uconfig test errors in ICU 52
X-SVN-Rev: 34404
2013-09-19 20:47:22 +00:00
Michael Ow
4835d5705a ICU-10398 Ensure cintltst and intltest passes without data
X-SVN-Rev: 34398
2013-09-19 02:32:57 +00:00
Peter Edberg
bb7e154629 ICU-10260 Port J LocaleDisplayNamesImpl change for (->[ to C; make similar changes in uloc_getDisplayName
X-SVN-Rev: 34369
2013-09-18 08:33:47 +00:00
John Emmons
a869b0d483 ICU-10335 Merge completed CLDR24 branch into trunk.
X-SVN-Rev: 34238
2013-09-07 20:46:42 +00:00
Peter Edberg
09ac4ef907 ICU-10222 (C) Integrate CLDR data snapshot for ICU 52.0.1; add calendar types
X-SVN-Rev: 33890
2013-07-08 06:51:38 +00:00
Andy Heninger
ae4350661b ICU-10048 Fix some compiler warnings in ICU4C.
X-SVN-Rev: 33444
2013-03-21 01:42:01 +00:00
John Emmons
28932c056e ICU-9890 Merge CLDR23 data
X-SVN-Rev: 33355
2013-03-03 21:34:51 +00:00
Peter Edberg
bf5a321da8 ICU-9925 CLDR 23 pre-integration part 3, batch 1 (C)
X-SVN-Rev: 33196
2013-02-12 21:00:17 +00:00
Yoshito Umaoka
8d16a6bea1 ICU-9839 Removed temporary workaround in the test code.
X-SVN-Rev: 33110
2013-02-01 07:47:57 +00:00
Michael Ow
2724d7c5cc ICU-9802 Fix failures in running cintltst and intltest without data
X-SVN-Rev: 33089
2013-01-29 01:51:53 +00:00
Peter Edberg
b2d677bb65 ICU-9876 Pre-integrate some CLDR 23 additions/changes, part 2 (C)
X-SVN-Rev: 33077
2013-01-26 01:14:35 +00:00
Yoshito Umaoka
557da151c7 ICU-9839 Punctuation exemplar type support. Code is added, but not working because of data problem explained in #9845. When data is refreshed next time, the problem should go away.
X-SVN-Rev: 33062
2013-01-18 16:29:02 +00:00
Peter Edberg
cce314dc85 ICU-9581 Handle uconfig.h variations: fix errors and some of the old warnings
X-SVN-Rev: 32659
2012-10-18 19:51:28 +00:00
John Emmons
276a244c9b ICU-9251 First cut merge of CLDR 22 data
X-SVN-Rev: 32275
2012-08-28 21:56:06 +00:00
Debabrata Sengupta
f81fa56468 ICU-8971 fixed parsing inconsistency and corrected few test cases
X-SVN-Rev: 32031
2012-07-09 18:25:45 +00:00
Yoshito Umaoka
948048b4d2 ICU-9265 Added support for typeless keyword in BCP 47 u extension. Also implemented u extension attributes. The implementation of uloc_forLanguageTag is now equivalent to ICU4J implementation.
X-SVN-Rev: 31816
2012-05-11 21:52:24 +00:00
John Emmons
7742158c72 ICU-9071 Merge data from CLDR release-21-d01
X-SVN-Rev: 31307
2012-02-02 22:53:19 +00:00
Abhinav Gupta
5373f49d27 ICU-8668 C, C++, restrict script to alphabetic in locale name.
X-SVN-Rev: 31031
2011-12-05 20:15:15 +00:00
John Emmons
42bbabf646 ICU-7605 Change locale ID canonicalization to not use double-underscore IDs
X-SVN-Rev: 30954
2011-11-11 20:29:33 +00:00
John Emmons
de229aa8da ICU-8423 Use stand-alone script names if possible in uloc_getDisplayScript()
X-SVN-Rev: 30619
2011-09-02 21:58:42 +00:00