Compare commits

...
Author SHA1 Message Date
yumaoka b7e6e9b84b ICU-20536 ICU 61.2 release tasks 2019-04-11 14:45:47 -04:00
yumaoka 7c0e08d5c1 ICU-20536 Japanese era Reiwa support in ICU4J 61 2019-04-11 14:45:47 -04:00
yumaoka 16e1ef3342 ICU-20536 Japanese era Reiwa support in ICU4C 61 2019-04-11 14:45:47 -04:00
Jeff Genovy e9126103d4 ICU-13831 Port fix to maint-61 branch #13826 Windows 7 time zone detection fix.
X-SVN-Rev: 41538
2018-06-18 21:15:46 +00:00
Andy Heninger b3054b334d ICU-13640 Merging the removal of Unified Cache Asserts (r41145) to maint-61
X-SVN-Rev: 41146
2018-03-23 22:14:04 +00:00
Jeff Genovy d718634ba9 ICU-13640 Update the ICU4C readme.html for 61.1 GA.
X-SVN-Rev: 41133
2018-03-21 07:20:16 +00:00
Yoshito Umaoka 4b41c73680 ICU-13640 Updated version strings in ICU4J build.properties.
X-SVN-Rev: 41128
2018-03-20 21:22:00 +00:00
Yoshito Umaoka 2d0b3249ba ICU-13640 Updated ICU4J readme.html for 61.1 GA.
X-SVN-Rev: 41127
2018-03-20 19:49:40 +00:00
Yoshito Umaoka b1715b2229 ICU-13640 Mreginge the lincese file updates (r41101) to maint-61.
X-SVN-Rev: 41124
2018-03-20 13:31:40 +00:00
Yoshito Umaoka ac22da8df5 ICU-13640 Merging the fix for #13648 double_conversion namespace should be inside the ICU namespace (r41116) to maint-61.
X-SVN-Rev: 41117
2018-03-16 23:13:40 +00:00
Yoshito Umaoka 67c7a28c41 ICU-13640 Merging the post RC fix for #13083 followup on unescaper/C++11 (r41106) to maint-61.
X-SVN-Rev: 41115
2018-03-16 21:34:01 +00:00
Yoshito Umaoka 8e64c2c395 ICU-13640 Merging the fix for #12632 Valgrind warning on incorrect regex replacement syntax (r41088) to maint-61.
X-SVN-Rev: 41114
2018-03-16 21:22:30 +00:00
Yoshito Umaoka eb48afc41b ICU-13640 Merging the fix for #13631 Regex ASAN failure (r41086) to maint-61.
X-SVN-Rev: 41113
2018-03-16 21:16:05 +00:00
Yoshito Umaoka efa70da392 ICU-13640 Merging the post RC fixes for #13402 Update 'Formatting Numbers' userguide (r41096+r41097) to maint-61.
X-SVN-Rev: 41112
2018-03-16 20:53:20 +00:00
Yoshito Umaoka ed9404d7fc ICU-13640 Merging the fix for #13636 TestFwdBackUnsafe hangs on Windows with MSVC VS2017 (r41095) to maint-61.
X-SVN-Rev: 41111
2018-03-16 20:38:00 +00:00
87 changed files with 1662 additions and 1127 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html
Copyright © 1991-2018 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
+5 -5
View File
@@ -3,7 +3,7 @@
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<title>ReadMe for ICU 61.1</title>
<title>ReadMe for ICU 61.2</title>
<meta name="COPYRIGHT" content=
"Copyright (C) 2016 and later: Unicode, Inc. and others. License &amp; terms of use: http://www.unicode.org/copyright.html"/>
<!-- meta name="COPYRIGHT" content=
@@ -23,8 +23,8 @@
milestone - if the release note is a milestone release
-->
<!-- <body> -->
<body class="rc">
<body>
<!-- <body class="rc"> -->
<p class="only-draft"><b>Note:</b> This is a draft readme.</p>
<h1>
@@ -32,7 +32,7 @@
International Components for Unicode<br/>
<span class="only-rc">Release Candidate</span>
<span class="only-milestone">(Milestone Release)</span>
<abbr title="International Components for Unicode">ICU</abbr> 61.1 ReadMe
<abbr title="International Components for Unicode">ICU</abbr> 61.2 ReadMe
</h1>
<!-- Shouldn't need to comment/uncomment this paragraph, just change the body class -->
@@ -44,7 +44,7 @@
<p class="note only-rc">This is a release candidate version of ICU4C.
It is not recommended for production use.</p>
<p>Last updated: 2018-Feb-16<br/>
<p>Last updated: 2018-Mar-21<br/>
Copyright &copy; 2016 and later: Unicode, Inc. and others. License &amp; terms of use:
<a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/>
Copyright &copy; 1997-2016 International Business Machines Corporation and others.
+3 -3
View File
@@ -64,7 +64,7 @@
* This value will change in the subsequent releases of ICU
* @stable ICU 2.6
*/
#define U_ICU_VERSION_MINOR_NUM 1
#define U_ICU_VERSION_MINOR_NUM 2
/** The current ICU patchlevel version as an integer.
* This value will change in the subsequent releases of ICU
@@ -119,7 +119,7 @@
* This value will change in the subsequent releases of ICU
* @stable ICU 2.4
*/
#define U_ICU_VERSION "61.1"
#define U_ICU_VERSION "61.2"
/**
* The current ICU library major version number as a string, for library name suffixes.
@@ -138,7 +138,7 @@
/** Data version in ICU4C.
* @internal ICU 4.4 Internal Use Only
**/
#define U_ICU_DATA_VERSION "61.1"
#define U_ICU_DATA_VERSION "61.2"
#endif /* U_HIDE_INTERNAL_API */
/*===========================================================================
-3
View File
@@ -263,13 +263,10 @@ UBool UnifiedCache::_flush(UBool all) const {
int32_t UnifiedCache::_computeCountOfItemsToEvict() const {
int32_t totalItems = uhash_count(fHashtable);
int32_t evictableItems = totalItems - fNumValuesInUse;
U_ASSERT(totalItems >= fNumValuesInUse);
U_ASSERT(totalItems >= evictableItems);
int32_t unusedLimitByPercentage = fNumValuesInUse * fMaxPercentageOfInUse / 100;
int32_t unusedLimit = std::max(unusedLimitByPercentage, fMaxUnused);
int32_t countOfItemsToEvict = std::max(0, evictableItems - unusedLimit);
U_ASSERT(countOfItemsToEvict >= 0 && countOfItemsToEvict <= evictableItems);
return countOfItemsToEvict;
}
+20 -8
View File
@@ -49,7 +49,7 @@ typedef struct
/**
* Various registry keys and key fragments.
*/
static const char CURRENT_ZONE_REGKEY[] = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation\\";
static const wchar_t CURRENT_ZONE_REGKEY[] = L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation\\";
static const char STANDARD_TIME_REGKEY[] = " Standard Time";
static const char TZI_REGKEY[] = "TZI";
static const char STD_REGKEY[] = "Std";
@@ -121,27 +121,39 @@ static LONG getSTDName(const char *winid, char *regStdName, int32_t length)
return result;
}
static LONG getTZKeyName(char* tzKeyName, int32_t length)
static LONG getTZKeyName(char* tzKeyName, int32_t tzKeyNamelength)
{
HKEY hkey;
LONG result = FALSE;
DWORD cbData = length;
WCHAR timeZoneKeyNameData[128];
DWORD timeZoneKeyNameLength = static_cast<DWORD>(sizeof(timeZoneKeyNameData));
if(ERROR_SUCCESS == RegOpenKeyExA(
if(ERROR_SUCCESS == RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
CURRENT_ZONE_REGKEY,
0,
KEY_QUERY_VALUE,
&hkey))
{
result = RegQueryValueExA(
if (ERROR_SUCCESS == RegQueryValueExW(
hkey,
"TimeZoneKeyName",
L"TimeZoneKeyName",
NULL,
NULL,
(LPBYTE)tzKeyName,
&cbData);
(LPBYTE)timeZoneKeyNameData,
&timeZoneKeyNameLength))
{
// Ensure null termination.
timeZoneKeyNameData[UPRV_LENGTHOF(timeZoneKeyNameData) - 1] = L'\0';
// Convert the UTF-16 string to UTF-8.
UErrorCode status = U_ZERO_ERROR;
u_strToUTF8(tzKeyName, tzKeyNamelength, NULL, reinterpret_cast<const UChar *>(timeZoneKeyNameData), -1, &status);
if (U_ZERO_ERROR == status)
{
result = ERROR_SUCCESS;
}
}
RegCloseKey(hkey);
}
+1
View File
@@ -1635,6 +1635,7 @@ ar{
"تيشو",
"شووا",
"هيسي",
"ريوا",
}
}
}
+3
View File
@@ -2304,6 +2304,7 @@ ast{
"Taishō",
"e. Shōwa",
"Heisei",
"Reiwa",
}
narrow{
"Taika",
@@ -2542,6 +2543,7 @@ ast{
"T",
"S",
"H",
"R",
}
wide{
"Taika (645–650)",
@@ -2780,6 +2782,7 @@ ast{
"Taishō",
"era Shōwa",
"Heisei",
"Reiwa",
}
}
intervalFormats{
+3
View File
@@ -4105,6 +4105,7 @@ br{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
narrow{
"Taika (645–650)",
@@ -4343,6 +4344,7 @@ br{
"T",
"S",
"H",
"R",
}
wide{
"Taika (645–650)",
@@ -4581,6 +4583,7 @@ br{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
intervalFormats{
+1
View File
@@ -1035,6 +1035,7 @@ bs_Cyrl{
"Таишо",
"Шова",
"Хаисеи",
"Реива",
}
}
}
+3
View File
@@ -3697,6 +3697,7 @@ cs{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
narrow{
"Taika (645–650)",
@@ -3935,6 +3936,7 @@ cs{
"T",
"S",
"H",
"R",
}
wide{
"Taika (645–650)",
@@ -4173,6 +4175,7 @@ cs{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
intervalFormats{
+1
View File
@@ -1601,6 +1601,7 @@ de{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
}
+1
View File
@@ -1837,6 +1837,7 @@ he{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
}
+1
View File
@@ -1239,6 +1239,7 @@ hi{
"ताईशो",
"शोवा",
"हेईसेई",
"रेइवा",
}
}
}
+1
View File
@@ -1577,6 +1577,7 @@ hr{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
}
+1
View File
@@ -2217,6 +2217,7 @@ id{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
}
+2
View File
@@ -2464,6 +2464,7 @@ ja{
"大正",
"昭和",
"平成",
"令和",
}
narrow{
"大化",
@@ -2702,6 +2703,7 @@ ja{
"T",
"S",
"H",
"R",
}
}
}
+1
View File
@@ -1909,6 +1909,7 @@ ko{
"다이쇼",
"쇼와",
"헤이세이",
"레이와",
}
}
}
+1
View File
@@ -1845,6 +1845,7 @@ lo{
"ໄຕໂຊ",
"ໂຊວາ",
"ຮີຊີ",
"Reiwa",
}
}
}
+1
View File
@@ -2466,6 +2466,7 @@ lt{
"Taišo",
"Šova",
"Heisei",
"Reiwa",
}
}
}
+3
View File
@@ -5483,6 +5483,7 @@ nb{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
narrow{
"Taika (645–650)",
@@ -5721,6 +5722,7 @@ nb{
"T",
"S",
"H",
"R"
}
wide{
"Taika (645–650)",
@@ -5959,6 +5961,7 @@ nb{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
intervalFormats{
+3
View File
@@ -4894,6 +4894,7 @@ nl{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
narrow{
"Taika (645–650)",
@@ -5132,6 +5133,7 @@ nl{
"T",
"S",
"H",
"R",
}
wide{
"Taika (645–650)",
@@ -5370,6 +5372,7 @@ nl{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
}
+2
View File
@@ -1713,6 +1713,7 @@ root{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
narrow{
"Taika (645–650)",
@@ -1951,6 +1952,7 @@ root{
"T",
"S",
"H",
"R",
}
wide:alias{"/LOCALE/calendar/japanese/eras/abbreviated"}
}
+1
View File
@@ -1837,6 +1837,7 @@ ru{
"Эпоха Тайсьо",
"Сьова",
"Эпоха Хэйсэй",
"Рэйва",
}
}
}
+1
View File
@@ -1256,6 +1256,7 @@ sr{
"Таишо",
"Шова",
"Хаисеи",
"Реива",
}
}
}
+1
View File
@@ -1257,6 +1257,7 @@ sr_Latn{
"Taišo",
"Šova",
"Haisei",
"Reiva",
}
}
}
+1
View File
@@ -1630,6 +1630,7 @@ sv{
"Taishō",
"Shōwa",
"Heisei",
"Reiwa",
}
}
}
+1
View File
@@ -2332,6 +2332,7 @@ th{
"ทะอิโช",
"โชวะ",
"เฮเซ",
"เรวะ",
}
}
}
+1
View File
@@ -2394,6 +2394,7 @@ yue{
"大正",
"昭和",
"平成",
"令和",
}
}
}
+1
View File
@@ -2392,6 +2392,7 @@ yue_Hans{
"大正",
"昭和",
"平成",
"令和",
}
}
}
+3
View File
@@ -3403,6 +3403,7 @@ zh{
"大正",
"昭和",
"平成",
"令和",
}
narrow{
"大化(645–650)",
@@ -3641,6 +3642,7 @@ zh{
"T",
"S",
"H",
"R",
}
wide{
"大化 (645–650)",
@@ -3879,6 +3881,7 @@ zh{
"大正",
"昭和",
"平成",
"令和",
}
}
}
+3 -1
View File
@@ -5737,6 +5737,7 @@ zh_Hant{
"大正",
"昭和",
"平成",
"令和",
}
narrow{
"大化",
@@ -5975,6 +5976,7 @@ zh_Hant{
"大正",
"昭和",
"平成",
"令和",
}
wide{
"大化",
@@ -6213,7 +6215,7 @@ zh_Hant{
"大正",
"昭和",
"平成",
}
"令和", }
}
intervalFormats{
H{
+2 -2
View File
@@ -8,6 +8,6 @@
// ***************************************************************************
icuver:table(nofallback){
DataVersion { "61.1.0.0" }
ICUVersion { "61.1.0.0" }
DataVersion { "61.2.0.0" }
ICUVersion { "61.2.0.0" }
}
+48 -6
View File
@@ -813,7 +813,7 @@ metaZones:table(nofallback){
{
"Europe_Western",
"1985-12-31 23:00",
"9999-12-31 23:59",
"2018-10-28 02:00",
}
}
"Africa:Ceuta"{
@@ -862,7 +862,7 @@ metaZones:table(nofallback){
{
"Europe_Western",
"1976-04-14 01:00",
"9999-12-31 23:59",
"2018-10-28 02:00",
}
}
"Africa:Freetown"{
@@ -1035,6 +1035,11 @@ metaZones:table(nofallback){
{
"Africa_Western",
"2018-01-01 01:00",
"2019-01-01 01:00",
}
{
"GMT",
"2019-01-01 01:00",
"9999-12-31 23:59",
}
}
@@ -1094,11 +1099,11 @@ metaZones:table(nofallback){
{
"Africa_Western",
"1994-03-20 22:00",
"2017-09-03 01:00",
"2017-10-23 22:00",
}
{
"Africa_Central",
"2017-09-03 01:00",
"2017-10-23 22:00",
"9999-12-31 23:59",
}
}
@@ -2076,6 +2081,16 @@ metaZones:table(nofallback){
{
"Alaska",
"2015-11-01 10:00",
"2018-11-04 10:00",
}
{
"America_Pacific",
"2018-11-04 10:00",
"2019-01-20 10:00",
}
{
"Alaska",
"2019-01-20 10:00",
"9999-12-31 23:59",
}
}
@@ -2559,6 +2574,11 @@ metaZones:table(nofallback){
{
"Casey",
"2016-10-21 16:00",
"2018-03-10 17:00",
}
{
"Australia_Western",
"2018-03-10 17:00",
"9999-12-31 23:59",
}
}
@@ -3127,6 +3147,11 @@ metaZones:table(nofallback){
{
"Pyongyang",
"2015-08-14 15:00",
"2018-05-04 15:00",
}
{
"Korea",
"2018-05-04 15:00",
"9999-12-31 23:59",
}
}
@@ -3142,6 +3167,13 @@ metaZones:table(nofallback){
"9999-12-31 23:59",
}
}
"Asia:Qostanay"{
{
"Kazakhstan_Eastern",
"2004-10-30 21:00",
"9999-12-31 23:59",
}
}
"Asia:Qyzylorda"{
{
"Kizilorda",
@@ -3156,6 +3188,11 @@ metaZones:table(nofallback){
{
"Kazakhstan_Eastern",
"2004-10-30 21:00",
"2018-12-20 18:00",
}
{
"Kazakhstan_Western",
"2018-12-20 18:00",
"9999-12-31 23:59",
}
}
@@ -3982,6 +4019,11 @@ metaZones:table(nofallback){
{
"Moscow",
"1992-03-28 22:00",
"2018-10-27 23:00",
}
{
"Volgograd",
"2018-10-27 23:00",
"9999-12-31 23:59",
}
}
@@ -4201,11 +4243,11 @@ metaZones:table(nofallback){
{
"Kwajalein",
"1970-01-01 00:00",
"1993-08-20 12:00",
"1993-08-21 12:00",
}
{
"Marshall_Islands",
"1993-08-20 12:00",
"1993-08-21 12:00",
"9999-12-31 23:59",
}
}
+1
View File
@@ -416,6 +416,7 @@ timezoneTypes:table(nofallback){
"Asia:Pontianak"{"idpnk"}
"Asia:Pyongyang"{"kpfnj"}
"Asia:Qatar"{"qadoh"}
"Asia:Qostanay"{"kzksn"}
"Asia:Qyzylorda"{"kzkzo"}
"Asia:Rangoon"{"mmrgn"}
"Asia:Riyadh"{"saruh"}
+11 -9
View File
@@ -17,8 +17,8 @@ windowsZones:table(nofallback){
"Alaskan Standard Time"{
001{"America/Anchorage"}
US{
"America/Anchorage America/Juneau America/Metlakatla America/Nome Ame"
"rica/Sitka America/Yakutat"
"America/Anchorage America/Juneau America/Nome America/Sitka America/"
"Yakutat"
}
}
"Aleutian Standard Time"{
@@ -130,7 +130,7 @@ windowsZones:table(nofallback){
CN{"Asia/Urumqi"}
IO{"Indian/Chagos"}
KG{"Asia/Bishkek"}
KZ{"Asia/Almaty Asia/Qyzylorda"}
KZ{"Asia/Almaty Asia/Qostanay"}
ZZ{"Etc/GMT-6"}
}
"Central Brazilian Standard Time"{
@@ -156,7 +156,6 @@ windowsZones:table(nofallback){
}
"Central Pacific Standard Time"{
001{"Pacific/Guadalcanal"}
AQ{"Antarctica/Casey"}
AU{"Antarctica/Macquarie"}
FM{"Pacific/Ponape Pacific/Kosrae"}
NC{"Pacific/Noumea"}
@@ -288,7 +287,7 @@ windowsZones:table(nofallback){
}
"GTB Standard Time"{
001{"Europe/Bucharest"}
CY{"Asia/Nicosia"}
CY{"Asia/Famagusta Asia/Nicosia"}
GR{"Europe/Athens"}
RO{"Europe/Bucharest"}
}
@@ -469,7 +468,7 @@ windowsZones:table(nofallback){
"Pacific Standard Time"{
001{"America/Los_Angeles"}
CA{"America/Vancouver America/Dawson America/Whitehorse"}
US{"America/Los_Angeles"}
US{"America/Los_Angeles America/Metlakatla"}
ZZ{"PST8PDT"}
}
"Pakistan Standard Time"{
@@ -581,6 +580,10 @@ windowsZones:table(nofallback){
001{"Pacific/Apia"}
WS{"Pacific/Apia"}
}
"Sao Tome Standard Time"{
001{"Africa/Sao_Tome"}
ST{"Africa/Sao_Tome"}
}
"Saratov Standard Time"{
001{"Europe/Saratov"}
RU{"Europe/Saratov"}
@@ -655,7 +658,6 @@ windowsZones:table(nofallback){
}
"Turkey Standard Time"{
001{"Europe/Istanbul"}
CY{"Asia/Famagusta"}
TR{"Europe/Istanbul"}
}
"Turks And Caicos Standard Time"{
@@ -731,6 +733,7 @@ windowsZones:table(nofallback){
}
"W. Australia Standard Time"{
001{"Australia/Perth"}
AQ{"Antarctica/Casey"}
AU{"Australia/Perth"}
}
"W. Central Africa Standard Time"{
@@ -746,7 +749,6 @@ windowsZones:table(nofallback){
GQ{"Africa/Malabo"}
NE{"Africa/Niamey"}
NG{"Africa/Lagos"}
ST{"Africa/Sao_Tome"}
TD{"Africa/Ndjamena"}
TN{"Africa/Tunis"}
ZZ{"Etc/GMT-1"}
@@ -777,7 +779,7 @@ windowsZones:table(nofallback){
"West Asia Standard Time"{
001{"Asia/Tashkent"}
AQ{"Antarctica/Mawson"}
KZ{"Asia/Oral Asia/Aqtau Asia/Aqtobe Asia/Atyrau"}
KZ{"Asia/Oral Asia/Aqtau Asia/Aqtobe Asia/Atyrau Asia/Qyzylorda"}
MV{"Indian/Maldives"}
TF{"Indian/Kerguelen"}
TJ{"Asia/Dushanbe"}
+959 -962
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -51,7 +51,7 @@
#include <stdio.h>
#include <limits>
using double_conversion::DoubleToStringConverter;
using icu::double_conversion::DoubleToStringConverter;
#if !defined(U_USE_STRTOD_L)
# if U_PLATFORM_USES_ONLY_WIN32_API
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include <math.h>
// ICU PATCH: Customize header file paths for ICU.
@@ -39,6 +43,9 @@
#include "double-conversion-bignum.h"
#include "double-conversion-ieee.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
static int NormalizedExponent(uint64_t significand, int exponent) {
@@ -646,3 +653,7 @@ static void FixupMultiply10(int estimated_power, bool is_even,
}
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_BIGNUM_DTOA_H_
#define DOUBLE_CONVERSION_BIGNUM_DTOA_H_
@@ -37,6 +41,9 @@
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
enum BignumDtoaMode {
@@ -88,4 +95,8 @@ void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits,
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_BIGNUM_DTOA_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,11 +30,18 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// ICU PATCH: Customize header file paths for ICU.
#include "double-conversion-bignum.h"
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
Bignum::Bignum()
@@ -771,3 +778,7 @@ void Bignum::SubtractTimes(const Bignum& other, int factor) {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_BIGNUM_H_
#define DOUBLE_CONVERSION_BIGNUM_H_
@@ -37,6 +41,9 @@
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
class Bignum {
@@ -148,4 +155,8 @@ class Bignum {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_BIGNUM_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include <stdarg.h>
#include <limits.h>
#include <math.h>
@@ -40,6 +44,9 @@
#include "double-conversion-cached-powers.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
struct CachedPower {
@@ -180,3 +187,7 @@ void PowersOfTenCache::GetCachedPowerForDecimalExponent(int requested_exponent,
}
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_CACHED_POWERS_H_
#define DOUBLE_CONVERSION_CACHED_POWERS_H_
@@ -37,6 +41,9 @@
#include "double-conversion-diy-fp.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
class PowersOfTenCache {
@@ -68,4 +75,8 @@ class PowersOfTenCache {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_CACHED_POWERS_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,12 +30,18 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// ICU PATCH: Customize header file paths for ICU.
#include "double-conversion-diy-fp.h"
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
void DiyFp::Multiply(const DiyFp& other) {
@@ -62,3 +68,7 @@ void DiyFp::Multiply(const DiyFp& other) {
}
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_DIY_FP_H_
#define DOUBLE_CONVERSION_DIY_FP_H_
@@ -37,6 +41,9 @@
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
// This "Do It Yourself Floating Point" class implements a floating-point number
@@ -122,4 +129,8 @@ class DiyFp {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_DIY_FP_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// ICU PATCH: Customize header file paths for ICU.
#include "double-conversion-fast-dtoa.h"
@@ -38,6 +42,9 @@
#include "double-conversion-diy-fp.h"
#include "double-conversion-ieee.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
// The minimal and maximal target exponent define the range of w's binary
@@ -670,3 +677,7 @@ bool FastDtoa(double v,
}
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_FAST_DTOA_H_
#define DOUBLE_CONVERSION_FAST_DTOA_H_
@@ -37,6 +41,9 @@
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
enum FastDtoaMode {
@@ -92,4 +99,8 @@ bool FastDtoa(double d,
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_FAST_DTOA_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_DOUBLE_H_
#define DOUBLE_CONVERSION_DOUBLE_H_
@@ -37,6 +41,9 @@
#include "double-conversion-diy-fp.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
// We assume that doubles and uint64_t have the same endianness.
@@ -406,4 +413,8 @@ class Single {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_DOUBLE_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_UTILS_H_
#define DOUBLE_CONVERSION_UTILS_H_
@@ -159,6 +163,9 @@ typedef uint16_t uc16;
DISALLOW_COPY_AND_ASSIGN(TypeName)
#endif
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
static const int kCharSize = sizeof(char);
@@ -344,4 +351,8 @@ inline Dest BitCast(Source* source) {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_UTILS_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
+11
View File
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include <limits.h>
#include <math.h>
@@ -43,6 +47,9 @@
#include "double-conversion-ieee.h"
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
#if 0 // not needed for ICU
@@ -992,3 +999,7 @@ float StringToDoubleConverter::StringToFloat(
#endif // not needed for ICU
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
+11
View File
@@ -30,6 +30,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
@@ -37,6 +41,9 @@
#include "double-conversion-utils.h"
// ICU PATCH: Wrap in ICU namespace
U_NAMESPACE_BEGIN
namespace double_conversion {
class DoubleToStringConverter {
@@ -552,4 +559,8 @@ class StringToDoubleConverter {
} // namespace double_conversion
// ICU PATCH: Close ICU namespace
U_NAMESPACE_END
#endif // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING
+2 -1
View File
@@ -276,7 +276,8 @@ static const struct {
{ 1868, 9, 8 }, // Meiji 232
{ 1912, 7, 30 }, // Taisho 233
{ 1926, 12, 25 }, // Showa 234
{ 1989, 1, 8 } // Heisei 235
{ 1989, 1, 8 }, // Heisei 235
{ 2019, 5, 1 } // Reiwa 236
};
#define kEraCount UPRV_LENGTHOF(kEraInfo)
+1 -1
View File
@@ -21,7 +21,7 @@ using namespace icu;
using namespace icu::number;
using namespace icu::number::impl;
using double_conversion::DoubleToStringConverter;
using icu::double_conversion::DoubleToStringConverter;
namespace {
+6 -5
View File
@@ -438,7 +438,7 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
status = U_REGEX_INVALID_CAPTURE_GROUP_NAME;
}
}
} else if (u_isdigit(nextChar)) {
// $n Scan for a capture group number
int32_t numCaptureGroups = fPattern->fGroupMap->size();
@@ -459,7 +459,7 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
break;
}
(void)UTEXT_NEXT32(replacement);
groupNum=groupNum*10 + nextDigitVal;
groupNum=groupNum*10 + nextDigitVal;
++numDigits;
}
} else {
@@ -2187,7 +2187,7 @@ int32_t RegexMatcher::split(UText *input,
break;
}
i++;
dest[i] = utext_extract_replace(fInputText, dest[i],
dest[i] = utext_extract_replace(fInputText, dest[i],
start64(groupNum, status), end64(groupNum, status), &status);
}
@@ -5469,7 +5469,7 @@ GC_Done:
if (lbStartIdx < 0) {
// First time through loop.
lbStartIdx = fp->fInputIdx - minML;
if (lbStartIdx > 0) {
if (lbStartIdx > 0 && lbStartIdx < fInputLength) {
U16_SET_CP_START(inputBuf, 0, lbStartIdx);
}
} else {
@@ -5546,7 +5546,7 @@ GC_Done:
if (lbStartIdx < 0) {
// First time through loop.
lbStartIdx = fp->fInputIdx - minML;
if (lbStartIdx > 0) {
if (lbStartIdx > 0 && lbStartIdx < fInputLength) {
U16_SET_CP_START(inputBuf, 0, lbStartIdx);
}
} else {
@@ -5818,3 +5818,4 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RegexMatcher)
U_NAMESPACE_END
#endif // !UCONFIG_NO_REGULAR_EXPRESSIONS
@@ -16,7 +16,7 @@
#include "unicode/utypes.h"
/**
* \file
* \brief C++ API: Formats decimal numbers in compact form.
* \brief C++ API: Compatibility APIs for compact decimal number formatting.
*/
#if !UCONFIG_NO_FORMATTING
@@ -30,6 +30,11 @@ U_NAMESPACE_BEGIN
class PluralRules;
/**
* <p><strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* numberformatter.h fits their use case. Although not deprecated, this header
* is provided for backwards compatibility only.
* <hr/>
*
* The CompactDecimalFormat produces abbreviated numbers, suitable for display in
* environments will limited real estate. For example, 'Hits: 1.2B' instead of
* 'Hits: 1,200,000,000'. The format will be appropriate for the given language,
@@ -56,6 +61,9 @@ public:
/**
* Returns a compact decimal instance for specified locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param inLocale the given locale.
* @param style whether to use short or long style.
* @param status error code returned here.
+16 -1
View File
@@ -77,7 +77,7 @@ template class U_I18N_API EnumSet<UNumberFormatAttribute,
/**
* <p><strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* numberformatter.h fits their use case. Although not deprecated, this header
* is on life support and is provided for backwards compatibility only.
* is provided for backwards compatibility only.
* <hr/>
*
* DecimalFormat is a concrete subclass of NumberFormat that formats decimal
@@ -694,6 +694,9 @@ public:
* on NumberFormat such as createInstance. These factories will
* return the most appropriate sub-class of NumberFormat for a given
* locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of DecimalFormat.
* @param status Output param set to success/failure code. If the
* pattern is invalid this will be set to a failure code.
* @stable ICU 2.0
@@ -709,6 +712,9 @@ public:
* on NumberFormat such as createInstance. These factories will
* return the most appropriate sub-class of NumberFormat for a given
* locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of DecimalFormat.
* @param pattern A non-localized pattern string.
* @param status Output param set to success/failure code. If the
* pattern is invalid this will be set to a failure code.
@@ -727,6 +733,9 @@ public:
* createInstance or createCurrencyInstance. If you need only minor adjustments
* to a standard format, you can modify the format returned by
* a NumberFormat factory method.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of DecimalFormat.
*
* @param pattern a non-localized pattern string
* @param symbolsToAdopt the set of symbols to be used. The caller should not
@@ -832,6 +841,9 @@ public:
* createInstance or createCurrencyInstance. If you need only minor adjustments
* to a standard format, you can modify the format returned by
* a NumberFormat factory method.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of DecimalFormat.
*
* @param pattern a non-localized pattern string
* @param symbolsToAdopt the set of symbols to be used. The caller should not
@@ -855,6 +867,9 @@ public:
* createInstance or createCurrencyInstance. If you need only minor adjustments
* to a standard format, you can modify the format returned by
* a NumberFormat factory method.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of DecimalFormat.
*
* @param pattern a non-localized pattern string
* @param symbols the set of symbols to be used
+13 -1
View File
@@ -89,7 +89,7 @@ class DateFormat;
/**
* <p><strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* numberformatter.h fits their use case. Although not deprecated, this header
* is on life support and is provided for backwards compatibility only.
* is provided for backwards compatibility only.
*
* @see Format
* @author Alan Liu
@@ -102,6 +102,9 @@ class U_I18N_API MeasureFormat : public Format {
/**
* Constructor.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 53
*/
MeasureFormat(
@@ -109,6 +112,9 @@ class U_I18N_API MeasureFormat : public Format {
/**
* Constructor.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 53
*/
MeasureFormat(
@@ -228,6 +234,9 @@ class U_I18N_API MeasureFormat : public Format {
/**
* Return a formatter for CurrencyAmount objects in the given
* locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param locale desired locale
* @param ec input-output error code
* @return a formatter object, or NULL upon error
@@ -239,6 +248,9 @@ class U_I18N_API MeasureFormat : public Format {
/**
* Return a formatter for CurrencyAmount objects in the default
* locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param ec input-output error code
* @return a formatter object, or NULL upon error
* @stable ICU 3.0
+28 -1
View File
@@ -55,7 +55,7 @@ class StringEnumeration;
/**
* <p><strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* numberformatter.h fits their use case. Although not deprecated, this header
* is on life support and is provided for backwards compatibility only.
* is provided for backwards compatibility only.
* <hr/>
*
* Abstract base class for all number formats. Provides interface for
@@ -708,6 +708,9 @@ public:
/**
* Create a default style NumberFormat for the current default locale.
* The default formatting style is locale dependent.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 2.0
*/
static NumberFormat* U_EXPORT2 createInstance(UErrorCode&);
@@ -716,6 +719,9 @@ public:
* Create a default style NumberFormat for the specified locale.
* The default formatting style is locale dependent.
* @param inLocale the given locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 2.0
*/
static NumberFormat* U_EXPORT2 createInstance(const Locale& inLocale,
@@ -723,6 +729,9 @@ public:
/**
* Create a specific style NumberFormat for the specified locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param desiredLocale the given locale.
* @param style the given style.
* @param errorCode Output param filled with success/failure status.
@@ -759,12 +768,18 @@ public:
/**
* Returns a currency format for the current default locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 2.0
*/
static NumberFormat* U_EXPORT2 createCurrencyInstance(UErrorCode&);
/**
* Returns a currency format for the specified locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param inLocale the given locale.
* @stable ICU 2.0
*/
@@ -773,12 +788,18 @@ public:
/**
* Returns a percentage format for the current default locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 2.0
*/
static NumberFormat* U_EXPORT2 createPercentInstance(UErrorCode&);
/**
* Returns a percentage format for the specified locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param inLocale the given locale.
* @stable ICU 2.0
*/
@@ -787,12 +808,18 @@ public:
/**
* Returns a scientific format for the current default locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @stable ICU 2.0
*/
static NumberFormat* U_EXPORT2 createScientificInstance(UErrorCode&);
/**
* Returns a scientific format for the specified locale.
* <p>
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* @param inLocale the given locale.
* @stable ICU 2.0
*/
+4 -2
View File
@@ -1465,8 +1465,10 @@ int32_t RegexCImpl::appendReplacement(RegularExpression *regexp,
int32_t groupNum = 0;
U_ASSERT(c == DOLLARSIGN);
UChar32 c32;
U16_GET(replacementText, 0, replIdx, replacementLength, c32);
UChar32 c32 = -1;
if (replIdx < replacementLength) {
U16_GET(replacementText, 0, replIdx, replacementLength, c32);
}
if (u_isdigit(c32)) {
int32_t numDigits = 0;
int32_t numCaptureGroups = m->fPattern->fGroupMap->size();
+15
View File
@@ -757,6 +757,14 @@ static void TestFwdBack() {
}
}
/**
* Ticket #13636 - Visual Studio 2017 has problems optimizing this function.
* As a workaround, we will turn off optimization just for this function on VS2017 and above.
*/
#if defined(_MSC_VER) && (_MSC_VER > 1900)
#pragma optimize( "", off )
#endif
static void TestFwdBackUnsafe() {
/*
* Use a (mostly) well-formed UTF-8 string and test at code point boundaries.
@@ -842,6 +850,13 @@ static void TestFwdBackUnsafe() {
}
}
/**
* Ticket #13636 - Turn optimization back on.
*/
#if defined(_MSC_VER) && (_MSC_VER > 1900)
#pragma optimize( "", on )
#endif
static void TestSetChar() {
static const uint8_t input[]
= {0x61, 0xe4, 0xba, 0x8c, 0x7f, 0xfe, 0x62, 0xc5, 0x7f, 0x61, 0x80, 0x80, 0xe0, 0x00 };
+45 -10
View File
@@ -77,6 +77,7 @@ void IntlCalendarTest::runIndexedTest( int32_t index, UBool exec, const char* &n
CASE(7,TestPersian);
CASE(8,TestPersianFormat);
CASE(9,TestTaiwan);
CASE(10,TestJapaneseHeiseiToReiwa);
default: name = ""; break;
}
}
@@ -626,23 +627,23 @@ void IntlCalendarTest::TestJapanese3860()
// Test simple parse/format with adopt
UDate aDate = 0;
// Test parse with missing era (should default to current era, heisei)
// Test parse with missing era (should default to current era)
// Test parse with incomplete information
logln("Testing parse w/ missing era...");
SimpleDateFormat *fmt = new SimpleDateFormat(UnicodeString("y.M.d"), Locale("ja_JP@calendar=japanese"), status);
SimpleDateFormat *fmt = new SimpleDateFormat(UnicodeString("y/M/d"), Locale("ja_JP@calendar=japanese"), status);
CHECK(status, "creating date format instance");
if(!fmt) {
errln("Couldn't create en_US instance");
} else {
UErrorCode s2 = U_ZERO_ERROR;
cal2->clear();
UnicodeString samplestr("1.1.9");
UnicodeString samplestr("1/5/9");
logln(UnicodeString() + "Test Year: " + samplestr);
aDate = fmt->parse(samplestr, s2);
ParsePosition pp=0;
fmt->parse(samplestr, *cal2, pp);
CHECK(s2, "parsing the 1.1.9 string");
logln("*cal2 after 119 parse:");
CHECK(s2, "parsing the 1/5/9 string");
logln("*cal2 after 159 parse:");
str.remove();
fmt2->format(aDate, str);
logln(UnicodeString() + "as Gregorian Calendar: " + str);
@@ -653,7 +654,7 @@ void IntlCalendarTest::TestJapanese3860()
int32_t expectYear = 1;
int32_t expectEra = JapaneseCalendar::getCurrentEra();
if((gotYear!=1) || (gotEra != expectEra)) {
errln(UnicodeString("parse "+samplestr+" of 'y.m.d' as Japanese Calendar, expected year ") + expectYear +
errln(UnicodeString("parse "+samplestr+" of 'y/m/d' as Japanese Calendar, expected year ") + expectYear +
UnicodeString(" and era ") + expectEra +", but got year " + gotYear + " and era " + gotEra + " (Gregorian:" + str +")");
} else {
logln(UnicodeString() + " year: " + gotYear + ", era: " + gotEra);
@@ -666,7 +667,7 @@ void IntlCalendarTest::TestJapanese3860()
// Test simple parse/format with adopt
UDate aDate = 0;
// Test parse with missing era (should default to current era, heisei)
// Test parse with missing era (should default to current era)
// Test parse with incomplete information
logln("Testing parse w/ just year...");
SimpleDateFormat *fmt = new SimpleDateFormat(UnicodeString("y"), Locale("ja_JP@calendar=japanese"), status);
@@ -678,7 +679,7 @@ void IntlCalendarTest::TestJapanese3860()
cal2->clear();
UnicodeString samplestr("1");
logln(UnicodeString() + "Test Year: " + samplestr);
aDate = fmt->parse(samplestr, s2);
aDate = fmt->parse(samplestr, s2); // Should be parsed as the first day of the current era
ParsePosition pp=0;
fmt->parse(samplestr, *cal2, pp);
CHECK(s2, "parsing the 1 string");
@@ -691,7 +692,7 @@ void IntlCalendarTest::TestJapanese3860()
int32_t gotYear = cal2->get(UCAL_YEAR, s2);
int32_t gotEra = cal2->get(UCAL_ERA, s2);
int32_t expectYear = 1;
int32_t expectEra = 235; //JapaneseCalendar::kCurrentEra;
int32_t expectEra = JapaneseCalendar::getCurrentEra();
if((gotYear!=1) || (gotEra != expectEra)) {
errln(UnicodeString("parse "+samplestr+" of 'y' as Japanese Calendar, expected year ") + expectYear +
UnicodeString(" and era ") + expectEra +", but got year " + gotYear + " and era " + gotEra + " (Gregorian:" + str +")");
@@ -700,13 +701,47 @@ void IntlCalendarTest::TestJapanese3860()
}
delete fmt;
}
}
}
delete cal2;
delete cal;
delete fmt2;
}
void IntlCalendarTest::TestJapaneseHeiseiToReiwa() {
Calendar *cal;
UErrorCode status = U_ZERO_ERROR;
cal = Calendar::createInstance(status);
CHECK(status, UnicodeString("Creating default Gregorian Calendar"));
cal->set(2019, UCAL_APRIL, 29);
DateFormat *jfmt = DateFormat::createDateInstance(DateFormat::LONG, "ja@calendar=japanese");
CHECK(status, UnicodeString("Creating date format ja@calendar=japanese"))
const char* EXPECTED_FORMAT[4] = {
"\\u5E73\\u621031\\u5E744\\u670829\\u65E5", // Heisei 31 April 29
"\\u5E73\\u621031\\u5E744\\u670830\\u65E5", // Heisei 31 April 30
"\\u4EE4\\u548c1\\u5E745\\u67081\\u65E5", // Reiwa 1 May 1
"\\u4EE4\\u548c1\\u5E745\\u67082\\u65E5" // Reiwa 1 May 2
};
for (int32_t i = 0; i < 4; i++) {
UnicodeString dateStr;
UDate d = cal->getTime(status);
CHECK(status, UnicodeString("Get test date"));
jfmt->format(d, dateStr);
UnicodeString expected(UnicodeString(EXPECTED_FORMAT[i], -1, US_INV).unescape());
if (expected.compare(dateStr) != 0) {
errln(UnicodeString("Formatting year:") + cal->get(UCAL_YEAR, status) + " month:"
+ cal->get(UCAL_MONTH, status) + " day:" + (cal->get(UCAL_DATE, status) + 1)
+ " - expected: " + expected + " / actual: " + dateStr);
}
cal->add(UCAL_DATE, 1, status);
CHECK(status, UnicodeString("Add 1 day"));
}
delete jfmt;
delete cal;
}
+2 -1
View File
@@ -34,7 +34,8 @@ public:
void TestJapanese(void);
void TestJapaneseFormat(void);
void TestJapanese3860(void);
void TestJapaneseHeiseiToReiwa(void);
void TestPersian(void);
void TestPersianFormat(void);
+45
View File
@@ -39,6 +39,7 @@
#include "unicode/ustring.h"
#include "unicode/utext.h"
#include "unicode/utf16.h"
#include "cstr.h"
#include "regextst.h"
#include "regexcmp.h"
#include "uvector.h"
@@ -101,6 +102,8 @@ void RegexTest::runIndexedTest( int32_t index, UBool exec, const char* &name, ch
TESTCASE_AUTO(NamedCapture);
TESTCASE_AUTO(NamedCaptureLimits);
TESTCASE_AUTO(TestBug12884);
TESTCASE_AUTO(TestBug13631);
TESTCASE_AUTO(TestBug13632);
TESTCASE_AUTO_END;
}
@@ -5806,4 +5809,46 @@ void RegexTest::TestBug12884() {
REGEX_ASSERT(status == U_REGEX_TIME_OUT);
}
// Bug 13631. A find() of a pattern with a zero length look-behind assertions
// can cause a read past the end of the input text.
// The failure is seen when running this test with Clang's Addresss Sanitizer.
void RegexTest::TestBug13631() {
const UChar *pats[] = { u"(?<!^)",
u"(?<=^)",
nullptr
};
for (const UChar **pat=pats; *pat; ++pat) {
UErrorCode status = U_ZERO_ERROR;
UnicodeString upat(*pat);
RegexMatcher matcher(upat, 0, status);
const UChar s =u'a';
UText *ut = utext_openUChars(nullptr, &s, 1, &status);
REGEX_CHECK_STATUS;
matcher.reset(ut);
while (matcher.find()) {
}
utext_close(ut);
}
}
// Bug 13632 Out of bounds memory reference if a replacement string ends with a '$',
// where a following group specification would be expected.
// Failure shows when running the test under Clang's Address Sanitizer.
void RegexTest::TestBug13632() {
UErrorCode status = U_ZERO_ERROR;
URegularExpression *re = uregex_openC(" ", 0, nullptr, &status);
const char16_t *sourceString = u"Hello, world.";
uregex_setText(re, sourceString, u_strlen(sourceString), &status);
const int32_t destCap = 20;
char16_t dest[destCap] = {};
const char16_t replacement[] = {u'x', u'$'}; // Not nul terminated string.
uregex_replaceAll(re, replacement, 2, dest, destCap, &status);
assertEquals("", U_REGEX_INVALID_CAPTURE_GROUP_NAME, status);
uregex_close(re);
}
#endif /* !UCONFIG_NO_REGULAR_EXPRESSIONS */
+3 -1
View File
@@ -57,7 +57,9 @@ public:
virtual void TestBug11371();
virtual void TestBug11480();
virtual void TestBug12884();
virtual void TestBug13631();
virtual void TestBug13632();
// The following functions are internal to the regexp tests.
virtual void assertUText(const char *expected, UText *actual, const char *file, int line);
virtual void assertUTextInvariant(const char *invariant, UText *actual, const char *file, int line);
+5 -5
View File
@@ -494,35 +494,35 @@ format:table(nofallback) {
"",
"PATTERN=G y",
"YEAR=8",
"Heisei 8"
"Reiwa 8"
},
{
"en_US@calendar=japanese",
"",
"PATTERN=G yy",
"YEAR=8",
"Heisei 08"
"Reiwa 08"
},
{
"en_US@calendar=japanese",
"",
"PATTERN=G yyy",
"YEAR=8",
"Heisei 008"
"Reiwa 008"
},
{
"en_US@calendar=japanese",
"",
"PATTERN=G yyyy",
"YEAR=8",
"Heisei 0008"
"Reiwa 0008"
},
{
"en_US@calendar=japanese",
"",
"PATTERN=G yyyyy",
"YEAR=8",
"Heisei 00008"
"Reiwa 00008"
},
}
+3
View File
@@ -25789,6 +25789,7 @@ structLocale:table(nofallback){
"",
"",
"",
"",
}
wide{
"",
@@ -26027,6 +26028,7 @@ structLocale:table(nofallback){
"",
"",
"",
"",
}
narrow{
"",
@@ -26265,6 +26267,7 @@ structLocale:table(nofallback){
"",
"",
"",
"",
}
}
intervalFormats{
+11 -16
View File
@@ -9,25 +9,24 @@
#include <iostream>
#include <fstream>
// Include this even though we aren't linking against it.
// We only use U8_* macros, which are entirely inline.
#include "unicode/utf8.h"
// Include this here, to avoid needing to compile and link part of common lib
// (bootstrapping problem)
#include "utf_impl.cpp"
// This contains a codepage and ISO 14882:1998 illegality table.
// Use "make gen-table" to rebuild it.
#include "cptbl.h"
/**
* What is this?
* or even:
* what IS this??
*
*
* "This" is a preprocessor that makes an attempt to convert fully valid C++11 source code
* in utf-8 into.. something else. Something consumable by certain compilers (Solaris, xlC)
* which aren't quite there.
* in utf-8 into something consumable by certain compilers (Solaris, xlC)
* which aren't quite standards compliant.
*
* - u"<unicode>" or u'<unicode>' gets converted to u"\uNNNN" or u'\uNNNN'
* - u8"<unicode>" gets converted to "\xAA\xBB\xCC\xDD" etc.
* - if the system is EBCDIC-based, well, that's taken into account.
* (some compilers do not support the u8 prefix correctly.)
* - if the system is EBCDIC-based, that is used to correct the input characters.
*
* Usage:
* escapesrc infile.cpp outfile.cpp
@@ -38,8 +37,8 @@
* %.o: _%.cpp
* $(COMPILE.cc) ... $@ $<
*
* Naturally, 'escapesrc' has to be excluded from said build rule.
* In the Makefiles, SKIP_ESCAPING=YES is used to prevent escapesrc.cpp
* from being itself escaped.
*/
@@ -49,10 +48,6 @@ static const char
kLF = 0x0A,
kCR = 0x0D;
// This contains a codepage and ISO 14882:1998 illegality table.
// Use "make gen-table" to rebuild it.
# include "cptbl.h"
// For convenience
# define cp1047_to_8859(c) cp1047_8859_1[c]
+3 -3
View File
@@ -6,7 +6,7 @@
#*******************************************************************************
api.report.version = 61
api.report.prev.version = 60
release.file.ver = 61rc
api.doc.version = 61 Release Candidate
maven.pom.ver = 61.1-SHAPSHOT
release.file.ver = 61_2
api.doc.version = 61.2
maven.pom.ver = 61.2
+1 -1
View File
@@ -57,7 +57,7 @@
<property name="icu4j.api.doc.window.title" value="ICU4J ${api.doc.version}"/>
<property name="icu4j.api.doc.header" value="ICU4J ${api.doc.version}"/>
<property name="icu4j.api.doc.jdk.link" value="http://docs.oracle.com/javase/8/docs/api/"/>
<property name="icu4j.api.doc.jdk.link" value="https://docs.oracle.com/javase/8/docs/api/"/>
<property name="icu4j.api.doc.copyright.footer" value="&lt;font size=-1&gt;Copyright &#x00A9; 2016 Unicode, Inc. and others.&lt;/font&gt;"/>
<!-- API docs for maven repo -->
+1 -1
View File
@@ -4,6 +4,6 @@
#* Copyright (C) 2010-2016, International Business Machines Corporation and *
#* others. All Rights Reserved. *
#*******************************************************************************
icu4j.plugin.impl.version.string=61.1.0
icu4j.plugin.impl.version.string=61.2.0
copyright.eclipse=(C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html#License
icu4j.data.version.number=61
@@ -23,8 +23,7 @@ import com.ibm.icu.util.ULocale;
* <p>
* <strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* {@link NumberFormatter} fits their use case. Although not deprecated, this
* class, CompactDecimalFormat, is on life support and is provided for
* backwards compatibility only.
* class, CompactDecimalFormat, is provided for backwards compatibility only.
* <hr>
*
* The CompactDecimalFormat produces abbreviated numbers, suitable for display in environments will
@@ -80,6 +79,9 @@ public class CompactDecimalFormat extends DecimalFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Creates a CompactDecimalFormat appropriate for a locale. The result may be affected by the
* number system in the locale, such as ar-u-nu-latn.
*
@@ -92,6 +94,9 @@ public class CompactDecimalFormat extends DecimalFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Creates a CompactDecimalFormat appropriate for a locale. The result may be affected by the
* number system in the locale, such as ar-u-nu-latn.
*
@@ -39,8 +39,7 @@ import com.ibm.icu.util.ULocale.Category;
* <p>
* <strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* {@link NumberFormatter} fits their use case. Although not deprecated, this
* class, DecimalFormat, is on life support and is only provided for
* java.text.DecimalFormat compatibility.
* class, DecimalFormat, is only provided for java.text.DecimalFormat compatibility.
* <hr>
*
* <code>DecimalFormat</code> is the primary
@@ -58,8 +58,7 @@ import com.ibm.icu.util.UResourceBundle;
* <p>
* <strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* {@link NumberFormatter} fits their use case. Although not deprecated, this
* class, MeasureFormat, is on life support and is provided for
* backwards compatibility only.
* class, MeasureFormat, is provided for backwards compatibility only.
* <hr>
*
* <p>
@@ -39,8 +39,7 @@ import com.ibm.icu.util.UResourceBundle;
* <p>
* <strong>IMPORTANT:</strong> New users are strongly encouraged to see if
* {@link NumberFormatter} fits their use case. Although not deprecated, this
* class, NumberFormat, is on life support and is only provided for
* java.text.NumberFormat compatibility.
* class, NumberFormat, is only provided for java.text.NumberFormat compatibility.
* <hr>
*
* <code>NumberFormat</code> is the abstract base class for all number
@@ -585,6 +584,9 @@ public abstract class NumberFormat extends UFormat {
//============== Locale Stuff =====================
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns the default number format for the current default <code>FORMAT</code> locale.
* The default format is one of the styles provided by the other
* factory methods: getNumberInstance, getIntegerInstance,
@@ -599,6 +601,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns the default number format for the specified locale.
* The default format is one of the styles provided by the other
* factory methods: getNumberInstance, getCurrencyInstance or getPercentInstance.
@@ -610,6 +615,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns the default number format for the specified locale.
* The default format is one of the styles provided by the other
* factory methods: getNumberInstance, getCurrencyInstance or getPercentInstance.
@@ -621,6 +629,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a specific style number format for default <code>FORMAT</code> locale.
* @param style number format style
* @see Category#FORMAT
@@ -631,6 +642,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a specific style number format for a specific locale.
* @param inLocale the specific locale.
* @param style number format style
@@ -642,6 +656,9 @@ public abstract class NumberFormat extends UFormat {
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a general-purpose number format for the current default <code>FORMAT</code> locale.
* @see Category#FORMAT
* @stable ICU 2.0
@@ -651,6 +668,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a general-purpose number format for the specified locale.
* @stable ICU 2.0
*/
@@ -659,6 +679,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a general-purpose number format for the specified locale.
* @stable ICU 3.2
*/
@@ -667,6 +690,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns an integer number format for the current default <code>FORMAT</code> locale. The
* returned number format is configured to round floating point numbers
* to the nearest integer using IEEE half-even rounding (see {@link
@@ -684,6 +710,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns an integer number format for the specified locale. The
* returned number format is configured to round floating point numbers
* to the nearest integer using IEEE half-even rounding (see {@link
@@ -701,6 +730,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns an integer number format for the specified locale. The
* returned number format is configured to round floating point numbers
* to the nearest integer using IEEE half-even rounding (see {@link
@@ -717,6 +749,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a currency format for the current default <code>FORMAT</code> locale.
* @return a number format for currency
* @see Category#FORMAT
@@ -727,6 +762,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a currency format for the specified locale.
* @return a number format for currency
* @stable ICU 2.0
@@ -736,6 +774,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a currency format for the specified locale.
* @return a number format for currency
* @stable ICU 3.2
@@ -745,6 +786,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a percentage format for the current default <code>FORMAT</code> locale.
* @return a number format for percents
* @see Category#FORMAT
@@ -755,6 +799,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a percentage format for the specified locale.
* @return a number format for percents
* @stable ICU 2.0
@@ -764,6 +811,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a percentage format for the specified locale.
* @return a number format for percents
* @stable ICU 3.2
@@ -773,6 +823,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a scientific format for the current default <code>FORMAT</code> locale.
* @return a scientific number format
* @see Category#FORMAT
@@ -783,6 +836,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a scientific format for the specified locale.
* @return a scientific number format
* @stable ICU 2.0
@@ -792,6 +848,9 @@ public abstract class NumberFormat extends UFormat {
}
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* {@icu} Returns a scientific format for the specified locale.
* @return a scientific number format
* @stable ICU 3.2
@@ -1345,6 +1404,9 @@ public abstract class NumberFormat extends UFormat {
/**
* <strong>NOTE:</strong> New users are strongly encouraged to use
* {@link NumberFormatter} instead of NumberFormat.
* <hr>
* Returns a specific style number format for a specific locale.
* @param desiredLocale the specific locale.
* @param choice number format style
@@ -562,6 +562,7 @@ public class JapaneseCalendar extends GregorianCalendar {
1912, 7, 30, // Taisho
1926, 12, 25, // Showa
1989, 1, 8, // Heisei
2019, 5, 1, // Reiwa
};
//-------------------------------------------------------------------------
@@ -578,25 +579,25 @@ public class JapaneseCalendar extends GregorianCalendar {
* Constant for the era starting on Sept. 8, 1868 AD.
* @stable ICU 2.8
*/
static public final int MEIJI = CURRENT_ERA - 3;
static public final int MEIJI = CURRENT_ERA - 4;
/**
* Constant for the era starting on July 30, 1912 AD.
* @stable ICU 2.8
*/
static public final int TAISHO = CURRENT_ERA - 2;
static public final int TAISHO = CURRENT_ERA - 3;
/**
* Constant for the era starting on Dec. 25, 1926 AD.
* @stable ICU 2.8
*/
static public final int SHOWA = CURRENT_ERA - 1;
static public final int SHOWA = CURRENT_ERA - 2;
/**
* Constant for the era starting on Jan. 7, 1989 AD.
* @stable ICU 2.8
*/
static public final int HEISEI = CURRENT_ERA;
static public final int HEISEI = CURRENT_ERA - 1;
/**
* Override GregorianCalendar. We should really handle YEAR_WOY and
@@ -567,7 +567,7 @@ public final class VersionInfo implements Comparable<VersionInfo>
UNICODE_9_0 = getInstance(9, 0, 0, 0);
UNICODE_10_0 = getInstance(10, 0, 0, 0);
ICU_VERSION = getInstance(61, 1, 0, 0);
ICU_VERSION = getInstance(61, 2, 0, 0);
ICU_DATA_VERSION = ICU_VERSION;
UNICODE_VERSION = UNICODE_10_0;
+1 -1
View File
@@ -7,7 +7,7 @@
# Version numbers, etc.
icu4j.spec.version = 61
icu4j.impl.version = 61.1
icu4j.impl.version = 61.2
icu4j.data.version = 61
default.exec.env = JavaSE-1.6
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3eb8332f908b83c82671f2b652d0bfdcc1c8da416884d0e358464af42af4f959
size 12505745
oid sha256:3bf9179b3dfe47e4058f488d112e3a62c76cb3bbc08b7f4e534e34b4556a3a28
size 12505677
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d95bab418a9b465de9415e4e9f878330dbc5f7d6cddc416c492ad871f514fa82
size 92763
oid sha256:7c9ef6e0f6924d9d638d6a613470c1da9d6bd50730f6fe49a73b7f31c873fc4f
size 94073
+1 -1
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d6f74e0bb0de91023fcf6b0aec8acab619da6854baae4609b0808bb7dcec9d2
oid sha256:f7065caf72e2a07700c7bffd4cf968b92fa8c61dad392231c30718949d2fc268
size 813161
+31 -2
View File
@@ -1,7 +1,7 @@
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
Copyright © 1991-2017 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html
Copyright © 1991-2018 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
@@ -383,3 +383,32 @@ Database section 7.
# by ICANN or the IETF Trust on the database or the code. Any person
# making a contribution to the database or code waives all rights to
# future claims in that contribution or in the TZ Database.
6. Google double-conversion
Copyright 2006-2011, the V8 project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -154,9 +154,9 @@ public class JapaneseTest extends CalendarTestFmwk {
Calendar cal = new JapaneseCalendar(loc);
DateFormat enjformat = cal.getDateTimeFormat(0,0,new ULocale("en_JP@calendar=japanese"));
DateFormat format = cal.getDateTimeFormat(0,0,loc);
((SimpleDateFormat)format).applyPattern("y.M.d"); // Note: just 'y' doesn't work here.
((SimpleDateFormat)format).applyPattern("y/M/d"); // Note: just 'y' doesn't work here.
ParsePosition pos = new ParsePosition(0);
Date aDate = format.parse("1.1.9", pos); // after the start of heisei accession. Jan 1, 1H wouldn't work because it is actually showa 64
Date aDate = format.parse("1/5/9", pos); // after the start of Reiwa accession. Jan 1, R1 wouldn't work because it is actually Heisei 31
String inEn = enjformat.format(aDate);
cal.clear();
@@ -165,7 +165,7 @@ public class JapaneseTest extends CalendarTestFmwk {
int gotEra = cal.get(Calendar.ERA);
int expectYear = 1;
int expectEra = JapaneseCalendar.CURRENT_ERA;
int expectEra = JapaneseCalendar.CURRENT_ERA; // Reiwa
if((gotYear != expectYear) || (gotEra != expectEra)) {
errln("Expected year " + expectYear + ", era " + expectEra +", but got year " + gotYear + " and era " + gotEra + ", == " + inEn);
@@ -173,7 +173,7 @@ public class JapaneseTest extends CalendarTestFmwk {
logln("Got year " + gotYear + " and era " + gotEra + ", == " + inEn);
}
// Test parse with missing era (should default to current era, heisei)
// Test parse with missing era (should default to current era)
// Test parse with incomplete information
logln("Testing parse w/ just year...");
Calendar cal2 = new JapaneseCalendar(loc);
@@ -197,7 +197,7 @@ public class JapaneseTest extends CalendarTestFmwk {
gotYear = cal2.get(Calendar.YEAR);
gotEra = cal2.get(Calendar.ERA);
expectYear = 1;
expectEra = JapaneseCalendar.CURRENT_ERA;
expectEra = JapaneseCalendar.CURRENT_ERA; // Reiwa
if((gotYear != 1) || (gotEra != expectEra)) {
errln("parse "+ samplestr + " of 'y' as Japanese Calendar, expected year " + expectYear +
" and era " + expectEra + ", but got year " + gotYear + " and era " + gotEra + " (Gregorian:" + str +")");
@@ -379,5 +379,30 @@ public class JapaneseTest extends CalendarTestFmwk {
doLimitsTest(jcal, null, cal.getTime());
doTheoreticalLimitsTest(jcal, true);
}
public void TestHeiseiToReiwa() {
Calendar cal = Calendar.getInstance();
cal.set(2019, Calendar.APRIL, 29);
DateFormat jfmt = DateFormat.getDateInstance(DateFormat.LONG, new ULocale("ja@calendar=japanese"));
final String[] EXPECTED_FORMAT = {
"\u5E73\u621031\u5E744\u670829\u65E5", // Heisei 31 April 29
"\u5E73\u621031\u5E744\u670830\u65E5", // Heisei 31 April 30
"\u4EE4\u548C1\u5E745\u67081\u65E5", // Reiwa 1 May 1
"\u4EE4\u548C1\u5E745\u67082\u65E5", // Reiwa 1 May 2
};
for (int i = 0; i < EXPECTED_FORMAT.length; i++) {
Date d = cal.getTime();
String dateStr = jfmt.format(d);
if (!EXPECTED_FORMAT[i].equals(dateStr)) {
errln("Formatting year:" + cal.get(Calendar.YEAR) + " month:" + (cal.get(Calendar.MONTH) + 1)
+ " day:" + cal.get(Calendar.DATE) + " - expected: " + EXPECTED_FORMAT[i]
+ " / actual: " + dateStr);
}
cal.add(Calendar.DATE, 1);
}
}
}
@@ -10,7 +10,7 @@
package com.ibm.icu.dev.test.util;
public class DebugUtilitiesData extends Object {
public static final String ICU4C_VERSION="61.1";
public static final String ICU4C_VERSION="61.2";
public static final int UDebugEnumType = 0;
public static final int UCalendarDateFields = 1;
public static final int UCalendarMonths = 2;
+15 -13
View File
@@ -17,17 +17,18 @@
</description>
<url>http://icu-project.org/</url>
<inceptionYear>2001</inceptionYear>
<licenses>
<license>
<name>Unicode/ICU License</name>
<url>http://source.icu-project.org/repos/icu/trunk/icu4j/main/shared/licenses/LICENSE</url>
<url>https://raw.githubusercontent.com/unicode-org/icu/master/icu4c/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>mark</id>
<id>macchiati</id>
<name>Mark Davis</name>
<organization>Google</organization>
<roles>
@@ -35,7 +36,7 @@
</roles>
</developer>
<developer>
<id>emmons</id>
<id>JCEmmons</id>
<name>John Emmons</name>
<organization>IBM Corporation</organization>
<roles>
@@ -43,7 +44,7 @@
</roles>
</developer>
<developer>
<id>doug</id>
<id>dougfelt</id>
<name>Doug Felt</name>
<organization>Google</organization>
<roles>
@@ -59,7 +60,7 @@
</roles>
</developer>
<developer>
<id>srl</id>
<id>srl295</id>
<name>Steven Loomis</name>
<organization>IBM Corporation</organization>
<roles>
@@ -67,7 +68,7 @@
</roles>
</developer>
<developer>
<id>markus</id>
<id>markusicu</id>
<name>Markus Scherer</name>
<organization>Google</organization>
<roles>
@@ -83,7 +84,7 @@
</roles>
</developer>
<developer>
<id>yoshito</id>
<id>yumaoka</id>
<name>Yoshito Umaoka</name>
<organization>IBM Corporation</organization>
<roles>
@@ -117,13 +118,14 @@
</mailingLists>
<scm>
<connection>scm:svn:http://source.icu-project.org/repos/icu/trunk/icu4j</connection>
<developerConnection>scm:svn:http://source.icu-project.org/repos/icu/trunk/icu4j</developerConnection>
<url>http://source.icu-project.org/repos/icu/trunk/icu4j</url>
<connection>scm:git:git://github.com/unicode-org/icu.git</connection>
<developerConnection>scm:git:git@github.com:unicode-org/icu.git</developerConnection>
<url>https://github.com/unicode-org/icu</url>
</scm>
<issueManagement>
<system>Trac</system>
<url>http://bugs.icu-project.org/trac/</url>
<system>JIRA</system>
<url>https://unicode-org.atlassian.net/projects/ICU</url>
</issueManagement>
<distributionManagement>
@@ -146,4 +148,4 @@
<version>@POMVERSION@</version>
</dependency>
</dependencies>
</project>
</project>
+15 -13
View File
@@ -17,17 +17,18 @@
</description>
<url>http://icu-project.org/</url>
<inceptionYear>2001</inceptionYear>
<licenses>
<license>
<name>Unicode/ICU License</name>
<url>http://source.icu-project.org/repos/icu/trunk/icu4j/main/shared/licenses/LICENSE</url>
<url>https://raw.githubusercontent.com/unicode-org/icu/master/icu4c/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>mark</id>
<id>macchiati</id>
<name>Mark Davis</name>
<organization>Google</organization>
<roles>
@@ -35,7 +36,7 @@
</roles>
</developer>
<developer>
<id>emmons</id>
<id>JCEmmons</id>
<name>John Emmons</name>
<organization>IBM Corporation</organization>
<roles>
@@ -43,7 +44,7 @@
</roles>
</developer>
<developer>
<id>doug</id>
<id>dougfelt</id>
<name>Doug Felt</name>
<organization>Google</organization>
<roles>
@@ -59,7 +60,7 @@
</roles>
</developer>
<developer>
<id>srl</id>
<id>srl295</id>
<name>Steven Loomis</name>
<organization>IBM Corporation</organization>
<roles>
@@ -67,7 +68,7 @@
</roles>
</developer>
<developer>
<id>markus</id>
<id>markusicu</id>
<name>Markus Scherer</name>
<organization>Google</organization>
<roles>
@@ -83,7 +84,7 @@
</roles>
</developer>
<developer>
<id>yoshito</id>
<id>yumaoka</id>
<name>Yoshito Umaoka</name>
<organization>IBM Corporation</organization>
<roles>
@@ -117,13 +118,14 @@
</mailingLists>
<scm>
<connection>scm:svn:http://source.icu-project.org/repos/icu/trunk/icu4j</connection>
<developerConnection>scm:svn:http://source.icu-project.org/repos/icu/trunk/icu4j</developerConnection>
<url>http://source.icu-project.org/repos/icu/trunk/icu4j</url>
<connection>scm:git:git://github.com/unicode-org/icu.git</connection>
<developerConnection>scm:git:git@github.com:unicode-org/icu.git</developerConnection>
<url>https://github.com/unicode-org/icu</url>
</scm>
<issueManagement>
<system>Trac</system>
<url>http://bugs.icu-project.org/trac/</url>
<system>JIRA</system>
<url>https://unicode-org.atlassian.net/projects/ICU</url>
</issueManagement>
<distributionManagement>
@@ -146,4 +148,4 @@
<version>@POMVERSION@</version>
</dependency>
</dependencies>
</project>
</project>
+15 -13
View File
@@ -22,17 +22,18 @@
</description>
<url>http://icu-project.org/</url>
<inceptionYear>2001</inceptionYear>
<licenses>
<license>
<name>Unicode/ICU License</name>
<url>http://source.icu-project.org/repos/icu/trunk/icu4j/main/shared/licenses/LICENSE</url>
<url>https://raw.githubusercontent.com/unicode-org/icu/master/icu4c/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>mark</id>
<id>macchiati</id>
<name>Mark Davis</name>
<organization>Google</organization>
<roles>
@@ -40,7 +41,7 @@
</roles>
</developer>
<developer>
<id>emmons</id>
<id>JCEmmons</id>
<name>John Emmons</name>
<organization>IBM Corporation</organization>
<roles>
@@ -48,7 +49,7 @@
</roles>
</developer>
<developer>
<id>doug</id>
<id>dougfelt</id>
<name>Doug Felt</name>
<organization>Google</organization>
<roles>
@@ -64,7 +65,7 @@
</roles>
</developer>
<developer>
<id>srl</id>
<id>srl295</id>
<name>Steven Loomis</name>
<organization>IBM Corporation</organization>
<roles>
@@ -72,7 +73,7 @@
</roles>
</developer>
<developer>
<id>markus</id>
<id>markusicu</id>
<name>Markus Scherer</name>
<organization>Google</organization>
<roles>
@@ -88,7 +89,7 @@
</roles>
</developer>
<developer>
<id>yoshito</id>
<id>yumaoka</id>
<name>Yoshito Umaoka</name>
<organization>IBM Corporation</organization>
<roles>
@@ -122,13 +123,14 @@
</mailingLists>
<scm>
<connection>scm:svn:http://source.icu-project.org/repos/icu/trunk/icu4j</connection>
<developerConnection>scm:svn:http://source.icu-project.org/repos/icu/trunk/icu4j</developerConnection>
<url>http://source.icu-project.org/repos/icu/trunk/icu4j</url>
<connection>scm:git:git://github.com/unicode-org/icu.git</connection>
<developerConnection>scm:git:git@github.com:unicode-org/icu.git</developerConnection>
<url>https://github.com/unicode-org/icu</url>
</scm>
<issueManagement>
<system>Trac</system>
<url>http://bugs.icu-project.org/trac/</url>
<system>JIRA</system>
<url>https://unicode-org.atlassian.net/projects/ICU</url>
</issueManagement>
<distributionManagement>
@@ -143,4 +145,4 @@
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
</project>
+10 -8
View File
@@ -14,21 +14,23 @@ h3.doc { text-decoration: underline }
<body style="background-color: rgb(255, 255, 255);" lang="EN-US"
link="#0000ff" vlink="#800080">
<h1>International Components for Unicode for Java (ICU4J)</h1>
<h2>Read Me for ICU4J 61 Release Candidate</h2>
(Last Update: 2018-Mar-7)
<h2>Read Me for ICU4J 61.2</h2>
(Last Update: 2019-Apr-9)
<hr size="2" width="100%">
<p>
<b>Note:</b> This is an update release of ICU4J 61. This release contains bug
fixes and updated data, but does not introduce any new APIs for functionatlites.
<!-- <b>Note:</b> This is major release of ICU4J. It contains bug fixes and adds implementations
of inherited API and introduces new API or functionality. -->
<!-- <b>Note:</b> This is a development milestone of ICU4J 62.
The contents of this document may not reflect the recent changes done
for ICU 62 development. It is not recommended for production use. -->
<b>Note:</b> This is a release candidate of ICU4J 61.
<!-- <b>Note:</b> This is a release candidate of ICU4J 61.
The contents of this document may not reflect the recent changes done
for ICU 61 development. This release candidate is intended for those
wishing to verify ICU 61 integration before final release. It is not
recommended for production use.
recommended for production use.-->
</p>
<p>For the most recent release, see the <a
href="http://www.icu-project.org/download/"> ICU4J
@@ -143,7 +145,7 @@ found in ICU4J.</p>
<p>See the <a href="https://sites.google.com/site/icusite/download/61">ICU 61 download page</a>
about new features in this release.</p>
<p>The list of API changes since the previous ICU4J release is available
<a href="http://source.icu-project.org/repos/icu/tags/release-61-rc/icu4j/APIChangeReport.html">here</a>.</p>
<a href="http://source.icu-project.org/repos/icu/tags/release-61-1/icu4j/APIChangeReport.html">here</a>.</p>
<!-- ICU 61 items -->
<!-- <h3>[Subject]</h3> -->
@@ -180,19 +182,19 @@ builds, and they are packaged in jar files for convenient download.
&lt;dependency&gt;
&lt;groupId&gt;com.ibm.icu&lt;/groupId&gt;
&lt;artifactId&gt;icu4j&lt;/artifactId&gt;
&lt;version&gt;61.1&lt;/version&gt;
&lt;version&gt;61.2&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.ibm.icu&lt;/groupId&gt;
&lt;artifactId&gt;icu4j-charset&lt;/artifactId&gt;
&lt;version&gt;61.1&lt;/version&gt;
&lt;version&gt;61.2&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.ibm.icu&lt;/groupId&gt;
&lt;artifactId&gt;icu4j-localespi&lt;/artifactId&gt;
&lt;version&gt;61.1&lt;/version&gt;
&lt;version&gt;61.2&lt;/version&gt;
&lt;/dependency&gt;
</pre>
</ul>