Commit Graph

44 Commits

Author SHA1 Message Date
Fredrik Roubert
59fe4f4be2 ICU-20132 Pass ByteSink from Locale::toLanguageTag() to uloc_toLanguageTag().
This eliminates the need for a scratch buffer in Locale::toLanguageTag()
and also the need for counting bytes required in uloc_toLanguageTag(),
something that ByteSink will now handle correctly and thereby
eliminating the bug where too few bytes required was returned.
2018-10-25 21:04:47 +02:00
Fredrik Roubert
10e79698d7 ICU-20228 Fix common typos for "language". 2018-10-24 20:54:10 +02:00
Jungshik Shin
c71a1b4b51
ICU-9562 Update language tag mapping per the latest IANA registry
uloc_forLanguageTag has a few mapping tables to map grandfathered
language tags and deprecated language subtags to their preferred or
modern values.

Update them based on the latest version of the IANA
language subtag registry. [1]

Five grandfathered tags without a preferred value are still mapped to
what ICU has mapped them to for backward compatibility until the
wisdom of continuing to do so is reviewed.

In addition, map redundant language tags to their preferred values
regardless of whether they're followed by other subtags or not. (e.g.
zh-yue vs zh-yue-u-co-pinyin) .

Similary, ja-latn-hepburn-heploc is mapped to ja-latn-alaic97 (the
variant subtag 'hepburn-helploc' with the prefix 'ja-latn' has the
preferred value, 'alaic97') .

Update the mapping for deprecated language subtags (e.g. 'jw' to
'jv' and a bunch of 3-letter language codes).

Add a new table for deprecated region subtags to map them to their
modern values. (e.g. 'DD' to 'DE').

Add a new test case for deprecated language and region mapping and
a few more cases for updated grandfathered and redundant tag mapping.

[1]
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
2018-09-27 14:27:42 -07:00
Fredrik Roubert
acc3f65a87
ICU-13417 Replace fixed buffers in uloc_tag.cpp with CharString.
This gets rid of those fixed buffers that caused ICU-13417 to be filed
in the first place, those that prevent handling language tags with very
large amounts of keywords.

A number of fixed buffers will still remain in uloc_tag.cpp (and
elsewhere in the locale handling code) for the time being, but this
change is a necessary first step in cleaning up this code and will
alleviate the most pressing problem encountered by ICU4C users.

An off-by-one error in _getKeywords() caused uloc_canonicalize() to not
write out the final keyword value in case the result would fill up the
buffer exactly, resulting in U_STRING_NOT_TERMINATED_WARNING.
2018-09-27 14:27:41 -07:00
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
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
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
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
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
Doug Felt
809ac514dc ICU-7500 fix uloc_getDisplayName incorrect length
X-SVN-Rev: 27774
2010-03-04 02:34:15 +00:00
Yoshito Umaoka
6b1a0829a6 ICU-6434 ICU4C toLanguageTag/forLanguageTag implementation.
X-SVN-Rev: 25756
2009-04-10 22:30:39 +00:00
David Bertoni
5822580eca ICU-6124 Merged private branch into the trunk. Implementation complete, but waiting for new CLDR data.
X-SVN-Rev: 23960
2008-05-21 21:53:55 +00:00
David Bertoni
8ad2ddd4ca ICU-6228 C++ implementation complete.
X-SVN-Rev: 23897
2008-05-14 20:39:58 +00:00
Deborah Goldsmith
e7c563efb3 ICU-5627 Add uloc_getLocaleForLCID
X-SVN-Rev: 21579
2007-05-24 00:04:20 +00:00
George Rhoten
81b211ef90 ICU-4707 Fix some compiler warnings.
X-SVN-Rev: 19444
2006-03-26 00:18:23 +00:00
George Rhoten
8b6eb2b923 ICU-5032 Increase code coverage numbers by enabling a test.
X-SVN-Rev: 19081
2006-02-07 19:26:37 +00:00
Ram Viswanadha
7aaebd3ab7 ICU-4051 verify locale aliases
X-SVN-Rev: 18430
2005-08-12 22:01:55 +00:00
Steven R. Loomis
59ac27a504 ICU-3591 uloc_acceptLanguage tests
X-SVN-Rev: 16751
2004-11-04 08:17:26 +00:00
Deborah Goldsmith
95bbad7347 ICU-4115 Set warning code when falling back to parent or root
X-SVN-Rev: 16546
2004-10-18 23:59:41 +00:00
George Rhoten
08382a4b07 ICU-3938 Related to cldrbug 235.
Separate cldr tests from cloctst, and depend on testLocale instead of root for testing

X-SVN-Rev: 16253
2004-09-03 20:51:11 +00:00
Steven R. Loomis
9b4ae3bd1b ICU-3651 uloc_setKeywordValue (partial: need test for removal of keywords)
X-SVN-Rev: 16241
2004-09-01 02:25:14 +00:00
Eric Mader
c5705d3767 ICU-3770 Updated copyright notices for ICU 3.0
X-SVN-Rev: 15413
2004-05-19 21:19:13 +00:00
Alan Liu
8af4a86e25 ICU-2202 initial tests
X-SVN-Rev: 14374
2004-01-22 00:15:32 +00:00
George Rhoten
b9072652ab ICU-3222 Fix some compiler warnings.
X-SVN-Rev: 14308
2004-01-13 00:09:55 +00:00
Vladimir Weinstein
7a03a9daba ICU-2438 getBaseName test
X-SVN-Rev: 14279
2004-01-09 07:59:45 +00:00
Ram Viswanadha
eb684be491 ICU-2938 add tests for the newly added API
X-SVN-Rev: 13619
2003-11-07 02:48:11 +00:00
George Rhoten
09105d9c9a ICU-2942 Create uloc_canonicalize
X-SVN-Rev: 13528
2003-10-29 22:29:19 +00:00
Vladimir Weinstein
3d2215268d ICU-2438 uloc_getLocaleNoKeywords (for resource bundles), support for canonizing ICU variants to keywords (disabled).
X-SVN-Rev: 13473
2003-10-22 18:53:54 +00:00
Vladimir Weinstein
6edcd27333 ICU-2438 C++ tests for getKeywords and getKeywordValue
X-SVN-Rev: 13424
2003-10-15 05:32:40 +00:00
Vladimir Weinstein
847cec8661 ICU-2438 uloc_getKeywords, uloc_getKeywordValue tests
X-SVN-Rev: 13406
2003-10-14 06:08:54 +00:00
Markus Scherer
bbf546a40e ICU-2439 fix display name lookups to not fallback through the default locale
X-SVN-Rev: 11712
2003-04-25 22:56:51 +00:00
George Rhoten
18223f5083 ICU-1616 Fix some more of the Locale differences between countries.
X-SVN-Rev: 7629
2002-02-12 18:42:47 +00:00
George Rhoten
616ee23932 ICU-1616 Move the TestLocaleStructure test from crestest to cloctest
X-SVN-Rev: 7571
2002-02-05 23:47:41 +00:00
Steven R. Loomis
6222b1e2ba ICU-1276 updated ISO codes, 3->2 mapping, obsolete codes
X-SVN-Rev: 6234
2001-10-14 00:24:34 +00:00
Ram Viswanadha
ef97b534cd ICU-903 update copyright notices
X-SVN-Rev: 4233
2001-03-21 19:46:49 +00:00
Steven R. Loomis
900403dd5f ICU-860 tests for i-, x-, @, . locales and Locale::createFromName
X-SVN-Rev: 3668
2001-02-17 13:34:42 +00:00
George Rhoten
994d196cbb ICU-432 Fixed a very odd leak with cloctest, cucdtst and crestst
X-SVN-Rev: 3245
2000-12-15 19:16:43 +00:00
George Rhoten
7a86150849 ICU-535 fixed some compiler warnings
X-SVN-Rev: 2247
2000-08-15 01:13:48 +00:00
Helena Chapman
3f2fb26333 ICU-401 Make 1.6 tree compiled and linked on S/400.
X-SVN-Rev: 2233
2000-08-14 23:35:57 +00:00
Madhu K
fafe9b6e4b ICU-447 Addtional tests for extended code coverage
X-SVN-Rev: 1641
2000-06-22 17:39:34 +00:00
Helena Chapman
3aaa52af8d ICU-161 updated the copyright notices.
X-SVN-Rev: 596
2000-01-15 02:00:06 +00:00
Unknown User
aa0b0a88e8 Initial revision
X-SVN-Rev: 2
1999-08-16 21:50:52 +00:00