summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/i18n
diff options
context:
space:
mode:
authorSteven R. Loomis <srloomis@us.ibm.com>2017-04-13 16:25:08 -0700
committerSteven R. Loomis <srloomis@us.ibm.com>2017-05-09 15:20:02 -0700
commit5d0a770c129c00e3942263b429f8efa4c42efba9 (patch)
tree0766989dae39097084b6c5c8e2f75bf92812c713 /deps/icu-small/source/i18n
parent147048a0d3e255d2a0604f3ab7c8f62252cb8252 (diff)
downloadandroid-node-v8-5d0a770c129c00e3942263b429f8efa4c42efba9.tar.gz
android-node-v8-5d0a770c129c00e3942263b429f8efa4c42efba9.tar.bz2
android-node-v8-5d0a770c129c00e3942263b429f8efa4c42efba9.zip
deps: ICU 59.1 bump
* No feature changes. * Bug fixes. * Details: http://site.icu-project.org/download/59 Fixes: https://github.com/nodejs/node/issues/12077 PR-URL: https://github.com/nodejs/node/pull/12486 Refs: https://github.com/nodejs/node/issues/7844 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'deps/icu-small/source/i18n')
-rw-r--r--deps/icu-small/source/i18n/affixpatternparser.cpp4
-rw-r--r--deps/icu-small/source/i18n/affixpatternparser.h2
-rw-r--r--deps/icu-small/source/i18n/alphaindex.cpp2
-rw-r--r--deps/icu-small/source/i18n/anytrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/anytrans.h2
-rw-r--r--deps/icu-small/source/i18n/astro.cpp2
-rw-r--r--deps/icu-small/source/i18n/astro.h2
-rw-r--r--deps/icu-small/source/i18n/basictz.cpp2
-rw-r--r--deps/icu-small/source/i18n/bocsu.cpp4
-rw-r--r--deps/icu-small/source/i18n/bocsu.h4
-rw-r--r--deps/icu-small/source/i18n/brktrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/brktrans.h2
-rw-r--r--deps/icu-small/source/i18n/buddhcal.cpp2
-rw-r--r--deps/icu-small/source/i18n/buddhcal.h2
-rw-r--r--deps/icu-small/source/i18n/calendar.cpp2
-rw-r--r--deps/icu-small/source/i18n/casetrn.cpp12
-rw-r--r--deps/icu-small/source/i18n/casetrn.h5
-rw-r--r--deps/icu-small/source/i18n/cecal.cpp2
-rw-r--r--deps/icu-small/source/i18n/cecal.h2
-rw-r--r--deps/icu-small/source/i18n/chnsecal.cpp2
-rw-r--r--deps/icu-small/source/i18n/chnsecal.h2
-rw-r--r--deps/icu-small/source/i18n/choicfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/coleitr.cpp3
-rw-r--r--deps/icu-small/source/i18n/coll.cpp2
-rw-r--r--deps/icu-small/source/i18n/collation.cpp2
-rw-r--r--deps/icu-small/source/i18n/collation.h2
-rw-r--r--deps/icu-small/source/i18n/collationbuilder.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationbuilder.h2
-rw-r--r--deps/icu-small/source/i18n/collationcompare.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationcompare.h2
-rw-r--r--deps/icu-small/source/i18n/collationdata.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationdata.h2
-rw-r--r--deps/icu-small/source/i18n/collationdatabuilder.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationdatabuilder.h2
-rw-r--r--deps/icu-small/source/i18n/collationdatareader.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationdatareader.h2
-rw-r--r--deps/icu-small/source/i18n/collationdatawriter.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationdatawriter.h2
-rw-r--r--deps/icu-small/source/i18n/collationfastlatin.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationfastlatin.h2
-rw-r--r--deps/icu-small/source/i18n/collationfastlatinbuilder.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationfastlatinbuilder.h2
-rw-r--r--deps/icu-small/source/i18n/collationfcd.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationfcd.h2
-rw-r--r--deps/icu-small/source/i18n/collationiterator.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationiterator.h2
-rw-r--r--deps/icu-small/source/i18n/collationkeys.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationkeys.h2
-rw-r--r--deps/icu-small/source/i18n/collationroot.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationroot.h2
-rw-r--r--deps/icu-small/source/i18n/collationrootelements.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationrootelements.h2
-rw-r--r--deps/icu-small/source/i18n/collationruleparser.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationruleparser.h2
-rw-r--r--deps/icu-small/source/i18n/collationsets.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationsets.h2
-rw-r--r--deps/icu-small/source/i18n/collationsettings.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationsettings.h2
-rw-r--r--deps/icu-small/source/i18n/collationtailoring.cpp2
-rw-r--r--deps/icu-small/source/i18n/collationtailoring.h2
-rw-r--r--deps/icu-small/source/i18n/collationweights.cpp4
-rw-r--r--deps/icu-small/source/i18n/collationweights.h4
-rw-r--r--deps/icu-small/source/i18n/collunsafe.h2
-rw-r--r--deps/icu-small/source/i18n/compactdecimalformat.cpp21
-rw-r--r--deps/icu-small/source/i18n/coptccal.cpp2
-rw-r--r--deps/icu-small/source/i18n/coptccal.h2
-rw-r--r--deps/icu-small/source/i18n/cpdtrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/cpdtrans.h2
-rw-r--r--deps/icu-small/source/i18n/csdetect.cpp2
-rw-r--r--deps/icu-small/source/i18n/csdetect.h2
-rw-r--r--deps/icu-small/source/i18n/csmatch.cpp2
-rw-r--r--deps/icu-small/source/i18n/csmatch.h2
-rw-r--r--deps/icu-small/source/i18n/csr2022.cpp2
-rw-r--r--deps/icu-small/source/i18n/csr2022.h2
-rw-r--r--deps/icu-small/source/i18n/csrecog.cpp2
-rw-r--r--deps/icu-small/source/i18n/csrecog.h2
-rw-r--r--deps/icu-small/source/i18n/csrmbcs.cpp2
-rw-r--r--deps/icu-small/source/i18n/csrmbcs.h2
-rw-r--r--deps/icu-small/source/i18n/csrsbcs.cpp2
-rw-r--r--deps/icu-small/source/i18n/csrsbcs.h2
-rw-r--r--deps/icu-small/source/i18n/csrucode.cpp2
-rw-r--r--deps/icu-small/source/i18n/csrucode.h2
-rw-r--r--deps/icu-small/source/i18n/csrutf8.cpp2
-rw-r--r--deps/icu-small/source/i18n/csrutf8.h2
-rw-r--r--deps/icu-small/source/i18n/curramt.cpp6
-rw-r--r--deps/icu-small/source/i18n/currfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/currfmt.h2
-rw-r--r--deps/icu-small/source/i18n/currpinf.cpp3
-rw-r--r--deps/icu-small/source/i18n/currunit.cpp6
-rw-r--r--deps/icu-small/source/i18n/dangical.cpp2
-rw-r--r--deps/icu-small/source/i18n/dangical.h2
-rw-r--r--deps/icu-small/source/i18n/datefmt.cpp6
-rw-r--r--deps/icu-small/source/i18n/dayperiodrules.cpp4
-rw-r--r--deps/icu-small/source/i18n/dayperiodrules.h2
-rw-r--r--deps/icu-small/source/i18n/dcfmtimp.h2
-rw-r--r--deps/icu-small/source/i18n/dcfmtsym.cpp2
-rw-r--r--deps/icu-small/source/i18n/decContext.cpp (renamed from deps/icu-small/source/i18n/decContext.c)2
-rw-r--r--deps/icu-small/source/i18n/decContext.h2
-rw-r--r--deps/icu-small/source/i18n/decNumber.cpp (renamed from deps/icu-small/source/i18n/decNumber.c)4
-rw-r--r--deps/icu-small/source/i18n/decNumber.h2
-rw-r--r--deps/icu-small/source/i18n/decNumberLocal.h2
-rw-r--r--deps/icu-small/source/i18n/decfmtst.cpp2
-rw-r--r--deps/icu-small/source/i18n/decfmtst.h2
-rw-r--r--deps/icu-small/source/i18n/decimalformatpattern.cpp2
-rw-r--r--deps/icu-small/source/i18n/decimalformatpattern.h2
-rw-r--r--deps/icu-small/source/i18n/decimalformatpatternimpl.h2
-rw-r--r--deps/icu-small/source/i18n/decimfmt.cpp3
-rw-r--r--deps/icu-small/source/i18n/decimfmtimpl.cpp2
-rw-r--r--deps/icu-small/source/i18n/decimfmtimpl.h2
-rw-r--r--deps/icu-small/source/i18n/digitaffix.cpp2
-rw-r--r--deps/icu-small/source/i18n/digitaffix.h2
-rw-r--r--deps/icu-small/source/i18n/digitaffixesandpadding.cpp2
-rw-r--r--deps/icu-small/source/i18n/digitaffixesandpadding.h2
-rw-r--r--deps/icu-small/source/i18n/digitformatter.cpp2
-rw-r--r--deps/icu-small/source/i18n/digitformatter.h2
-rw-r--r--deps/icu-small/source/i18n/digitgrouping.cpp2
-rw-r--r--deps/icu-small/source/i18n/digitgrouping.h2
-rw-r--r--deps/icu-small/source/i18n/digitinterval.cpp2
-rw-r--r--deps/icu-small/source/i18n/digitinterval.h2
-rw-r--r--deps/icu-small/source/i18n/digitlst.cpp2
-rw-r--r--deps/icu-small/source/i18n/digitlst.h2
-rw-r--r--deps/icu-small/source/i18n/dt_impl.h2
-rw-r--r--deps/icu-small/source/i18n/dtfmtsym.cpp4
-rw-r--r--deps/icu-small/source/i18n/dtitv_impl.h2
-rw-r--r--deps/icu-small/source/i18n/dtitvfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/dtitvinf.cpp2
-rw-r--r--deps/icu-small/source/i18n/dtptngen.cpp4
-rw-r--r--deps/icu-small/source/i18n/dtptngen_impl.h5
-rw-r--r--deps/icu-small/source/i18n/dtrule.cpp2
-rw-r--r--deps/icu-small/source/i18n/esctrn.cpp2
-rw-r--r--deps/icu-small/source/i18n/esctrn.h2
-rw-r--r--deps/icu-small/source/i18n/ethpccal.cpp2
-rw-r--r--deps/icu-small/source/i18n/ethpccal.h2
-rw-r--r--deps/icu-small/source/i18n/fmtable.cpp2
-rw-r--r--deps/icu-small/source/i18n/fmtable_cnv.cpp2
-rw-r--r--deps/icu-small/source/i18n/fmtableimp.h5
-rw-r--r--deps/icu-small/source/i18n/format.cpp2
-rw-r--r--deps/icu-small/source/i18n/fphdlimp.cpp2
-rw-r--r--deps/icu-small/source/i18n/fphdlimp.h2
-rw-r--r--deps/icu-small/source/i18n/fpositer.cpp2
-rw-r--r--deps/icu-small/source/i18n/funcrepl.cpp2
-rw-r--r--deps/icu-small/source/i18n/funcrepl.h2
-rw-r--r--deps/icu-small/source/i18n/gender.cpp2
-rw-r--r--deps/icu-small/source/i18n/gregocal.cpp2
-rw-r--r--deps/icu-small/source/i18n/gregoimp.cpp2
-rw-r--r--deps/icu-small/source/i18n/gregoimp.h2
-rw-r--r--deps/icu-small/source/i18n/hebrwcal.cpp2
-rw-r--r--deps/icu-small/source/i18n/hebrwcal.h2
-rw-r--r--deps/icu-small/source/i18n/indiancal.cpp2
-rw-r--r--deps/icu-small/source/i18n/indiancal.h2
-rw-r--r--deps/icu-small/source/i18n/inputext.cpp2
-rw-r--r--deps/icu-small/source/i18n/inputext.h2
-rw-r--r--deps/icu-small/source/i18n/islamcal.cpp2
-rw-r--r--deps/icu-small/source/i18n/islamcal.h2
-rw-r--r--deps/icu-small/source/i18n/japancal.cpp2
-rw-r--r--deps/icu-small/source/i18n/japancal.h2
-rw-r--r--deps/icu-small/source/i18n/measfmt.cpp13
-rw-r--r--deps/icu-small/source/i18n/measunit.cpp319
-rw-r--r--deps/icu-small/source/i18n/measure.cpp2
-rw-r--r--deps/icu-small/source/i18n/msgfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/msgfmt_impl.h2
-rw-r--r--deps/icu-small/source/i18n/name2uni.cpp2
-rw-r--r--deps/icu-small/source/i18n/name2uni.h2
-rw-r--r--deps/icu-small/source/i18n/nfrlist.h4
-rw-r--r--deps/icu-small/source/i18n/nfrs.cpp27
-rw-r--r--deps/icu-small/source/i18n/nfrs.h6
-rw-r--r--deps/icu-small/source/i18n/nfrule.cpp21
-rw-r--r--deps/icu-small/source/i18n/nfrule.h7
-rw-r--r--deps/icu-small/source/i18n/nfsubs.cpp87
-rw-r--r--deps/icu-small/source/i18n/nfsubs.h6
-rw-r--r--deps/icu-small/source/i18n/nortrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/nortrans.h2
-rw-r--r--deps/icu-small/source/i18n/nultrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/nultrans.h2
-rw-r--r--deps/icu-small/source/i18n/numfmt.cpp8
-rw-r--r--deps/icu-small/source/i18n/numsys.cpp4
-rw-r--r--deps/icu-small/source/i18n/numsys_impl.h2
-rw-r--r--deps/icu-small/source/i18n/olsontz.cpp2
-rw-r--r--deps/icu-small/source/i18n/olsontz.h2
-rw-r--r--deps/icu-small/source/i18n/persncal.cpp2
-rw-r--r--deps/icu-small/source/i18n/persncal.h2
-rw-r--r--deps/icu-small/source/i18n/pluralaffix.cpp2
-rw-r--r--deps/icu-small/source/i18n/pluralaffix.h2
-rw-r--r--deps/icu-small/source/i18n/plurfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/plurrule.cpp25
-rw-r--r--deps/icu-small/source/i18n/plurrule_impl.h3
-rw-r--r--deps/icu-small/source/i18n/precision.cpp2
-rw-r--r--deps/icu-small/source/i18n/precision.h2
-rw-r--r--deps/icu-small/source/i18n/quant.cpp2
-rw-r--r--deps/icu-small/source/i18n/quant.h2
-rw-r--r--deps/icu-small/source/i18n/quantityformatter.cpp2
-rw-r--r--deps/icu-small/source/i18n/quantityformatter.h2
-rw-r--r--deps/icu-small/source/i18n/rbnf.cpp174
-rw-r--r--deps/icu-small/source/i18n/rbt.cpp2
-rw-r--r--deps/icu-small/source/i18n/rbt.h2
-rw-r--r--deps/icu-small/source/i18n/rbt_data.cpp2
-rw-r--r--deps/icu-small/source/i18n/rbt_data.h2
-rw-r--r--deps/icu-small/source/i18n/rbt_pars.cpp2
-rw-r--r--deps/icu-small/source/i18n/rbt_pars.h2
-rw-r--r--deps/icu-small/source/i18n/rbt_rule.cpp2
-rw-r--r--deps/icu-small/source/i18n/rbt_rule.h2
-rw-r--r--deps/icu-small/source/i18n/rbt_set.cpp2
-rw-r--r--deps/icu-small/source/i18n/rbt_set.h2
-rw-r--r--deps/icu-small/source/i18n/rbtz.cpp2
-rw-r--r--deps/icu-small/source/i18n/regexcmp.cpp52
-rw-r--r--deps/icu-small/source/i18n/regexcmp.h2
-rw-r--r--deps/icu-small/source/i18n/regexcst.h2
-rw-r--r--deps/icu-small/source/i18n/regeximp.cpp12
-rw-r--r--deps/icu-small/source/i18n/regeximp.h4
-rw-r--r--deps/icu-small/source/i18n/regexst.cpp2
-rw-r--r--deps/icu-small/source/i18n/regexst.h2
-rw-r--r--deps/icu-small/source/i18n/regextxt.cpp2
-rw-r--r--deps/icu-small/source/i18n/regextxt.h2
-rw-r--r--deps/icu-small/source/i18n/region.cpp2
-rw-r--r--deps/icu-small/source/i18n/region_impl.h2
-rw-r--r--deps/icu-small/source/i18n/reldatefmt.cpp3
-rw-r--r--deps/icu-small/source/i18n/reldtfmt.cpp4
-rw-r--r--deps/icu-small/source/i18n/reldtfmt.h2
-rw-r--r--deps/icu-small/source/i18n/rematch.cpp24
-rw-r--r--deps/icu-small/source/i18n/remtrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/remtrans.h2
-rw-r--r--deps/icu-small/source/i18n/repattrn.cpp2
-rw-r--r--deps/icu-small/source/i18n/rulebasedcollator.cpp2
-rw-r--r--deps/icu-small/source/i18n/scientificnumberformatter.cpp2
-rw-r--r--deps/icu-small/source/i18n/scriptset.cpp2
-rw-r--r--deps/icu-small/source/i18n/scriptset.h2
-rw-r--r--deps/icu-small/source/i18n/search.cpp2
-rw-r--r--deps/icu-small/source/i18n/selfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/selfmtimpl.h2
-rw-r--r--deps/icu-small/source/i18n/sharedbreakiterator.cpp2
-rw-r--r--deps/icu-small/source/i18n/sharedbreakiterator.h2
-rw-r--r--deps/icu-small/source/i18n/sharedcalendar.h2
-rw-r--r--deps/icu-small/source/i18n/shareddateformatsymbols.h2
-rw-r--r--deps/icu-small/source/i18n/sharednumberformat.h2
-rw-r--r--deps/icu-small/source/i18n/sharedpluralrules.h2
-rw-r--r--deps/icu-small/source/i18n/significantdigitinterval.h2
-rw-r--r--deps/icu-small/source/i18n/simpletz.cpp15
-rw-r--r--deps/icu-small/source/i18n/smallintformatter.cpp2
-rw-r--r--deps/icu-small/source/i18n/smallintformatter.h2
-rw-r--r--deps/icu-small/source/i18n/smpdtfmt.cpp4
-rw-r--r--deps/icu-small/source/i18n/smpdtfst.cpp2
-rw-r--r--deps/icu-small/source/i18n/smpdtfst.h3
-rw-r--r--deps/icu-small/source/i18n/sortkey.cpp2
-rw-r--r--deps/icu-small/source/i18n/standardplural.cpp2
-rw-r--r--deps/icu-small/source/i18n/standardplural.h2
-rw-r--r--deps/icu-small/source/i18n/strmatch.cpp2
-rw-r--r--deps/icu-small/source/i18n/strmatch.h2
-rw-r--r--deps/icu-small/source/i18n/strrepl.cpp2
-rw-r--r--deps/icu-small/source/i18n/strrepl.h2
-rw-r--r--deps/icu-small/source/i18n/stsearch.cpp2
-rw-r--r--deps/icu-small/source/i18n/taiwncal.cpp2
-rw-r--r--deps/icu-small/source/i18n/taiwncal.h2
-rw-r--r--deps/icu-small/source/i18n/timezone.cpp2
-rw-r--r--deps/icu-small/source/i18n/titletrn.cpp12
-rw-r--r--deps/icu-small/source/i18n/titletrn.h2
-rw-r--r--deps/icu-small/source/i18n/tmunit.cpp2
-rw-r--r--deps/icu-small/source/i18n/tmutamt.cpp2
-rw-r--r--deps/icu-small/source/i18n/tmutfmt.cpp2
-rw-r--r--deps/icu-small/source/i18n/tolowtrn.cpp2
-rw-r--r--deps/icu-small/source/i18n/tolowtrn.h2
-rw-r--r--deps/icu-small/source/i18n/toupptrn.cpp2
-rw-r--r--deps/icu-small/source/i18n/toupptrn.h2
-rw-r--r--deps/icu-small/source/i18n/translit.cpp2
-rw-r--r--deps/icu-small/source/i18n/transreg.cpp2
-rw-r--r--deps/icu-small/source/i18n/transreg.h2
-rw-r--r--deps/icu-small/source/i18n/tridpars.cpp2
-rw-r--r--deps/icu-small/source/i18n/tridpars.h2
-rw-r--r--deps/icu-small/source/i18n/tzfmt.cpp4
-rw-r--r--deps/icu-small/source/i18n/tzgnames.cpp3
-rw-r--r--deps/icu-small/source/i18n/tzgnames.h2
-rw-r--r--deps/icu-small/source/i18n/tznames.cpp2
-rw-r--r--deps/icu-small/source/i18n/tznames_impl.cpp3
-rw-r--r--deps/icu-small/source/i18n/tznames_impl.h2
-rw-r--r--deps/icu-small/source/i18n/tzrule.cpp2
-rw-r--r--deps/icu-small/source/i18n/tztrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/ucal.cpp2
-rw-r--r--deps/icu-small/source/i18n/ucln_in.cpp4
-rw-r--r--deps/icu-small/source/i18n/ucln_in.h4
-rw-r--r--deps/icu-small/source/i18n/ucol.cpp4
-rw-r--r--deps/icu-small/source/i18n/ucol_imp.h4
-rw-r--r--deps/icu-small/source/i18n/ucol_res.cpp5
-rw-r--r--deps/icu-small/source/i18n/ucol_sit.cpp4
-rw-r--r--deps/icu-small/source/i18n/ucoleitr.cpp2
-rw-r--r--deps/icu-small/source/i18n/ucsdet.cpp2
-rw-r--r--deps/icu-small/source/i18n/udat.cpp2
-rw-r--r--deps/icu-small/source/i18n/udateintervalformat.cpp2
-rw-r--r--deps/icu-small/source/i18n/udatpg.cpp4
-rw-r--r--deps/icu-small/source/i18n/ufieldpositer.cpp2
-rw-r--r--deps/icu-small/source/i18n/uitercollationiterator.cpp2
-rw-r--r--deps/icu-small/source/i18n/uitercollationiterator.h2
-rw-r--r--deps/icu-small/source/i18n/ulocdata.cpp (renamed from deps/icu-small/source/i18n/ulocdata.c)4
-rw-r--r--deps/icu-small/source/i18n/umsg.cpp4
-rw-r--r--deps/icu-small/source/i18n/umsg_imp.h4
-rw-r--r--deps/icu-small/source/i18n/unesctrn.cpp2
-rw-r--r--deps/icu-small/source/i18n/unesctrn.h2
-rw-r--r--deps/icu-small/source/i18n/uni2name.cpp2
-rw-r--r--deps/icu-small/source/i18n/uni2name.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/alphaindex.h3
-rw-r--r--deps/icu-small/source/i18n/unicode/basictz.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/calendar.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/choicfmt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/coleitr.h3
-rw-r--r--deps/icu-small/source/i18n/unicode/coll.h30
-rw-r--r--deps/icu-small/source/i18n/unicode/compactdecimalformat.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/curramt.h10
-rw-r--r--deps/icu-small/source/i18n/unicode/currpinf.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/currunit.h12
-rw-r--r--deps/icu-small/source/i18n/unicode/datefmt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/dcfmtsym.h9
-rw-r--r--deps/icu-small/source/i18n/unicode/decimfmt.h28
-rw-r--r--deps/icu-small/source/i18n/unicode/dtfmtsym.h13
-rw-r--r--deps/icu-small/source/i18n/unicode/dtitvfmt.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/dtitvinf.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/dtptngen.h5
-rw-r--r--deps/icu-small/source/i18n/unicode/dtrule.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/fieldpos.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/fmtable.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/format.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/fpositer.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/gender.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/gregocal.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/measfmt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/measunit.h76
-rw-r--r--deps/icu-small/source/i18n/unicode/measure.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/msgfmt.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/numfmt.h10
-rw-r--r--deps/icu-small/source/i18n/unicode/numsys.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/plurfmt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/plurrule.h21
-rw-r--r--deps/icu-small/source/i18n/unicode/rbnf.h51
-rw-r--r--deps/icu-small/source/i18n/unicode/rbtz.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/regex.h34
-rw-r--r--deps/icu-small/source/i18n/unicode/region.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/reldatefmt.h9
-rw-r--r--deps/icu-small/source/i18n/unicode/scientificnumberformatter.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/search.h2
-rwxr-xr-xdeps/icu-small/source/i18n/unicode/selfmt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/simpletz.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/smpdtfmt.h14
-rw-r--r--deps/icu-small/source/i18n/unicode/sortkey.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/stsearch.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/tblcoll.h26
-rw-r--r--deps/icu-small/source/i18n/unicode/timezone.h10
-rw-r--r--deps/icu-small/source/i18n/unicode/tmunit.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/tmutamt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/tmutfmt.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/translit.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/tzfmt.h8
-rw-r--r--deps/icu-small/source/i18n/unicode/tznames.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/tzrule.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/tztrans.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/ucal.h6
-rw-r--r--deps/icu-small/source/i18n/unicode/ucol.h12
-rw-r--r--deps/icu-small/source/i18n/unicode/ucoleitr.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/ucsdet.h10
-rw-r--r--deps/icu-small/source/i18n/unicode/udat.h80
-rw-r--r--deps/icu-small/source/i18n/unicode/udateintervalformat.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/udatpg.h8
-rw-r--r--deps/icu-small/source/i18n/unicode/ufieldpositer.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/uformattable.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/ugender.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/ulocdata.h10
-rw-r--r--deps/icu-small/source/i18n/unicode/umsg.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/unirepl.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/unum.h66
-rw-r--r--deps/icu-small/source/i18n/unicode/unumsys.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/upluralrules.h59
-rw-r--r--deps/icu-small/source/i18n/unicode/uregex.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/uregion.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/ureldatefmt.h72
-rw-r--r--deps/icu-small/source/i18n/unicode/usearch.h6
-rw-r--r--deps/icu-small/source/i18n/unicode/uspoof.h4
-rw-r--r--deps/icu-small/source/i18n/unicode/utmscale.h9
-rw-r--r--deps/icu-small/source/i18n/unicode/utrans.h2
-rw-r--r--deps/icu-small/source/i18n/unicode/vtzone.h2
-rw-r--r--deps/icu-small/source/i18n/unum.cpp29
-rw-r--r--deps/icu-small/source/i18n/unumsys.cpp2
-rw-r--r--deps/icu-small/source/i18n/upluralrules.cpp47
-rw-r--r--deps/icu-small/source/i18n/uregex.cpp2
-rw-r--r--deps/icu-small/source/i18n/uregexc.cpp2
-rw-r--r--deps/icu-small/source/i18n/uregion.cpp2
-rw-r--r--deps/icu-small/source/i18n/usearch.cpp2
-rw-r--r--deps/icu-small/source/i18n/uspoof.cpp4
-rw-r--r--deps/icu-small/source/i18n/uspoof_build.cpp4
-rw-r--r--deps/icu-small/source/i18n/uspoof_conf.cpp4
-rw-r--r--deps/icu-small/source/i18n/uspoof_conf.h4
-rw-r--r--deps/icu-small/source/i18n/uspoof_impl.cpp2
-rw-r--r--deps/icu-small/source/i18n/uspoof_impl.h2
-rw-r--r--deps/icu-small/source/i18n/usrchimp.h2
-rw-r--r--deps/icu-small/source/i18n/utf16collationiterator.cpp2
-rw-r--r--deps/icu-small/source/i18n/utf16collationiterator.h2
-rw-r--r--deps/icu-small/source/i18n/utf8collationiterator.cpp2
-rw-r--r--deps/icu-small/source/i18n/utf8collationiterator.h2
-rw-r--r--deps/icu-small/source/i18n/utmscale.cpp (renamed from deps/icu-small/source/i18n/utmscale.c)2
-rw-r--r--deps/icu-small/source/i18n/utrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/valueformatter.cpp2
-rw-r--r--deps/icu-small/source/i18n/valueformatter.h2
-rw-r--r--deps/icu-small/source/i18n/visibledigits.cpp2
-rw-r--r--deps/icu-small/source/i18n/visibledigits.h2
-rw-r--r--deps/icu-small/source/i18n/vtzone.cpp4
-rw-r--r--deps/icu-small/source/i18n/vzone.cpp2
-rw-r--r--deps/icu-small/source/i18n/vzone.h2
-rw-r--r--deps/icu-small/source/i18n/windtfmt.cpp115
-rw-r--r--deps/icu-small/source/i18n/windtfmt.h11
-rw-r--r--deps/icu-small/source/i18n/winnmfmt.cpp171
-rw-r--r--deps/icu-small/source/i18n/winnmfmt.h5
-rw-r--r--deps/icu-small/source/i18n/wintzimpl.cpp6
-rw-r--r--deps/icu-small/source/i18n/wintzimpl.h6
-rw-r--r--deps/icu-small/source/i18n/zonemeta.cpp11
-rw-r--r--deps/icu-small/source/i18n/zonemeta.h8
-rw-r--r--deps/icu-small/source/i18n/zrule.cpp2
-rw-r--r--deps/icu-small/source/i18n/zrule.h2
-rw-r--r--deps/icu-small/source/i18n/ztrans.cpp2
-rw-r--r--deps/icu-small/source/i18n/ztrans.h2
414 files changed, 1683 insertions, 1097 deletions
diff --git a/deps/icu-small/source/i18n/affixpatternparser.cpp b/deps/icu-small/source/i18n/affixpatternparser.cpp
index 05e45dbb12..0d65d13057 100644
--- a/deps/icu-small/source/i18n/affixpatternparser.cpp
+++ b/deps/icu-small/source/i18n/affixpatternparser.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
@@ -13,7 +13,9 @@
#include "unicode/dcfmtsym.h"
#include "unicode/plurrule.h"
+#include "unicode/strenum.h"
#include "unicode/ucurr.h"
+#include "unicode/ustring.h"
#include "affixpatternparser.h"
#include "charstr.h"
#include "precision.h"
diff --git a/deps/icu-small/source/i18n/affixpatternparser.h b/deps/icu-small/source/i18n/affixpatternparser.h
index 07f84c5314..b54c749c70 100644
--- a/deps/icu-small/source/i18n/affixpatternparser.h
+++ b/deps/icu-small/source/i18n/affixpatternparser.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/alphaindex.cpp b/deps/icu-small/source/i18n/alphaindex.cpp
index 8a2f0a3cb5..692f5809b6 100644
--- a/deps/icu-small/source/i18n/alphaindex.cpp
+++ b/deps/icu-small/source/i18n/alphaindex.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/anytrans.cpp b/deps/icu-small/source/i18n/anytrans.cpp
index 8ec6f837cf..e7d5375d69 100644
--- a/deps/icu-small/source/i18n/anytrans.cpp
+++ b/deps/icu-small/source/i18n/anytrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************
diff --git a/deps/icu-small/source/i18n/anytrans.h b/deps/icu-small/source/i18n/anytrans.h
index d06d2baa57..703d42b6d4 100644
--- a/deps/icu-small/source/i18n/anytrans.h
+++ b/deps/icu-small/source/i18n/anytrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
***********************************************************************
diff --git a/deps/icu-small/source/i18n/astro.cpp b/deps/icu-small/source/i18n/astro.cpp
index d657aaa20d..0bf32ae854 100644
--- a/deps/icu-small/source/i18n/astro.cpp
+++ b/deps/icu-small/source/i18n/astro.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/************************************************************************
* Copyright (C) 1996-2012, International Business Machines Corporation
diff --git a/deps/icu-small/source/i18n/astro.h b/deps/icu-small/source/i18n/astro.h
index e854661763..a246489005 100644
--- a/deps/icu-small/source/i18n/astro.h
+++ b/deps/icu-small/source/i18n/astro.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/************************************************************************
* Copyright (C) 1996-2008, International Business Machines Corporation *
diff --git a/deps/icu-small/source/i18n/basictz.cpp b/deps/icu-small/source/i18n/basictz.cpp
index b464f5cc5f..6cd93f4d3c 100644
--- a/deps/icu-small/source/i18n/basictz.cpp
+++ b/deps/icu-small/source/i18n/basictz.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/bocsu.cpp b/deps/icu-small/source/i18n/bocsu.cpp
index a2f94f239e..861a76a042 100644
--- a/deps/icu-small/source/i18n/bocsu.cpp
+++ b/deps/icu-small/source/i18n/bocsu.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bocsu.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/bocsu.h b/deps/icu-small/source/i18n/bocsu.h
index 56b03500b1..6b8ed51970 100644
--- a/deps/icu-small/source/i18n/bocsu.h
+++ b/deps/icu-small/source/i18n/bocsu.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: bocsu.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/brktrans.cpp b/deps/icu-small/source/i18n/brktrans.cpp
index 714a0a8720..ab5a803842 100644
--- a/deps/icu-small/source/i18n/brktrans.cpp
+++ b/deps/icu-small/source/i18n/brktrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/brktrans.h b/deps/icu-small/source/i18n/brktrans.h
index 27228321e6..fcc8bdd002 100644
--- a/deps/icu-small/source/i18n/brktrans.h
+++ b/deps/icu-small/source/i18n/brktrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/buddhcal.cpp b/deps/icu-small/source/i18n/buddhcal.cpp
index c8a3a91a2c..b6ccbc4749 100644
--- a/deps/icu-small/source/i18n/buddhcal.cpp
+++ b/deps/icu-small/source/i18n/buddhcal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/buddhcal.h b/deps/icu-small/source/i18n/buddhcal.h
index 95db980600..89e3f3dec3 100644
--- a/deps/icu-small/source/i18n/buddhcal.h
+++ b/deps/icu-small/source/i18n/buddhcal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/calendar.cpp b/deps/icu-small/source/i18n/calendar.cpp
index 9b0f5a0ad3..5b7d64d20d 100644
--- a/deps/icu-small/source/i18n/calendar.cpp
+++ b/deps/icu-small/source/i18n/calendar.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/casetrn.cpp b/deps/icu-small/source/i18n/casetrn.cpp
index 7f71362c33..f08d448881 100644
--- a/deps/icu-small/source/i18n/casetrn.cpp
+++ b/deps/icu-small/source/i18n/casetrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: casetrn.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -92,7 +92,6 @@ UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(CaseMapTransliterator)
*/
CaseMapTransliterator::CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map) :
Transliterator(id, 0),
- fCsp(ucase_getSingleton()),
fMap(map)
{
// TODO test incremental mode with context-sensitive text (e.g. greek sigma)
@@ -110,7 +109,7 @@ CaseMapTransliterator::~CaseMapTransliterator() {
*/
CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) :
Transliterator(o),
- fCsp(o.fCsp), fMap(o.fMap)
+ fMap(o.fMap)
{
}
@@ -119,7 +118,6 @@ CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) :
*/
/*CaseMapTransliterator& CaseMapTransliterator::operator=(const CaseMapTransliterator& o) {
Transliterator::operator=(o);
- fCsp = o.fCsp;
fMap = o.fMap;
return *this;
}*/
@@ -151,14 +149,14 @@ void CaseMapTransliterator::handleTransliterate(Replaceable& text,
UnicodeString tmp;
const UChar *s;
UChar32 c;
- int32_t textPos, delta, result, locCache=0;
+ int32_t textPos, delta, result;
for(textPos=offsets.start; textPos<offsets.limit;) {
csc.cpStart=textPos;
c=text.char32At(textPos);
csc.cpLimit=textPos+=U16_LENGTH(c);
- result=fMap(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache);
+ result=fMap(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT);
if(csc.b1 && isIncremental) {
// fMap() tried to look beyond the context limit
diff --git a/deps/icu-small/source/i18n/casetrn.h b/deps/icu-small/source/i18n/casetrn.h
index 1067e0fc7b..eee443fc81 100644
--- a/deps/icu-small/source/i18n/casetrn.h
+++ b/deps/icu-small/source/i18n/casetrn.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: casetrn.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -84,7 +84,6 @@ protected:
UTransPosition& offsets,
UBool isIncremental) const;
- const UCaseProps *fCsp;
UCaseMapFull *fMap;
private:
diff --git a/deps/icu-small/source/i18n/cecal.cpp b/deps/icu-small/source/i18n/cecal.cpp
index 38c89799be..458fe2f304 100644
--- a/deps/icu-small/source/i18n/cecal.cpp
+++ b/deps/icu-small/source/i18n/cecal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/cecal.h b/deps/icu-small/source/i18n/cecal.h
index ce6f4209ca..c380f0bea3 100644
--- a/deps/icu-small/source/i18n/cecal.h
+++ b/deps/icu-small/source/i18n/cecal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/chnsecal.cpp b/deps/icu-small/source/i18n/chnsecal.cpp
index 0cf88205cb..17712ae62e 100644
--- a/deps/icu-small/source/i18n/chnsecal.cpp
+++ b/deps/icu-small/source/i18n/chnsecal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/chnsecal.h b/deps/icu-small/source/i18n/chnsecal.h
index e000df7158..1b27d2d1bc 100644
--- a/deps/icu-small/source/i18n/chnsecal.h
+++ b/deps/icu-small/source/i18n/chnsecal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************
diff --git a/deps/icu-small/source/i18n/choicfmt.cpp b/deps/icu-small/source/i18n/choicfmt.cpp
index 3630157852..1b846704bf 100644
--- a/deps/icu-small/source/i18n/choicfmt.cpp
+++ b/deps/icu-small/source/i18n/choicfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/coleitr.cpp b/deps/icu-small/source/i18n/coleitr.cpp
index 4825baebcd..40fe149830 100644
--- a/deps/icu-small/source/i18n/coleitr.cpp
+++ b/deps/icu-small/source/i18n/coleitr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -29,6 +29,7 @@
#if !UCONFIG_NO_COLLATION
+#include "unicode/chariter.h"
#include "unicode/coleitr.h"
#include "unicode/tblcoll.h"
#include "unicode/ustring.h"
diff --git a/deps/icu-small/source/i18n/coll.cpp b/deps/icu-small/source/i18n/coll.cpp
index 46e5324ffd..7766187b93 100644
--- a/deps/icu-small/source/i18n/coll.cpp
+++ b/deps/icu-small/source/i18n/coll.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/collation.cpp b/deps/icu-small/source/i18n/collation.cpp
index bac7498dfc..14cb86576b 100644
--- a/deps/icu-small/source/i18n/collation.cpp
+++ b/deps/icu-small/source/i18n/collation.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collation.h b/deps/icu-small/source/i18n/collation.h
index c82d9a4778..e9256c9c12 100644
--- a/deps/icu-small/source/i18n/collation.h
+++ b/deps/icu-small/source/i18n/collation.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationbuilder.cpp b/deps/icu-small/source/i18n/collationbuilder.cpp
index 0025cfc34f..954a20d2d9 100644
--- a/deps/icu-small/source/i18n/collationbuilder.cpp
+++ b/deps/icu-small/source/i18n/collationbuilder.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationbuilder.h b/deps/icu-small/source/i18n/collationbuilder.h
index 7dda928a51..2f20050f93 100644
--- a/deps/icu-small/source/i18n/collationbuilder.h
+++ b/deps/icu-small/source/i18n/collationbuilder.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationcompare.cpp b/deps/icu-small/source/i18n/collationcompare.cpp
index 5d8bd90d6c..cbf32c9fe6 100644
--- a/deps/icu-small/source/i18n/collationcompare.cpp
+++ b/deps/icu-small/source/i18n/collationcompare.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationcompare.h b/deps/icu-small/source/i18n/collationcompare.h
index 630b90b556..6ad2d06704 100644
--- a/deps/icu-small/source/i18n/collationcompare.h
+++ b/deps/icu-small/source/i18n/collationcompare.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdata.cpp b/deps/icu-small/source/i18n/collationdata.cpp
index d3a62e4fd0..688770f8f6 100644
--- a/deps/icu-small/source/i18n/collationdata.cpp
+++ b/deps/icu-small/source/i18n/collationdata.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdata.h b/deps/icu-small/source/i18n/collationdata.h
index ab40bbd89e..ab9b4c47ec 100644
--- a/deps/icu-small/source/i18n/collationdata.h
+++ b/deps/icu-small/source/i18n/collationdata.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdatabuilder.cpp b/deps/icu-small/source/i18n/collationdatabuilder.cpp
index 4a9a67c7b0..1ebc203160 100644
--- a/deps/icu-small/source/i18n/collationdatabuilder.cpp
+++ b/deps/icu-small/source/i18n/collationdatabuilder.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdatabuilder.h b/deps/icu-small/source/i18n/collationdatabuilder.h
index f2c9a820ad..fee444deee 100644
--- a/deps/icu-small/source/i18n/collationdatabuilder.h
+++ b/deps/icu-small/source/i18n/collationdatabuilder.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdatareader.cpp b/deps/icu-small/source/i18n/collationdatareader.cpp
index df0b2a3680..636eb14b7c 100644
--- a/deps/icu-small/source/i18n/collationdatareader.cpp
+++ b/deps/icu-small/source/i18n/collationdatareader.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdatareader.h b/deps/icu-small/source/i18n/collationdatareader.h
index ff8ec3d406..44e69399e3 100644
--- a/deps/icu-small/source/i18n/collationdatareader.h
+++ b/deps/icu-small/source/i18n/collationdatareader.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdatawriter.cpp b/deps/icu-small/source/i18n/collationdatawriter.cpp
index 596236bc61..a91119d8df 100644
--- a/deps/icu-small/source/i18n/collationdatawriter.cpp
+++ b/deps/icu-small/source/i18n/collationdatawriter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationdatawriter.h b/deps/icu-small/source/i18n/collationdatawriter.h
index 6169e0fd26..197cd5309f 100644
--- a/deps/icu-small/source/i18n/collationdatawriter.h
+++ b/deps/icu-small/source/i18n/collationdatawriter.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationfastlatin.cpp b/deps/icu-small/source/i18n/collationfastlatin.cpp
index c3e8c98b3a..b98b8457f4 100644
--- a/deps/icu-small/source/i18n/collationfastlatin.cpp
+++ b/deps/icu-small/source/i18n/collationfastlatin.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationfastlatin.h b/deps/icu-small/source/i18n/collationfastlatin.h
index 00a2d1b510..4bac797409 100644
--- a/deps/icu-small/source/i18n/collationfastlatin.h
+++ b/deps/icu-small/source/i18n/collationfastlatin.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp b/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp
index 032e5e82aa..e889697d8a 100644
--- a/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp
+++ b/deps/icu-small/source/i18n/collationfastlatinbuilder.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationfastlatinbuilder.h b/deps/icu-small/source/i18n/collationfastlatinbuilder.h
index 9d380380b4..8b63b86815 100644
--- a/deps/icu-small/source/i18n/collationfastlatinbuilder.h
+++ b/deps/icu-small/source/i18n/collationfastlatinbuilder.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationfcd.cpp b/deps/icu-small/source/i18n/collationfcd.cpp
index de1d9a2d1d..86b12b917c 100644
--- a/deps/icu-small/source/i18n/collationfcd.cpp
+++ b/deps/icu-small/source/i18n/collationfcd.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 1999-2016, International Business Machines
diff --git a/deps/icu-small/source/i18n/collationfcd.h b/deps/icu-small/source/i18n/collationfcd.h
index 150f4880c9..ec7167d76b 100644
--- a/deps/icu-small/source/i18n/collationfcd.h
+++ b/deps/icu-small/source/i18n/collationfcd.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationiterator.cpp b/deps/icu-small/source/i18n/collationiterator.cpp
index e6e8f27e2f..961c9e9ace 100644
--- a/deps/icu-small/source/i18n/collationiterator.cpp
+++ b/deps/icu-small/source/i18n/collationiterator.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationiterator.h b/deps/icu-small/source/i18n/collationiterator.h
index 0161f5a7b1..2666b248fa 100644
--- a/deps/icu-small/source/i18n/collationiterator.h
+++ b/deps/icu-small/source/i18n/collationiterator.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationkeys.cpp b/deps/icu-small/source/i18n/collationkeys.cpp
index 91302285d6..4b9e6b5907 100644
--- a/deps/icu-small/source/i18n/collationkeys.cpp
+++ b/deps/icu-small/source/i18n/collationkeys.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationkeys.h b/deps/icu-small/source/i18n/collationkeys.h
index 74b370e710..60d9e50c0d 100644
--- a/deps/icu-small/source/i18n/collationkeys.h
+++ b/deps/icu-small/source/i18n/collationkeys.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationroot.cpp b/deps/icu-small/source/i18n/collationroot.cpp
index f862e410b8..71753bd6f4 100644
--- a/deps/icu-small/source/i18n/collationroot.cpp
+++ b/deps/icu-small/source/i18n/collationroot.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationroot.h b/deps/icu-small/source/i18n/collationroot.h
index 26e5071fff..8cd3046cdf 100644
--- a/deps/icu-small/source/i18n/collationroot.h
+++ b/deps/icu-small/source/i18n/collationroot.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationrootelements.cpp b/deps/icu-small/source/i18n/collationrootelements.cpp
index 638a2456c8..9b46d14144 100644
--- a/deps/icu-small/source/i18n/collationrootelements.cpp
+++ b/deps/icu-small/source/i18n/collationrootelements.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationrootelements.h b/deps/icu-small/source/i18n/collationrootelements.h
index 518a24fe4e..7836d8d83b 100644
--- a/deps/icu-small/source/i18n/collationrootelements.h
+++ b/deps/icu-small/source/i18n/collationrootelements.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationruleparser.cpp b/deps/icu-small/source/i18n/collationruleparser.cpp
index ea3ea66bc0..96dcc0d940 100644
--- a/deps/icu-small/source/i18n/collationruleparser.cpp
+++ b/deps/icu-small/source/i18n/collationruleparser.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationruleparser.h b/deps/icu-small/source/i18n/collationruleparser.h
index bd393c2b6a..e124881fcf 100644
--- a/deps/icu-small/source/i18n/collationruleparser.h
+++ b/deps/icu-small/source/i18n/collationruleparser.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationsets.cpp b/deps/icu-small/source/i18n/collationsets.cpp
index 1188f31062..09581416a8 100644
--- a/deps/icu-small/source/i18n/collationsets.cpp
+++ b/deps/icu-small/source/i18n/collationsets.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationsets.h b/deps/icu-small/source/i18n/collationsets.h
index 070d507ebd..aed41f7ac8 100644
--- a/deps/icu-small/source/i18n/collationsets.h
+++ b/deps/icu-small/source/i18n/collationsets.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationsettings.cpp b/deps/icu-small/source/i18n/collationsettings.cpp
index bc1d4e63f8..534e20df3e 100644
--- a/deps/icu-small/source/i18n/collationsettings.cpp
+++ b/deps/icu-small/source/i18n/collationsettings.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationsettings.h b/deps/icu-small/source/i18n/collationsettings.h
index 1522dd58be..83e775d443 100644
--- a/deps/icu-small/source/i18n/collationsettings.h
+++ b/deps/icu-small/source/i18n/collationsettings.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationtailoring.cpp b/deps/icu-small/source/i18n/collationtailoring.cpp
index d1ffa306f1..78a11fbb26 100644
--- a/deps/icu-small/source/i18n/collationtailoring.cpp
+++ b/deps/icu-small/source/i18n/collationtailoring.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationtailoring.h b/deps/icu-small/source/i18n/collationtailoring.h
index e463005e08..9a636cf1eb 100644
--- a/deps/icu-small/source/i18n/collationtailoring.h
+++ b/deps/icu-small/source/i18n/collationtailoring.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/collationweights.cpp b/deps/icu-small/source/i18n/collationweights.cpp
index 9a7b9a9973..eb238df942 100644
--- a/deps/icu-small/source/i18n/collationweights.cpp
+++ b/deps/icu-small/source/i18n/collationweights.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: collationweights.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/collationweights.h b/deps/icu-small/source/i18n/collationweights.h
index 8f3f328547..d8cee79e33 100644
--- a/deps/icu-small/source/i18n/collationweights.h
+++ b/deps/icu-small/source/i18n/collationweights.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: collationweights.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/collunsafe.h b/deps/icu-small/source/i18n/collunsafe.h
index 4819ad195a..c2b3760ccb 100644
--- a/deps/icu-small/source/i18n/collunsafe.h
+++ b/deps/icu-small/source/i18n/collunsafe.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
// collunsafe.h
// Copyright (C) 2015-2016, International Business Machines Corporation and others.
diff --git a/deps/icu-small/source/i18n/compactdecimalformat.cpp b/deps/icu-small/source/i18n/compactdecimalformat.cpp
index 31a5123cb1..b2aacc45cd 100644
--- a/deps/icu-small/source/i18n/compactdecimalformat.cpp
+++ b/deps/icu-small/source/i18n/compactdecimalformat.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -771,13 +771,22 @@ static int32_t populatePrefixSuffix(
if (U_FAILURE(status)) {
return 0;
}
- int32_t firstIdx = formatStr.indexOf(kZero, UPRV_LENGTHOF(kZero), 0);
+
+ // ICU 59 HACK: Ignore negative part of format string, mimicking ICU 58 behavior.
+ // TODO(sffc): Make sure this is fixed during the overhaul port in ICU 60.
+ int32_t semiPos = formatStr.indexOf(';', 0);
+ if (semiPos == -1) {
+ semiPos = formatStr.length();
+ }
+ UnicodeString positivePart = formatStr.tempSubString(0, semiPos);
+
+ int32_t firstIdx = positivePart.indexOf(kZero, UPRV_LENGTHOF(kZero), 0);
// We must have 0's in format string.
if (firstIdx == -1) {
status = U_INTERNAL_PROGRAM_ERROR;
return 0;
}
- int32_t lastIdx = formatStr.lastIndexOf(kZero, UPRV_LENGTHOF(kZero), firstIdx);
+ int32_t lastIdx = positivePart.lastIndexOf(kZero, UPRV_LENGTHOF(kZero), firstIdx);
CDFUnit* unit = createCDFUnit(variant, log10Value, result, status);
if (U_FAILURE(status)) {
return 0;
@@ -790,10 +799,10 @@ static int32_t populatePrefixSuffix(
unit->markAsSet();
// Everything up to first 0 is the prefix
- unit->prefix = formatStr.tempSubString(0, firstIdx);
+ unit->prefix = positivePart.tempSubString(0, firstIdx);
fixQuotes(unit->prefix);
// Everything beyond the last 0 is the suffix
- unit->suffix = formatStr.tempSubString(lastIdx + 1);
+ unit->suffix = positivePart.tempSubString(lastIdx + 1);
fixQuotes(unit->suffix);
// If there is effectively no prefix or suffix, ignore the actual number of
@@ -804,7 +813,7 @@ static int32_t populatePrefixSuffix(
// Calculate number of zeros before decimal point
int32_t idx = firstIdx + 1;
- while (idx <= lastIdx && formatStr.charAt(idx) == u_0) {
+ while (idx <= lastIdx && positivePart.charAt(idx) == u_0) {
++idx;
}
return (idx - firstIdx);
diff --git a/deps/icu-small/source/i18n/coptccal.cpp b/deps/icu-small/source/i18n/coptccal.cpp
index ce531ca0e8..39691217d0 100644
--- a/deps/icu-small/source/i18n/coptccal.cpp
+++ b/deps/icu-small/source/i18n/coptccal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/coptccal.h b/deps/icu-small/source/i18n/coptccal.h
index 523769fabe..0b82c36088 100644
--- a/deps/icu-small/source/i18n/coptccal.h
+++ b/deps/icu-small/source/i18n/coptccal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/cpdtrans.cpp b/deps/icu-small/source/i18n/cpdtrans.cpp
index b6e328f92c..a204de5a53 100644
--- a/deps/icu-small/source/i18n/cpdtrans.cpp
+++ b/deps/icu-small/source/i18n/cpdtrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/cpdtrans.h b/deps/icu-small/source/i18n/cpdtrans.h
index 6f832df883..29f3ba83fc 100644
--- a/deps/icu-small/source/i18n/cpdtrans.h
+++ b/deps/icu-small/source/i18n/cpdtrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csdetect.cpp b/deps/icu-small/source/i18n/csdetect.cpp
index 8ddbe8129b..0afecb287a 100644
--- a/deps/icu-small/source/i18n/csdetect.cpp
+++ b/deps/icu-small/source/i18n/csdetect.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csdetect.h b/deps/icu-small/source/i18n/csdetect.h
index d0dc0d2077..d4bfa75eef 100644
--- a/deps/icu-small/source/i18n/csdetect.h
+++ b/deps/icu-small/source/i18n/csdetect.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csmatch.cpp b/deps/icu-small/source/i18n/csmatch.cpp
index ea8d37cd20..7ed6e0ee1a 100644
--- a/deps/icu-small/source/i18n/csmatch.cpp
+++ b/deps/icu-small/source/i18n/csmatch.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csmatch.h b/deps/icu-small/source/i18n/csmatch.h
index a94b86ae7c..0dc0a9e468 100644
--- a/deps/icu-small/source/i18n/csmatch.h
+++ b/deps/icu-small/source/i18n/csmatch.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csr2022.cpp b/deps/icu-small/source/i18n/csr2022.cpp
index 9566ee4796..aa7f8446eb 100644
--- a/deps/icu-small/source/i18n/csr2022.cpp
+++ b/deps/icu-small/source/i18n/csr2022.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csr2022.h b/deps/icu-small/source/i18n/csr2022.h
index 9ff2648505..6d5b7bffcc 100644
--- a/deps/icu-small/source/i18n/csr2022.h
+++ b/deps/icu-small/source/i18n/csr2022.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrecog.cpp b/deps/icu-small/source/i18n/csrecog.cpp
index 7ae7765399..d02be2bef6 100644
--- a/deps/icu-small/source/i18n/csrecog.cpp
+++ b/deps/icu-small/source/i18n/csrecog.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrecog.h b/deps/icu-small/source/i18n/csrecog.h
index 1759ca561b..51c25396ad 100644
--- a/deps/icu-small/source/i18n/csrecog.h
+++ b/deps/icu-small/source/i18n/csrecog.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrmbcs.cpp b/deps/icu-small/source/i18n/csrmbcs.cpp
index d61269f5e3..0c2df594d5 100644
--- a/deps/icu-small/source/i18n/csrmbcs.cpp
+++ b/deps/icu-small/source/i18n/csrmbcs.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrmbcs.h b/deps/icu-small/source/i18n/csrmbcs.h
index 6a49a85972..8ccf1d56a9 100644
--- a/deps/icu-small/source/i18n/csrmbcs.h
+++ b/deps/icu-small/source/i18n/csrmbcs.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrsbcs.cpp b/deps/icu-small/source/i18n/csrsbcs.cpp
index 48e7dc5123..3d0b7269cc 100644
--- a/deps/icu-small/source/i18n/csrsbcs.cpp
+++ b/deps/icu-small/source/i18n/csrsbcs.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrsbcs.h b/deps/icu-small/source/i18n/csrsbcs.h
index 2f967dd9c2..bae124c05a 100644
--- a/deps/icu-small/source/i18n/csrsbcs.h
+++ b/deps/icu-small/source/i18n/csrsbcs.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrucode.cpp b/deps/icu-small/source/i18n/csrucode.cpp
index 201b2996c7..b84011c259 100644
--- a/deps/icu-small/source/i18n/csrucode.cpp
+++ b/deps/icu-small/source/i18n/csrucode.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrucode.h b/deps/icu-small/source/i18n/csrucode.h
index 10e5fafe66..4465bf35a1 100644
--- a/deps/icu-small/source/i18n/csrucode.h
+++ b/deps/icu-small/source/i18n/csrucode.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrutf8.cpp b/deps/icu-small/source/i18n/csrutf8.cpp
index 4f29fa2af7..bc06fa8bb8 100644
--- a/deps/icu-small/source/i18n/csrutf8.cpp
+++ b/deps/icu-small/source/i18n/csrutf8.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/csrutf8.h b/deps/icu-small/source/i18n/csrutf8.h
index 71309eade7..dc4f79b824 100644
--- a/deps/icu-small/source/i18n/csrutf8.h
+++ b/deps/icu-small/source/i18n/csrutf8.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/curramt.cpp b/deps/icu-small/source/i18n/curramt.cpp
index 4475ff611e..019c17df8e 100644
--- a/deps/icu-small/source/i18n/curramt.cpp
+++ b/deps/icu-small/source/i18n/curramt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -19,12 +19,12 @@
U_NAMESPACE_BEGIN
-CurrencyAmount::CurrencyAmount(const Formattable& amount, const UChar* isoCode,
+CurrencyAmount::CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode,
UErrorCode& ec) :
Measure(amount, new CurrencyUnit(isoCode, ec), ec) {
}
-CurrencyAmount::CurrencyAmount(double amount, const UChar* isoCode,
+CurrencyAmount::CurrencyAmount(double amount, ConstChar16Ptr isoCode,
UErrorCode& ec) :
Measure(Formattable(amount), new CurrencyUnit(isoCode, ec), ec) {
}
diff --git a/deps/icu-small/source/i18n/currfmt.cpp b/deps/icu-small/source/i18n/currfmt.cpp
index b92aa00e5c..06bdad042a 100644
--- a/deps/icu-small/source/i18n/currfmt.cpp
+++ b/deps/icu-small/source/i18n/currfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/currfmt.h b/deps/icu-small/source/i18n/currfmt.h
index 83e0272465..97d44cbb1d 100644
--- a/deps/icu-small/source/i18n/currfmt.h
+++ b/deps/icu-small/source/i18n/currfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/currpinf.cpp b/deps/icu-small/source/i18n/currpinf.cpp
index 7c16fff961..5d3ca62089 100644
--- a/deps/icu-small/source/i18n/currpinf.cpp
+++ b/deps/icu-small/source/i18n/currpinf.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -20,6 +20,7 @@
#include "unicode/locid.h"
#include "unicode/plurrule.h"
+#include "unicode/strenum.h"
#include "unicode/ures.h"
#include "unicode/numsys.h"
#include "cstring.h"
diff --git a/deps/icu-small/source/i18n/currunit.cpp b/deps/icu-small/source/i18n/currunit.cpp
index f538d65ada..2192492696 100644
--- a/deps/icu-small/source/i18n/currunit.cpp
+++ b/deps/icu-small/source/i18n/currunit.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -19,10 +19,10 @@
U_NAMESPACE_BEGIN
-CurrencyUnit::CurrencyUnit(const UChar* _isoCode, UErrorCode& ec) {
+CurrencyUnit::CurrencyUnit(ConstChar16Ptr _isoCode, UErrorCode& ec) {
*isoCode = 0;
if (U_SUCCESS(ec)) {
- if (_isoCode && u_strlen(_isoCode)==3) {
+ if (_isoCode != nullptr && u_strlen(_isoCode)==3) {
u_strcpy(isoCode, _isoCode);
char simpleIsoCode[4];
u_UCharsToChars(isoCode, simpleIsoCode, 4);
diff --git a/deps/icu-small/source/i18n/dangical.cpp b/deps/icu-small/source/i18n/dangical.cpp
index 3a7b2ebb8f..bc3951f210 100644
--- a/deps/icu-small/source/i18n/dangical.cpp
+++ b/deps/icu-small/source/i18n/dangical.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/dangical.h b/deps/icu-small/source/i18n/dangical.h
index 17a5004bdc..1a1e06b902 100644
--- a/deps/icu-small/source/i18n/dangical.h
+++ b/deps/icu-small/source/i18n/dangical.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************
diff --git a/deps/icu-small/source/i18n/datefmt.cpp b/deps/icu-small/source/i18n/datefmt.cpp
index 00f46cfdfd..47cc852691 100644
--- a/deps/icu-small/source/i18n/datefmt.cpp
+++ b/deps/icu-small/source/i18n/datefmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -80,7 +80,7 @@ public:
fSkeleton(other.fSkeleton) { }
virtual ~DateFmtBestPatternKey();
virtual int32_t hashCode() const {
- return 37 * LocaleCacheKey<DateFmtBestPattern>::hashCode() + fSkeleton.hashCode();
+ return (int32_t)(37u * (uint32_t)LocaleCacheKey<DateFmtBestPattern>::hashCode() + (uint32_t)fSkeleton.hashCode());
}
virtual UBool operator==(const CacheKeyBase &other) const {
// reflexive
@@ -498,7 +498,7 @@ DateFormat* U_EXPORT2
DateFormat::create(EStyle timeStyle, EStyle dateStyle, const Locale& locale)
{
UErrorCode status = U_ZERO_ERROR;
-#if U_PLATFORM_HAS_WIN32_API
+#if U_PLATFORM_USES_ONLY_WIN32_API
char buffer[8];
int32_t count = locale.getKeywordValue("compat", buffer, sizeof(buffer), status);
diff --git a/deps/icu-small/source/i18n/dayperiodrules.cpp b/deps/icu-small/source/i18n/dayperiodrules.cpp
index 30414823ef..f7ec1e6dc2 100644
--- a/deps/icu-small/source/i18n/dayperiodrules.cpp
+++ b/deps/icu-small/source/i18n/dayperiodrules.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -174,7 +174,7 @@ struct DayPeriodRulesDataSink : public ResourceSink {
}
}
- void addCutoff(CutoffType type, UnicodeString hour_str, UErrorCode &errorCode) {
+ void addCutoff(CutoffType type, const UnicodeString &hour_str, UErrorCode &errorCode) {
if (U_FAILURE(errorCode)) { return; }
if (type == CUTOFF_TYPE_UNKNOWN) {
diff --git a/deps/icu-small/source/i18n/dayperiodrules.h b/deps/icu-small/source/i18n/dayperiodrules.h
index 3c006cdc2f..610c6175bf 100644
--- a/deps/icu-small/source/i18n/dayperiodrules.h
+++ b/deps/icu-small/source/i18n/dayperiodrules.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/dcfmtimp.h b/deps/icu-small/source/i18n/dcfmtimp.h
index 5885872841..e582efb344 100644
--- a/deps/icu-small/source/i18n/dcfmtimp.h
+++ b/deps/icu-small/source/i18n/dcfmtimp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/dcfmtsym.cpp b/deps/icu-small/source/i18n/dcfmtsym.cpp
index b8b9c32a42..c702c2e7d0 100644
--- a/deps/icu-small/source/i18n/dcfmtsym.cpp
+++ b/deps/icu-small/source/i18n/dcfmtsym.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/decContext.c b/deps/icu-small/source/i18n/decContext.cpp
index 498e1fede9..bead83efff 100644
--- a/deps/icu-small/source/i18n/decContext.c
+++ b/deps/icu-small/source/i18n/decContext.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/* ------------------------------------------------------------------ */
/* Decimal Context module */
diff --git a/deps/icu-small/source/i18n/decContext.h b/deps/icu-small/source/i18n/decContext.h
index 62123ff440..1fd18e5d3d 100644
--- a/deps/icu-small/source/i18n/decContext.h
+++ b/deps/icu-small/source/i18n/decContext.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/* ------------------------------------------------------------------ */
/* Decimal Context module header */
diff --git a/deps/icu-small/source/i18n/decNumber.c b/deps/icu-small/source/i18n/decNumber.cpp
index b25845e0aa..3ae22b1b42 100644
--- a/deps/icu-small/source/i18n/decNumber.c
+++ b/deps/icu-small/source/i18n/decNumber.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/* ------------------------------------------------------------------ */
/* Decimal Number arithmetic module */
@@ -5007,7 +5007,7 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs,
/* Make sure no signed int overflow below. This is always true */
/* if the given numbers have less digits than DEC_MAX_DIGITS. */
- U_ASSERT(iacc <= INT32_MAX/sizeof(uLong));
+ U_ASSERT((uint32_t)iacc <= INT32_MAX/sizeof(uLong));
needbytes=iacc*sizeof(uLong);
#if DECDPUN==1
zoff=(iacc+7)/8; /* items to offset by */
diff --git a/deps/icu-small/source/i18n/decNumber.h b/deps/icu-small/source/i18n/decNumber.h
index 90269d9f66..92be8e8c0a 100644
--- a/deps/icu-small/source/i18n/decNumber.h
+++ b/deps/icu-small/source/i18n/decNumber.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/* ------------------------------------------------------------------ */
/* Decimal Number arithmetic module header */
diff --git a/deps/icu-small/source/i18n/decNumberLocal.h b/deps/icu-small/source/i18n/decNumberLocal.h
index 294d5f519d..a45b7d8cc6 100644
--- a/deps/icu-small/source/i18n/decNumberLocal.h
+++ b/deps/icu-small/source/i18n/decNumberLocal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/* ------------------------------------------------------------------ */
/* decNumber package local type, tuning, and macro definitions */
diff --git a/deps/icu-small/source/i18n/decfmtst.cpp b/deps/icu-small/source/i18n/decfmtst.cpp
index 4af7587877..5dff3c1645 100644
--- a/deps/icu-small/source/i18n/decfmtst.cpp
+++ b/deps/icu-small/source/i18n/decfmtst.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/decfmtst.h b/deps/icu-small/source/i18n/decfmtst.h
index 719f0aa976..63ae50c6df 100644
--- a/deps/icu-small/source/i18n/decfmtst.h
+++ b/deps/icu-small/source/i18n/decfmtst.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/decimalformatpattern.cpp b/deps/icu-small/source/i18n/decimalformatpattern.cpp
index ca90e968a1..c7ec5cd966 100644
--- a/deps/icu-small/source/i18n/decimalformatpattern.cpp
+++ b/deps/icu-small/source/i18n/decimalformatpattern.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/decimalformatpattern.h b/deps/icu-small/source/i18n/decimalformatpattern.h
index 2ebbdf9ffc..1c297575ea 100644
--- a/deps/icu-small/source/i18n/decimalformatpattern.h
+++ b/deps/icu-small/source/i18n/decimalformatpattern.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/decimalformatpatternimpl.h b/deps/icu-small/source/i18n/decimalformatpatternimpl.h
index 67bc96db61..8cecc8cca0 100644
--- a/deps/icu-small/source/i18n/decimalformatpatternimpl.h
+++ b/deps/icu-small/source/i18n/decimalformatpatternimpl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/decimfmt.cpp b/deps/icu-small/source/i18n/decimfmt.cpp
index 440adf5a6b..116c0c90bb 100644
--- a/deps/icu-small/source/i18n/decimfmt.cpp
+++ b/deps/icu-small/source/i18n/decimfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -49,6 +49,7 @@
#include "unicode/utf16.h"
#include "unicode/numsys.h"
#include "unicode/localpointer.h"
+#include "unicode/ustring.h"
#include "uresimp.h"
#include "ucurrimp.h"
#include "charstr.h"
diff --git a/deps/icu-small/source/i18n/decimfmtimpl.cpp b/deps/icu-small/source/i18n/decimfmtimpl.cpp
index 342ce5b5e4..dc7c8adf67 100644
--- a/deps/icu-small/source/i18n/decimfmtimpl.cpp
+++ b/deps/icu-small/source/i18n/decimfmtimpl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/decimfmtimpl.h b/deps/icu-small/source/i18n/decimfmtimpl.h
index 537107c6f7..b4438cba9e 100644
--- a/deps/icu-small/source/i18n/decimfmtimpl.h
+++ b/deps/icu-small/source/i18n/decimfmtimpl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/digitaffix.cpp b/deps/icu-small/source/i18n/digitaffix.cpp
index 262bc49427..396df2cf1d 100644
--- a/deps/icu-small/source/i18n/digitaffix.cpp
+++ b/deps/icu-small/source/i18n/digitaffix.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/digitaffix.h b/deps/icu-small/source/i18n/digitaffix.h
index a1a100654f..005c36f848 100644
--- a/deps/icu-small/source/i18n/digitaffix.h
+++ b/deps/icu-small/source/i18n/digitaffix.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/digitaffixesandpadding.cpp b/deps/icu-small/source/i18n/digitaffixesandpadding.cpp
index 716ab4a32e..487d9a345d 100644
--- a/deps/icu-small/source/i18n/digitaffixesandpadding.cpp
+++ b/deps/icu-small/source/i18n/digitaffixesandpadding.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/digitaffixesandpadding.h b/deps/icu-small/source/i18n/digitaffixesandpadding.h
index e837e07c8f..d570599d18 100644
--- a/deps/icu-small/source/i18n/digitaffixesandpadding.h
+++ b/deps/icu-small/source/i18n/digitaffixesandpadding.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/digitformatter.cpp b/deps/icu-small/source/i18n/digitformatter.cpp
index d1a88f95ee..abb571dc5f 100644
--- a/deps/icu-small/source/i18n/digitformatter.cpp
+++ b/deps/icu-small/source/i18n/digitformatter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/digitformatter.h b/deps/icu-small/source/i18n/digitformatter.h
index d92d425151..54a54c3639 100644
--- a/deps/icu-small/source/i18n/digitformatter.h
+++ b/deps/icu-small/source/i18n/digitformatter.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/digitgrouping.cpp b/deps/icu-small/source/i18n/digitgrouping.cpp
index 0d96b407c5..cffa122b6c 100644
--- a/deps/icu-small/source/i18n/digitgrouping.cpp
+++ b/deps/icu-small/source/i18n/digitgrouping.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/digitgrouping.h b/deps/icu-small/source/i18n/digitgrouping.h
index 33835ff665..f3f8679b87 100644
--- a/deps/icu-small/source/i18n/digitgrouping.h
+++ b/deps/icu-small/source/i18n/digitgrouping.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/digitinterval.cpp b/deps/icu-small/source/i18n/digitinterval.cpp
index b1ba811606..32d952e026 100644
--- a/deps/icu-small/source/i18n/digitinterval.cpp
+++ b/deps/icu-small/source/i18n/digitinterval.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/digitinterval.h b/deps/icu-small/source/i18n/digitinterval.h
index 5dbf3f9a29..95d406da20 100644
--- a/deps/icu-small/source/i18n/digitinterval.h
+++ b/deps/icu-small/source/i18n/digitinterval.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/digitlst.cpp b/deps/icu-small/source/i18n/digitlst.cpp
index e3873eb59f..fd96a07d71 100644
--- a/deps/icu-small/source/i18n/digitlst.cpp
+++ b/deps/icu-small/source/i18n/digitlst.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/digitlst.h b/deps/icu-small/source/i18n/digitlst.h
index 27e6e8c410..6befaf32e6 100644
--- a/deps/icu-small/source/i18n/digitlst.h
+++ b/deps/icu-small/source/i18n/digitlst.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/dt_impl.h b/deps/icu-small/source/i18n/dt_impl.h
index 9b01bad79e..a4058c6924 100644
--- a/deps/icu-small/source/i18n/dt_impl.h
+++ b/deps/icu-small/source/i18n/dt_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/dtfmtsym.cpp b/deps/icu-small/source/i18n/dtfmtsym.cpp
index c412c5be05..e465fe1762 100644
--- a/deps/icu-small/source/i18n/dtfmtsym.cpp
+++ b/deps/icu-small/source/i18n/dtfmtsym.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -1368,7 +1368,7 @@ DateFormatSymbols::setZoneStrings(const UnicodeString* const *strings, int32_t r
//------------------------------------------------------
-const UChar * U_EXPORT2
+const char16_t * U_EXPORT2
DateFormatSymbols::getPatternUChars(void)
{
return gPatternChars;
diff --git a/deps/icu-small/source/i18n/dtitv_impl.h b/deps/icu-small/source/i18n/dtitv_impl.h
index 7e5d53921e..18fe0b8c9b 100644
--- a/deps/icu-small/source/i18n/dtitv_impl.h
+++ b/deps/icu-small/source/i18n/dtitv_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/dtitvfmt.cpp b/deps/icu-small/source/i18n/dtitvfmt.cpp
index 48068d3cc2..743b534fc8 100644
--- a/deps/icu-small/source/i18n/dtitvfmt.cpp
+++ b/deps/icu-small/source/i18n/dtitvfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*******************************************************************************
* Copyright (C) 2008-2016, International Business Machines Corporation and
diff --git a/deps/icu-small/source/i18n/dtitvinf.cpp b/deps/icu-small/source/i18n/dtitvinf.cpp
index 07129db928..c863a683a5 100644
--- a/deps/icu-small/source/i18n/dtitvinf.cpp
+++ b/deps/icu-small/source/i18n/dtitvinf.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*******************************************************************************
* Copyright (C) 2008-2016, International Business Machines Corporation and
diff --git a/deps/icu-small/source/i18n/dtptngen.cpp b/deps/icu-small/source/i18n/dtptngen.cpp
index 17e7ec7cde..5ce3630d98 100644
--- a/deps/icu-small/source/i18n/dtptngen.cpp
+++ b/deps/icu-small/source/i18n/dtptngen.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -475,7 +475,7 @@ struct AllowedHourFormatsSink : public ResourceSink {
}
}
- AllowedHourFormat getHourFormatFromUnicodeString(UnicodeString s) {
+ AllowedHourFormat getHourFormatFromUnicodeString(const UnicodeString &s) {
if (s.length() == 1) {
if (s[0] == LOW_H) { return ALLOWED_HOUR_FORMAT_h; }
if (s[0] == CAP_H) { return ALLOWED_HOUR_FORMAT_H; }
diff --git a/deps/icu-small/source/i18n/dtptngen_impl.h b/deps/icu-small/source/i18n/dtptngen_impl.h
index 00a707585b..38afd5ff5a 100644
--- a/deps/icu-small/source/i18n/dtptngen_impl.h
+++ b/deps/icu-small/source/i18n/dtptngen_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -15,6 +15,9 @@
#define __DTPTNGEN_IMPL_H__
#include "unicode/udatpg.h"
+
+#include "unicode/strenum.h"
+#include "unicode/unistr.h"
#include "uvector.h"
// TODO(claireho): Split off Builder class.
diff --git a/deps/icu-small/source/i18n/dtrule.cpp b/deps/icu-small/source/i18n/dtrule.cpp
index 41b61ae045..6847f1d16e 100644
--- a/deps/icu-small/source/i18n/dtrule.cpp
+++ b/deps/icu-small/source/i18n/dtrule.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/esctrn.cpp b/deps/icu-small/source/i18n/esctrn.cpp
index 9be926f138..900bed7e45 100644
--- a/deps/icu-small/source/i18n/esctrn.cpp
+++ b/deps/icu-small/source/i18n/esctrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/esctrn.h b/deps/icu-small/source/i18n/esctrn.h
index 7afea1b503..60ecc74b49 100644
--- a/deps/icu-small/source/i18n/esctrn.h
+++ b/deps/icu-small/source/i18n/esctrn.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/ethpccal.cpp b/deps/icu-small/source/i18n/ethpccal.cpp
index e27f005583..4377c59b32 100644
--- a/deps/icu-small/source/i18n/ethpccal.cpp
+++ b/deps/icu-small/source/i18n/ethpccal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/ethpccal.h b/deps/icu-small/source/i18n/ethpccal.h
index a9adac6f57..5fae2fb1be 100644
--- a/deps/icu-small/source/i18n/ethpccal.h
+++ b/deps/icu-small/source/i18n/ethpccal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/fmtable.cpp b/deps/icu-small/source/i18n/fmtable.cpp
index feb4e28a07..73f9b66ab6 100644
--- a/deps/icu-small/source/i18n/fmtable.cpp
+++ b/deps/icu-small/source/i18n/fmtable.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/fmtable_cnv.cpp b/deps/icu-small/source/i18n/fmtable_cnv.cpp
index ff4deae92d..9a64792779 100644
--- a/deps/icu-small/source/i18n/fmtable_cnv.cpp
+++ b/deps/icu-small/source/i18n/fmtable_cnv.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/fmtableimp.h b/deps/icu-small/source/i18n/fmtableimp.h
index 8b3778ccc3..0e6ccd24da 100644
--- a/deps/icu-small/source/i18n/fmtableimp.h
+++ b/deps/icu-small/source/i18n/fmtableimp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -12,6 +12,8 @@
#include "digitlst.h"
+#if !UCONFIG_NO_FORMATTING
+
U_NAMESPACE_BEGIN
/**
@@ -35,4 +37,5 @@ static const int64_t MAX_INT64_IN_DOUBLE = 0x001FFFFFFFFFFFFFLL;
U_NAMESPACE_END
+#endif // #if !UCONFIG_NO_FORMATTING
#endif
diff --git a/deps/icu-small/source/i18n/format.cpp b/deps/icu-small/source/i18n/format.cpp
index e951b3082e..e5abbe9eb0 100644
--- a/deps/icu-small/source/i18n/format.cpp
+++ b/deps/icu-small/source/i18n/format.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/fphdlimp.cpp b/deps/icu-small/source/i18n/fphdlimp.cpp
index 6a004a6685..abcec97ee3 100644
--- a/deps/icu-small/source/i18n/fphdlimp.cpp
+++ b/deps/icu-small/source/i18n/fphdlimp.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/fphdlimp.h b/deps/icu-small/source/i18n/fphdlimp.h
index b1fe42bb40..f3ac12c2ba 100644
--- a/deps/icu-small/source/i18n/fphdlimp.h
+++ b/deps/icu-small/source/i18n/fphdlimp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/fpositer.cpp b/deps/icu-small/source/i18n/fpositer.cpp
index 426226d69d..79e2791db8 100644
--- a/deps/icu-small/source/i18n/fpositer.cpp
+++ b/deps/icu-small/source/i18n/fpositer.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/funcrepl.cpp b/deps/icu-small/source/i18n/funcrepl.cpp
index 683e00a2c8..30bcebbf90 100644
--- a/deps/icu-small/source/i18n/funcrepl.cpp
+++ b/deps/icu-small/source/i18n/funcrepl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/funcrepl.h b/deps/icu-small/source/i18n/funcrepl.h
index 954150cf00..a835d5be7c 100644
--- a/deps/icu-small/source/i18n/funcrepl.h
+++ b/deps/icu-small/source/i18n/funcrepl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/gender.cpp b/deps/icu-small/source/i18n/gender.cpp
index 4847ce9584..e60bc520bc 100644
--- a/deps/icu-small/source/i18n/gender.cpp
+++ b/deps/icu-small/source/i18n/gender.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/gregocal.cpp b/deps/icu-small/source/i18n/gregocal.cpp
index 959228ab49..49c4226049 100644
--- a/deps/icu-small/source/i18n/gregocal.cpp
+++ b/deps/icu-small/source/i18n/gregocal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/gregoimp.cpp b/deps/icu-small/source/i18n/gregoimp.cpp
index fa886f5a6f..01465973d6 100644
--- a/deps/icu-small/source/i18n/gregoimp.cpp
+++ b/deps/icu-small/source/i18n/gregoimp.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/gregoimp.h b/deps/icu-small/source/i18n/gregoimp.h
index 19e44c7a5a..a7834c4ee5 100644
--- a/deps/icu-small/source/i18n/gregoimp.h
+++ b/deps/icu-small/source/i18n/gregoimp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/hebrwcal.cpp b/deps/icu-small/source/i18n/hebrwcal.cpp
index 0b329a8715..66a3e47a4f 100644
--- a/deps/icu-small/source/i18n/hebrwcal.cpp
+++ b/deps/icu-small/source/i18n/hebrwcal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/hebrwcal.h b/deps/icu-small/source/i18n/hebrwcal.h
index 0824fb7c78..9323ad62aa 100644
--- a/deps/icu-small/source/i18n/hebrwcal.h
+++ b/deps/icu-small/source/i18n/hebrwcal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/indiancal.cpp b/deps/icu-small/source/i18n/indiancal.cpp
index 7964d45312..a2a7f2dcdd 100644
--- a/deps/icu-small/source/i18n/indiancal.cpp
+++ b/deps/icu-small/source/i18n/indiancal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2003-2014, International Business Machines Corporation
diff --git a/deps/icu-small/source/i18n/indiancal.h b/deps/icu-small/source/i18n/indiancal.h
index fcc21d729b..d40af5ad45 100644
--- a/deps/icu-small/source/i18n/indiancal.h
+++ b/deps/icu-small/source/i18n/indiancal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************
diff --git a/deps/icu-small/source/i18n/inputext.cpp b/deps/icu-small/source/i18n/inputext.cpp
index 4e053aef2e..96e59b24d8 100644
--- a/deps/icu-small/source/i18n/inputext.cpp
+++ b/deps/icu-small/source/i18n/inputext.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/inputext.h b/deps/icu-small/source/i18n/inputext.h
index 6a5d253e05..06ad627c62 100644
--- a/deps/icu-small/source/i18n/inputext.h
+++ b/deps/icu-small/source/i18n/inputext.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/islamcal.cpp b/deps/icu-small/source/i18n/islamcal.cpp
index 7c2d1b6b98..733301d98e 100644
--- a/deps/icu-small/source/i18n/islamcal.cpp
+++ b/deps/icu-small/source/i18n/islamcal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/islamcal.h b/deps/icu-small/source/i18n/islamcal.h
index 4e2a1e3d52..17fb6687ef 100644
--- a/deps/icu-small/source/i18n/islamcal.h
+++ b/deps/icu-small/source/i18n/islamcal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/japancal.cpp b/deps/icu-small/source/i18n/japancal.cpp
index 0c8396f6f8..a2738e86a9 100644
--- a/deps/icu-small/source/i18n/japancal.cpp
+++ b/deps/icu-small/source/i18n/japancal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/japancal.h b/deps/icu-small/source/i18n/japancal.h
index ab267f81f1..356351d28d 100644
--- a/deps/icu-small/source/i18n/japancal.h
+++ b/deps/icu-small/source/i18n/japancal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/measfmt.cpp b/deps/icu-small/source/i18n/measfmt.cpp
index 4ac2f7d5eb..4e9d4a56f2 100644
--- a/deps/icu-small/source/i18n/measfmt.cpp
+++ b/deps/icu-small/source/i18n/measfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -26,6 +26,7 @@
#include "unicode/decimfmt.h"
#include "uresimp.h"
#include "unicode/ures.h"
+#include "unicode/ustring.h"
#include "ureslocs.h"
#include "cstring.h"
#include "mutex.h"
@@ -41,7 +42,7 @@
#include "standardplural.h"
#include "unifiedcache.h"
-#define MEAS_UNIT_COUNT 138
+#define MEAS_UNIT_COUNT 135
#define WIDTH_INDEX_COUNT (UMEASFMT_WIDTH_NARROW + 1)
U_NAMESPACE_BEGIN
@@ -288,10 +289,8 @@ struct UnitDataSink : public ResourceSink {
return;
}
- if (value.getType() == URES_STRING) {
- // Units like "coordinate" that don't have plural variants
- setFormatterIfAbsent(StandardPlural::OTHER, value, 0, errorCode);
- } else if (value.getType() == URES_TABLE) {
+ // We no longer handle units like "coordinate" here (which do not have plural variants)
+ if (value.getType() == URES_TABLE) {
// Units that have plural variants
ResourceTable patternTableTable = value.getTable(errorCode);
if (U_FAILURE(errorCode)) { return; }
@@ -333,6 +332,8 @@ struct UnitDataSink : public ResourceSink {
consumeCompoundPattern(key, value, errorCode);
}
}
+ } else if (uprv_strcmp(key, "coordinate") == 0) {
+ // special handling but we need to determine what that is
} else {
type = key;
ResourceTable subtypeTable = value.getTable(errorCode);
diff --git a/deps/icu-small/source/i18n/measunit.cpp b/deps/icu-small/source/i18n/measunit.cpp
index a3021b7405..43c8fd4bab 100644
--- a/deps/icu-small/source/i18n/measunit.cpp
+++ b/deps/icu-small/source/i18n/measunit.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -40,21 +40,20 @@ static const int32_t gOffsets[] = {
16,
20,
24,
- 28,
- 288,
- 298,
- 309,
- 313,
- 319,
- 323,
- 342,
- 343,
- 354,
- 360,
- 365,
- 369,
- 373,
- 398
+ 285,
+ 295,
+ 306,
+ 310,
+ 316,
+ 320,
+ 340,
+ 341,
+ 352,
+ 358,
+ 363,
+ 367,
+ 371,
+ 396
};
static const int32_t gIndexes[] = {
@@ -64,21 +63,20 @@ static const int32_t gIndexes[] = {
16,
20,
24,
- 28,
- 28,
- 38,
+ 24,
+ 34,
+ 45,
49,
- 53,
+ 55,
59,
- 63,
- 82,
- 83,
- 94,
- 100,
- 105,
- 109,
- 113,
- 138
+ 79,
+ 80,
+ 91,
+ 97,
+ 102,
+ 106,
+ 110,
+ 135
};
// Must be sorted alphabetically.
@@ -88,7 +86,6 @@ static const char * const gTypes[] = {
"area",
"concentr",
"consumption",
- "coordinate",
"currency",
"digital",
"duration",
@@ -131,10 +128,6 @@ static const char * const gSubTypes[] = {
"liter-per-kilometer",
"mile-per-gallon",
"mile-per-gallon-imperial",
- "east",
- "north",
- "south",
- "west",
"ADP",
"AED",
"AFA",
@@ -178,6 +171,7 @@ static const char * const gSubTypes[] = {
"BTN",
"BWP",
"BYB",
+ "BYN",
"BYR",
"BZD",
"CAD",
@@ -448,6 +442,7 @@ static const char * const gSubTypes[] = {
"nautical-mile",
"parsec",
"picometer",
+ "point",
"yard",
"lux",
"carat",
@@ -509,14 +504,14 @@ static const char * const gSubTypes[] = {
// Must be sorted by first value and then second value.
static int32_t unitPerUnitToSingleUnit[][4] = {
- {330, 300, 17, 0},
- {332, 306, 17, 2},
- {334, 300, 17, 3},
- {334, 387, 4, 2},
- {334, 388, 4, 3},
- {348, 385, 3, 1},
- {351, 11, 16, 4},
- {390, 330, 4, 1}
+ {327, 297, 16, 0},
+ {329, 303, 16, 2},
+ {331, 297, 16, 3},
+ {331, 385, 4, 2},
+ {331, 386, 4, 3},
+ {346, 383, 3, 1},
+ {349, 11, 15, 4},
+ {388, 327, 4, 1}
};
MeasureUnit *MeasureUnit::createGForce(UErrorCode &status) {
@@ -615,460 +610,456 @@ MeasureUnit *MeasureUnit::createMilePerGallonImperial(UErrorCode &status) {
return MeasureUnit::create(4, 3, status);
}
-MeasureUnit *MeasureUnit::createEast(UErrorCode &status) {
- return MeasureUnit::create(5, 0, status);
-}
+// MeasureUnit *MeasureUnit::createEast(UErrorCode &status) {...}
-MeasureUnit *MeasureUnit::createNorth(UErrorCode &status) {
- return MeasureUnit::create(5, 1, status);
-}
+// MeasureUnit *MeasureUnit::createNorth(UErrorCode &status) {...}
-MeasureUnit *MeasureUnit::createSouth(UErrorCode &status) {
- return MeasureUnit::create(5, 2, status);
-}
+// MeasureUnit *MeasureUnit::createSouth(UErrorCode &status) {...}
-MeasureUnit *MeasureUnit::createWest(UErrorCode &status) {
- return MeasureUnit::create(5, 3, status);
-}
+// MeasureUnit *MeasureUnit::createWest(UErrorCode &status) {...}
MeasureUnit *MeasureUnit::createBit(UErrorCode &status) {
- return MeasureUnit::create(7, 0, status);
+ return MeasureUnit::create(6, 0, status);
}
MeasureUnit *MeasureUnit::createByte(UErrorCode &status) {
- return MeasureUnit::create(7, 1, status);
+ return MeasureUnit::create(6, 1, status);
}
MeasureUnit *MeasureUnit::createGigabit(UErrorCode &status) {
- return MeasureUnit::create(7, 2, status);
+ return MeasureUnit::create(6, 2, status);
}
MeasureUnit *MeasureUnit::createGigabyte(UErrorCode &status) {
- return MeasureUnit::create(7, 3, status);
+ return MeasureUnit::create(6, 3, status);
}
MeasureUnit *MeasureUnit::createKilobit(UErrorCode &status) {
- return MeasureUnit::create(7, 4, status);
+ return MeasureUnit::create(6, 4, status);
}
MeasureUnit *MeasureUnit::createKilobyte(UErrorCode &status) {
- return MeasureUnit::create(7, 5, status);
+ return MeasureUnit::create(6, 5, status);
}
MeasureUnit *MeasureUnit::createMegabit(UErrorCode &status) {
- return MeasureUnit::create(7, 6, status);
+ return MeasureUnit::create(6, 6, status);
}
MeasureUnit *MeasureUnit::createMegabyte(UErrorCode &status) {
- return MeasureUnit::create(7, 7, status);
+ return MeasureUnit::create(6, 7, status);
}
MeasureUnit *MeasureUnit::createTerabit(UErrorCode &status) {
- return MeasureUnit::create(7, 8, status);
+ return MeasureUnit::create(6, 8, status);
}
MeasureUnit *MeasureUnit::createTerabyte(UErrorCode &status) {
- return MeasureUnit::create(7, 9, status);
+ return MeasureUnit::create(6, 9, status);
}
MeasureUnit *MeasureUnit::createCentury(UErrorCode &status) {
- return MeasureUnit::create(8, 0, status);
+ return MeasureUnit::create(7, 0, status);
}
MeasureUnit *MeasureUnit::createDay(UErrorCode &status) {
- return MeasureUnit::create(8, 1, status);
+ return MeasureUnit::create(7, 1, status);
}
MeasureUnit *MeasureUnit::createHour(UErrorCode &status) {
- return MeasureUnit::create(8, 2, status);
+ return MeasureUnit::create(7, 2, status);
}
MeasureUnit *MeasureUnit::createMicrosecond(UErrorCode &status) {
- return MeasureUnit::create(8, 3, status);
+ return MeasureUnit::create(7, 3, status);
}
MeasureUnit *MeasureUnit::createMillisecond(UErrorCode &status) {
- return MeasureUnit::create(8, 4, status);
+ return MeasureUnit::create(7, 4, status);
}
MeasureUnit *MeasureUnit::createMinute(UErrorCode &status) {
- return MeasureUnit::create(8, 5, status);
+ return MeasureUnit::create(7, 5, status);
}
MeasureUnit *MeasureUnit::createMonth(UErrorCode &status) {
- return MeasureUnit::create(8, 6, status);
+ return MeasureUnit::create(7, 6, status);
}
MeasureUnit *MeasureUnit::createNanosecond(UErrorCode &status) {
- return MeasureUnit::create(8, 7, status);
+ return MeasureUnit::create(7, 7, status);
}
MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) {
- return MeasureUnit::create(8, 8, status);
+ return MeasureUnit::create(7, 8, status);
}
MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) {
- return MeasureUnit::create(8, 9, status);
+ return MeasureUnit::create(7, 9, status);
}
MeasureUnit *MeasureUnit::createYear(UErrorCode &status) {
- return MeasureUnit::create(8, 10, status);
+ return MeasureUnit::create(7, 10, status);
}
MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) {
- return MeasureUnit::create(9, 0, status);
+ return MeasureUnit::create(8, 0, status);
}
MeasureUnit *MeasureUnit::createMilliampere(UErrorCode &status) {
- return MeasureUnit::create(9, 1, status);
+ return MeasureUnit::create(8, 1, status);
}
MeasureUnit *MeasureUnit::createOhm(UErrorCode &status) {
- return MeasureUnit::create(9, 2, status);
+ return MeasureUnit::create(8, 2, status);
}
MeasureUnit *MeasureUnit::createVolt(UErrorCode &status) {
- return MeasureUnit::create(9, 3, status);
+ return MeasureUnit::create(8, 3, status);
}
MeasureUnit *MeasureUnit::createCalorie(UErrorCode &status) {
- return MeasureUnit::create(10, 0, status);
+ return MeasureUnit::create(9, 0, status);
}
MeasureUnit *MeasureUnit::createFoodcalorie(UErrorCode &status) {
- return MeasureUnit::create(10, 1, status);
+ return MeasureUnit::create(9, 1, status);
}
MeasureUnit *MeasureUnit::createJoule(UErrorCode &status) {
- return MeasureUnit::create(10, 2, status);
+ return MeasureUnit::create(9, 2, status);
}
MeasureUnit *MeasureUnit::createKilocalorie(UErrorCode &status) {
- return MeasureUnit::create(10, 3, status);
+ return MeasureUnit::create(9, 3, status);
}
MeasureUnit *MeasureUnit::createKilojoule(UErrorCode &status) {
- return MeasureUnit::create(10, 4, status);
+ return MeasureUnit::create(9, 4, status);
}
MeasureUnit *MeasureUnit::createKilowattHour(UErrorCode &status) {
- return MeasureUnit::create(10, 5, status);
+ return MeasureUnit::create(9, 5, status);
}
MeasureUnit *MeasureUnit::createGigahertz(UErrorCode &status) {
- return MeasureUnit::create(11, 0, status);
+ return MeasureUnit::create(10, 0, status);
}
MeasureUnit *MeasureUnit::createHertz(UErrorCode &status) {
- return MeasureUnit::create(11, 1, status);
+ return MeasureUnit::create(10, 1, status);
}
MeasureUnit *MeasureUnit::createKilohertz(UErrorCode &status) {
- return MeasureUnit::create(11, 2, status);
+ return MeasureUnit::create(10, 2, status);
}
MeasureUnit *MeasureUnit::createMegahertz(UErrorCode &status) {
- return MeasureUnit::create(11, 3, status);
+ return MeasureUnit::create(10, 3, status);
}
MeasureUnit *MeasureUnit::createAstronomicalUnit(UErrorCode &status) {
- return MeasureUnit::create(12, 0, status);
+ return MeasureUnit::create(11, 0, status);
}
MeasureUnit *MeasureUnit::createCentimeter(UErrorCode &status) {
- return MeasureUnit::create(12, 1, status);
+ return MeasureUnit::create(11, 1, status);
}
MeasureUnit *MeasureUnit::createDecimeter(UErrorCode &status) {
- return MeasureUnit::create(12, 2, status);
+ return MeasureUnit::create(11, 2, status);
}
MeasureUnit *MeasureUnit::createFathom(UErrorCode &status) {
- return MeasureUnit::create(12, 3, status);
+ return MeasureUnit::create(11, 3, status);
}
MeasureUnit *MeasureUnit::createFoot(UErrorCode &status) {
- return MeasureUnit::create(12, 4, status);
+ return MeasureUnit::create(11, 4, status);
}
MeasureUnit *MeasureUnit::createFurlong(UErrorCode &status) {
- return MeasureUnit::create(12, 5, status);
+ return MeasureUnit::create(11, 5, status);
}
MeasureUnit *MeasureUnit::createInch(UErrorCode &status) {
- return MeasureUnit::create(12, 6, status);
+ return MeasureUnit::create(11, 6, status);
}
MeasureUnit *MeasureUnit::createKilometer(UErrorCode &status) {
- return MeasureUnit::create(12, 7, status);
+ return MeasureUnit::create(11, 7, status);
}
MeasureUnit *MeasureUnit::createLightYear(UErrorCode &status) {
- return MeasureUnit::create(12, 8, status);
+ return MeasureUnit::create(11, 8, status);
}
MeasureUnit *MeasureUnit::createMeter(UErrorCode &status) {
- return MeasureUnit::create(12, 9, status);
+ return MeasureUnit::create(11, 9, status);
}
MeasureUnit *MeasureUnit::createMicrometer(UErrorCode &status) {
- return MeasureUnit::create(12, 10, status);
+ return MeasureUnit::create(11, 10, status);
}
MeasureUnit *MeasureUnit::createMile(UErrorCode &status) {
- return MeasureUnit::create(12, 11, status);
+ return MeasureUnit::create(11, 11, status);
}
MeasureUnit *MeasureUnit::createMileScandinavian(UErrorCode &status) {
- return MeasureUnit::create(12, 12, status);
+ return MeasureUnit::create(11, 12, status);
}
MeasureUnit *MeasureUnit::createMillimeter(UErrorCode &status) {
- return MeasureUnit::create(12, 13, status);
+ return MeasureUnit::create(11, 13, status);
}
MeasureUnit *MeasureUnit::createNanometer(UErrorCode &status) {
- return MeasureUnit::create(12, 14, status);
+ return MeasureUnit::create(11, 14, status);
}
MeasureUnit *MeasureUnit::createNauticalMile(UErrorCode &status) {
- return MeasureUnit::create(12, 15, status);
+ return MeasureUnit::create(11, 15, status);
}
MeasureUnit *MeasureUnit::createParsec(UErrorCode &status) {
- return MeasureUnit::create(12, 16, status);
+ return MeasureUnit::create(11, 16, status);
}
MeasureUnit *MeasureUnit::createPicometer(UErrorCode &status) {
- return MeasureUnit::create(12, 17, status);
+ return MeasureUnit::create(11, 17, status);
+}
+
+MeasureUnit *MeasureUnit::createPoint(UErrorCode &status) {
+ return MeasureUnit::create(11, 18, status);
}
MeasureUnit *MeasureUnit::createYard(UErrorCode &status) {
- return MeasureUnit::create(12, 18, status);
+ return MeasureUnit::create(11, 19, status);
}
MeasureUnit *MeasureUnit::createLux(UErrorCode &status) {
- return MeasureUnit::create(13, 0, status);
+ return MeasureUnit::create(12, 0, status);
}
MeasureUnit *MeasureUnit::createCarat(UErrorCode &status) {
- return MeasureUnit::create(14, 0, status);
+ return MeasureUnit::create(13, 0, status);
}
MeasureUnit *MeasureUnit::createGram(UErrorCode &status) {
- return MeasureUnit::create(14, 1, status);
+ return MeasureUnit::create(13, 1, status);
}
MeasureUnit *MeasureUnit::createKilogram(UErrorCode &status) {
- return MeasureUnit::create(14, 2, status);
+ return MeasureUnit::create(13, 2, status);
}
MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) {
- return MeasureUnit::create(14, 3, status);
+ return MeasureUnit::create(13, 3, status);
}
MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) {
- return MeasureUnit::create(14, 4, status);
+ return MeasureUnit::create(13, 4, status);
}
MeasureUnit *MeasureUnit::createMilligram(UErrorCode &status) {
- return MeasureUnit::create(14, 5, status);
+ return MeasureUnit::create(13, 5, status);
}
MeasureUnit *MeasureUnit::createOunce(UErrorCode &status) {
- return MeasureUnit::create(14, 6, status);
+ return MeasureUnit::create(13, 6, status);
}
MeasureUnit *MeasureUnit::createOunceTroy(UErrorCode &status) {
- return MeasureUnit::create(14, 7, status);
+ return MeasureUnit::create(13, 7, status);
}
MeasureUnit *MeasureUnit::createPound(UErrorCode &status) {
- return MeasureUnit::create(14, 8, status);
+ return MeasureUnit::create(13, 8, status);
}
MeasureUnit *MeasureUnit::createStone(UErrorCode &status) {
- return MeasureUnit::create(14, 9, status);
+ return MeasureUnit::create(13, 9, status);
}
MeasureUnit *MeasureUnit::createTon(UErrorCode &status) {
- return MeasureUnit::create(14, 10, status);
+ return MeasureUnit::create(13, 10, status);
}
MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) {
- return MeasureUnit::create(15, 0, status);
+ return MeasureUnit::create(14, 0, status);
}
MeasureUnit *MeasureUnit::createHorsepower(UErrorCode &status) {
- return MeasureUnit::create(15, 1, status);
+ return MeasureUnit::create(14, 1, status);
}
MeasureUnit *MeasureUnit::createKilowatt(UErrorCode &status) {
- return MeasureUnit::create(15, 2, status);
+ return MeasureUnit::create(14, 2, status);
}
MeasureUnit *MeasureUnit::createMegawatt(UErrorCode &status) {
- return MeasureUnit::create(15, 3, status);
+ return MeasureUnit::create(14, 3, status);
}
MeasureUnit *MeasureUnit::createMilliwatt(UErrorCode &status) {
- return MeasureUnit::create(15, 4, status);
+ return MeasureUnit::create(14, 4, status);
}
MeasureUnit *MeasureUnit::createWatt(UErrorCode &status) {
- return MeasureUnit::create(15, 5, status);
+ return MeasureUnit::create(14, 5, status);
}
MeasureUnit *MeasureUnit::createHectopascal(UErrorCode &status) {
- return MeasureUnit::create(16, 0, status);
+ return MeasureUnit::create(15, 0, status);
}
MeasureUnit *MeasureUnit::createInchHg(UErrorCode &status) {
- return MeasureUnit::create(16, 1, status);
+ return MeasureUnit::create(15, 1, status);
}
MeasureUnit *MeasureUnit::createMillibar(UErrorCode &status) {
- return MeasureUnit::create(16, 2, status);
+ return MeasureUnit::create(15, 2, status);
}
MeasureUnit *MeasureUnit::createMillimeterOfMercury(UErrorCode &status) {
- return MeasureUnit::create(16, 3, status);
+ return MeasureUnit::create(15, 3, status);
}
MeasureUnit *MeasureUnit::createPoundPerSquareInch(UErrorCode &status) {
- return MeasureUnit::create(16, 4, status);
+ return MeasureUnit::create(15, 4, status);
}
MeasureUnit *MeasureUnit::createKilometerPerHour(UErrorCode &status) {
- return MeasureUnit::create(17, 0, status);
+ return MeasureUnit::create(16, 0, status);
}
MeasureUnit *MeasureUnit::createKnot(UErrorCode &status) {
- return MeasureUnit::create(17, 1, status);
+ return MeasureUnit::create(16, 1, status);
}
MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) {
- return MeasureUnit::create(17, 2, status);
+ return MeasureUnit::create(16, 2, status);
}
MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) {
- return MeasureUnit::create(17, 3, status);
+ return MeasureUnit::create(16, 3, status);
}
MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) {
- return MeasureUnit::create(18, 0, status);
+ return MeasureUnit::create(17, 0, status);
}
MeasureUnit *MeasureUnit::createFahrenheit(UErrorCode &status) {
- return MeasureUnit::create(18, 1, status);
+ return MeasureUnit::create(17, 1, status);
}
MeasureUnit *MeasureUnit::createGenericTemperature(UErrorCode &status) {
- return MeasureUnit::create(18, 2, status);
+ return MeasureUnit::create(17, 2, status);
}
MeasureUnit *MeasureUnit::createKelvin(UErrorCode &status) {
- return MeasureUnit::create(18, 3, status);
+ return MeasureUnit::create(17, 3, status);
}
MeasureUnit *MeasureUnit::createAcreFoot(UErrorCode &status) {
- return MeasureUnit::create(19, 0, status);
+ return MeasureUnit::create(18, 0, status);
}
MeasureUnit *MeasureUnit::createBushel(UErrorCode &status) {
- return MeasureUnit::create(19, 1, status);
+ return MeasureUnit::create(18, 1, status);
}
MeasureUnit *MeasureUnit::createCentiliter(UErrorCode &status) {
- return MeasureUnit::create(19, 2, status);
+ return MeasureUnit::create(18, 2, status);
}
MeasureUnit *MeasureUnit::createCubicCentimeter(UErrorCode &status) {
- return MeasureUnit::create(19, 3, status);
+ return MeasureUnit::create(18, 3, status);
}
MeasureUnit *MeasureUnit::createCubicFoot(UErrorCode &status) {
- return MeasureUnit::create(19, 4, status);
+ return MeasureUnit::create(18, 4, status);
}
MeasureUnit *MeasureUnit::createCubicInch(UErrorCode &status) {
- return MeasureUnit::create(19, 5, status);
+ return MeasureUnit::create(18, 5, status);
}
MeasureUnit *MeasureUnit::createCubicKilometer(UErrorCode &status) {
- return MeasureUnit::create(19, 6, status);
+ return MeasureUnit::create(18, 6, status);
}
MeasureUnit *MeasureUnit::createCubicMeter(UErrorCode &status) {
- return MeasureUnit::create(19, 7, status);
+ return MeasureUnit::create(18, 7, status);
}
MeasureUnit *MeasureUnit::createCubicMile(UErrorCode &status) {
- return MeasureUnit::create(19, 8, status);
+ return MeasureUnit::create(18, 8, status);
}
MeasureUnit *MeasureUnit::createCubicYard(UErrorCode &status) {
- return MeasureUnit::create(19, 9, status);
+ return MeasureUnit::create(18, 9, status);
}
MeasureUnit *MeasureUnit::createCup(UErrorCode &status) {
- return MeasureUnit::create(19, 10, status);
+ return MeasureUnit::create(18, 10, status);
}
MeasureUnit *MeasureUnit::createCupMetric(UErrorCode &status) {
- return MeasureUnit::create(19, 11, status);
+ return MeasureUnit::create(18, 11, status);
}
MeasureUnit *MeasureUnit::createDeciliter(UErrorCode &status) {
- return MeasureUnit::create(19, 12, status);
+ return MeasureUnit::create(18, 12, status);
}
MeasureUnit *MeasureUnit::createFluidOunce(UErrorCode &status) {
- return MeasureUnit::create(19, 13, status);
+ return MeasureUnit::create(18, 13, status);
}
MeasureUnit *MeasureUnit::createGallon(UErrorCode &status) {
- return MeasureUnit::create(19, 14, status);
+ return MeasureUnit::create(18, 14, status);
}
MeasureUnit *MeasureUnit::createGallonImperial(UErrorCode &status) {
- return MeasureUnit::create(19, 15, status);
+ return MeasureUnit::create(18, 15, status);
}
MeasureUnit *MeasureUnit::createHectoliter(UErrorCode &status) {
- return MeasureUnit::create(19, 16, status);
+ return MeasureUnit::create(18, 16, status);
}
MeasureUnit *MeasureUnit::createLiter(UErrorCode &status) {
- return MeasureUnit::create(19, 17, status);
+ return MeasureUnit::create(18, 17, status);
}
MeasureUnit *MeasureUnit::createMegaliter(UErrorCode &status) {
- return MeasureUnit::create(19, 18, status);
+ return MeasureUnit::create(18, 18, status);
}
MeasureUnit *MeasureUnit::createMilliliter(UErrorCode &status) {
- return MeasureUnit::create(19, 19, status);
+ return MeasureUnit::create(18, 19, status);
}
MeasureUnit *MeasureUnit::createPint(UErrorCode &status) {
- return MeasureUnit::create(19, 20, status);
+ return MeasureUnit::create(18, 20, status);
}
MeasureUnit *MeasureUnit::createPintMetric(UErrorCode &status) {
- return MeasureUnit::create(19, 21, status);
+ return MeasureUnit::create(18, 21, status);
}
MeasureUnit *MeasureUnit::createQuart(UErrorCode &status) {
- return MeasureUnit::create(19, 22, status);
+ return MeasureUnit::create(18, 22, status);
}
MeasureUnit *MeasureUnit::createTablespoon(UErrorCode &status) {
- return MeasureUnit::create(19, 23, status);
+ return MeasureUnit::create(18, 23, status);
}
MeasureUnit *MeasureUnit::createTeaspoon(UErrorCode &status) {
- return MeasureUnit::create(19, 24, status);
+ return MeasureUnit::create(18, 24, status);
}
// End generated code
diff --git a/deps/icu-small/source/i18n/measure.cpp b/deps/icu-small/source/i18n/measure.cpp
index 3459e71b80..d9084f87db 100644
--- a/deps/icu-small/source/i18n/measure.cpp
+++ b/deps/icu-small/source/i18n/measure.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/msgfmt.cpp b/deps/icu-small/source/i18n/msgfmt.cpp
index 4658528050..94a0286196 100644
--- a/deps/icu-small/source/i18n/msgfmt.cpp
+++ b/deps/icu-small/source/i18n/msgfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
diff --git a/deps/icu-small/source/i18n/msgfmt_impl.h b/deps/icu-small/source/i18n/msgfmt_impl.h
index 80a07dc1ea..0f77d12d0b 100644
--- a/deps/icu-small/source/i18n/msgfmt_impl.h
+++ b/deps/icu-small/source/i18n/msgfmt_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/name2uni.cpp b/deps/icu-small/source/i18n/name2uni.cpp
index acd9c0af99..d901eb126a 100644
--- a/deps/icu-small/source/i18n/name2uni.cpp
+++ b/deps/icu-small/source/i18n/name2uni.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/name2uni.h b/deps/icu-small/source/i18n/name2uni.h
index 2ba4c8f792..4c743def32 100644
--- a/deps/icu-small/source/i18n/name2uni.h
+++ b/deps/icu-small/source/i18n/name2uni.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/nfrlist.h b/deps/icu-small/source/i18n/nfrlist.h
index 65b21c6b1d..db28c4d36f 100644
--- a/deps/icu-small/source/i18n/nfrlist.h
+++ b/deps/icu-small/source/i18n/nfrlist.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrlist.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/nfrs.cpp b/deps/icu-small/source/i18n/nfrs.cpp
index 5cbd33d0e2..8119aefd5e 100644
--- a/deps/icu-small/source/i18n/nfrs.cpp
+++ b/deps/icu-small/source/i18n/nfrs.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrs.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -23,6 +23,7 @@
#include "nfrule.h"
#include "nfrlist.h"
#include "patternprops.h"
+#include "putilimp.h"
#ifdef RBNF_DEBUG
#include "cmemory.h"
@@ -544,7 +545,7 @@ NFRuleSet::findNormalRule(int64_t number) const
// an explanation of the rollback rule). If we do, roll back
// one rule and return that one instead of the one we'd normally
// return
- if (result->shouldRollBack((double)number)) {
+ if (result->shouldRollBack(number)) {
if (hi == 1) { // bad rule set, no prior rule to rollback to from this base
return NULL;
}
@@ -829,18 +830,20 @@ int64_t util64_fromDouble(double d) {
return result;
}
-int64_t util64_pow(int32_t r, uint32_t e) {
- if (r == 0) {
+int64_t util64_pow(int32_t base, uint16_t exponent) {
+ if (base == 0) {
return 0;
- } else if (e == 0) {
- return 1;
- } else {
- int64_t n = r;
- while (--e > 0) {
- n *= r;
+ }
+ int64_t result = 1;
+ int64_t pow = base;
+ while (exponent > 0) {
+ if ((exponent & 1) == 1) {
+ result *= pow;
}
- return n;
+ pow *= pow;
+ exponent >>= 1;
}
+ return result;
}
static const uint8_t asciiDigits[] = {
diff --git a/deps/icu-small/source/i18n/nfrs.h b/deps/icu-small/source/i18n/nfrs.h
index b06c2b2215..eafb1ca441 100644
--- a/deps/icu-small/source/i18n/nfrs.h
+++ b/deps/icu-small/source/i18n/nfrs.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrs.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -88,7 +88,7 @@ private:
int64_t util64_fromDouble(double d);
// raise radix to the power exponent, only non-negative exponents
-int64_t util64_pow(int32_t radix, uint32_t exponent);
+int64_t util64_pow(int32_t radix, uint16_t exponent);
// convert n to digit string in buffer, return length of string
uint32_t util64_tou(int64_t n, UChar* buffer, uint32_t buflen, uint32_t radix = 10, UBool raw = FALSE);
diff --git a/deps/icu-small/source/i18n/nfrule.cpp b/deps/icu-small/source/i18n/nfrule.cpp
index 100a46490d..2c26aff2d1 100644
--- a/deps/icu-small/source/i18n/nfrule.cpp
+++ b/deps/icu-small/source/i18n/nfrule.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrule.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -30,6 +30,7 @@
#include "nfrlist.h"
#include "nfsubs.h"
#include "patternprops.h"
+#include "putilimp.h"
U_NAMESPACE_BEGIN
@@ -715,6 +716,12 @@ NFRule::_appendRuleText(UnicodeString& result) const
result.append(gSemicolon);
}
+int64_t NFRule::getDivisor() const
+{
+ return util64_pow(radix, exponent);
+}
+
+
//-----------------------------------------------------------------------
// formatting
//-----------------------------------------------------------------------
@@ -749,7 +756,7 @@ NFRule::doFormat(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32
toInsertInto.insert(pos, ruleText.tempSubString(pluralRuleEnd + 2));
}
toInsertInto.insert(pos,
- rulePatternFormat->format((int32_t)(number/uprv_pow(radix, exponent)), status));
+ rulePatternFormat->format((int32_t)(number/util64_pow(radix, exponent)), status));
if (pluralRuleStart > 0) {
toInsertInto.insert(pos, ruleText.tempSubString(0, pluralRuleStart));
}
@@ -798,10 +805,10 @@ NFRule::doFormat(double number, UnicodeString& toInsertInto, int32_t pos, int32_
if (0 <= pluralVal && pluralVal < 1) {
// We're in a fractional rule, and we have to match the NumeratorSubstitution behavior.
// 2.3 can become 0.2999999999999998 for the fraction due to rounding errors.
- pluralVal = uprv_round(pluralVal * uprv_pow(radix, exponent));
+ pluralVal = uprv_round(pluralVal * util64_pow(radix, exponent));
}
else {
- pluralVal = pluralVal / uprv_pow(radix, exponent);
+ pluralVal = pluralVal / util64_pow(radix, exponent);
}
toInsertInto.insert(pos, rulePatternFormat->format((int32_t)(pluralVal), status));
if (pluralRuleStart > 0) {
@@ -827,7 +834,7 @@ NFRule::doFormat(double number, UnicodeString& toInsertInto, int32_t pos, int32_
* this one in its list; false if it should use this rule
*/
UBool
-NFRule::shouldRollBack(double number) const
+NFRule::shouldRollBack(int64_t number) const
{
// we roll back if the rule contains a modulus substitution,
// the number being formatted is an even multiple of the rule's
@@ -847,7 +854,7 @@ NFRule::shouldRollBack(double number) const
// multiple of 100. This is called the "rollback rule."
if ((sub1 != NULL && sub1->isModulusSubstitution()) || (sub2 != NULL && sub2->isModulusSubstitution())) {
int64_t re = util64_pow(radix, exponent);
- return uprv_fmod(number, (double)re) == 0 && (baseValue % re) != 0;
+ return (number % re) == 0 && (baseValue % re) != 0;
}
return FALSE;
}
diff --git a/deps/icu-small/source/i18n/nfrule.h b/deps/icu-small/source/i18n/nfrule.h
index 5424b968a1..21cdd24fbd 100644
--- a/deps/icu-small/source/i18n/nfrule.h
+++ b/deps/icu-small/source/i18n/nfrule.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -17,7 +17,6 @@
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/unistr.h"
-#include "putilimp.h"
U_NAMESPACE_BEGIN
@@ -66,7 +65,7 @@ public:
UChar getDecimalPoint() const { return decimalPoint; }
- double getDivisor() const { return uprv_pow(radix, exponent); }
+ int64_t getDivisor() const;
void doFormat(int64_t number, UnicodeString& toAppendTo, int32_t pos, int32_t recursionCount, UErrorCode& status) const;
void doFormat(double number, UnicodeString& toAppendTo, int32_t pos, int32_t recursionCount, UErrorCode& status) const;
@@ -77,7 +76,7 @@ public:
double upperBound,
Formattable& result) const;
- UBool shouldRollBack(double number) const;
+ UBool shouldRollBack(int64_t number) const;
void _appendRuleText(UnicodeString& result) const;
diff --git a/deps/icu-small/source/i18n/nfsubs.cpp b/deps/icu-small/source/i18n/nfsubs.cpp
index 58039c8bac..6e7eabe350 100644
--- a/deps/icu-small/source/i18n/nfsubs.cpp
+++ b/deps/icu-small/source/i18n/nfsubs.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfsubs.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -20,6 +20,7 @@
#include "nfsubs.h"
#include "digitlst.h"
+#include "fmtableimp.h"
#if U_HAVE_RBNF
@@ -68,27 +69,24 @@ public:
SameValueSubstitution::~SameValueSubstitution() {}
class MultiplierSubstitution : public NFSubstitution {
- double divisor;
- int64_t ldivisor;
+ int64_t divisor;
public:
MultiplierSubstitution(int32_t _pos,
- double _divisor,
+ const NFRule *rule,
const NFRuleSet* _ruleSet,
const UnicodeString& description,
UErrorCode& status)
- : NFSubstitution(_pos, _ruleSet, description, status), divisor(_divisor)
+ : NFSubstitution(_pos, _ruleSet, description, status), divisor(rule->getDivisor())
{
- ldivisor = util64_fromDouble(divisor);
if (divisor == 0) {
status = U_PARSE_ERROR;
}
}
virtual ~MultiplierSubstitution();
- virtual void setDivisor(int32_t radix, int32_t exponent, UErrorCode& status) {
- divisor = uprv_pow(radix, exponent);
- ldivisor = util64_fromDouble(divisor);
+ virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) {
+ divisor = util64_pow(radix, exponent);
if(divisor == 0) {
status = U_PARSE_ERROR;
@@ -98,14 +96,14 @@ public:
virtual UBool operator==(const NFSubstitution& rhs) const;
virtual int64_t transformNumber(int64_t number) const {
- return number / ldivisor;
+ return number / divisor;
}
virtual double transformNumber(double number) const {
if (getRuleSet()) {
return uprv_floor(number / divisor);
} else {
- return number/divisor;
+ return number / divisor;
}
}
@@ -125,21 +123,19 @@ public:
MultiplierSubstitution::~MultiplierSubstitution() {}
class ModulusSubstitution : public NFSubstitution {
- double divisor;
- int64_t ldivisor;
+ int64_t divisor;
const NFRule* ruleToUse;
public:
ModulusSubstitution(int32_t pos,
- double _divisor,
+ const NFRule* rule,
const NFRule* rulePredecessor,
const NFRuleSet* ruleSet,
const UnicodeString& description,
UErrorCode& status);
virtual ~ModulusSubstitution();
- virtual void setDivisor(int32_t radix, int32_t exponent, UErrorCode& status) {
- divisor = uprv_pow(radix, exponent);
- ldivisor = util64_fromDouble(divisor);
+ virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) {
+ divisor = util64_pow(radix, exponent);
if (divisor == 0) {
status = U_PARSE_ERROR;
@@ -151,7 +147,7 @@ public:
virtual void doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const;
virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const;
- virtual int64_t transformNumber(int64_t number) const { return number % ldivisor; }
+ virtual int64_t transformNumber(int64_t number) const { return number % divisor; }
virtual double transformNumber(double number) const { return uprv_fmod(number, divisor); }
virtual UBool doParse(const UnicodeString& text,
@@ -353,7 +349,7 @@ NFSubstitution::makeSubstitution(int32_t pos,
// otherwise, return a MultiplierSubstitution
else {
- return new MultiplierSubstitution(pos, rule->getDivisor(), ruleSet,
+ return new MultiplierSubstitution(pos, rule, ruleSet,
description, status);
}
@@ -383,7 +379,7 @@ NFSubstitution::makeSubstitution(int32_t pos,
// otherwise, return a ModulusSubstitution
else {
- return new ModulusSubstitution(pos, rule->getDivisor(), predecessor,
+ return new ModulusSubstitution(pos, rule, predecessor,
ruleSet, description, status);
}
@@ -491,7 +487,7 @@ NFSubstitution::~NFSubstitution()
* @param exponent The exponent of the divisor
*/
void
-NFSubstitution::setDivisor(int32_t /*radix*/, int32_t /*exponent*/, UErrorCode& /*status*/) {
+NFSubstitution::setDivisor(int32_t /*radix*/, int16_t /*exponent*/, UErrorCode& /*status*/) {
// a no-op for all substitutions except multiplier and modulus substitutions
}
@@ -572,23 +568,38 @@ void
NFSubstitution::doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t _pos, int32_t recursionCount, UErrorCode& status) const
{
if (ruleSet != NULL) {
- // perform a transformation on the number that is dependent
+ // Perform a transformation on the number that is dependent
// on the type of substitution this is, then just call its
// rule set's format() method to format the result
ruleSet->format(transformNumber(number), toInsertInto, _pos + this->pos, recursionCount, status);
} else if (numberFormat != NULL) {
- // or perform the transformation on the number (preserving
- // the result's fractional part if the formatter it set
- // to show it), then use that formatter's format() method
- // to format the result
- double numberToFormat = transformNumber((double)number);
- if (numberFormat->getMaximumFractionDigits() == 0) {
- numberToFormat = uprv_floor(numberToFormat);
- }
+ if (number <= MAX_INT64_IN_DOUBLE) {
+ // or perform the transformation on the number (preserving
+ // the result's fractional part if the formatter it set
+ // to show it), then use that formatter's format() method
+ // to format the result
+ double numberToFormat = transformNumber((double)number);
+ if (numberFormat->getMaximumFractionDigits() == 0) {
+ numberToFormat = uprv_floor(numberToFormat);
+ }
- UnicodeString temp;
- numberFormat->format(numberToFormat, temp, status);
- toInsertInto.insert(_pos + this->pos, temp);
+ UnicodeString temp;
+ numberFormat->format(numberToFormat, temp, status);
+ toInsertInto.insert(_pos + this->pos, temp);
+ }
+ else {
+ // We have gone beyond double precision. Something has to give.
+ // We're favoring accuracy of the large number over potential rules
+ // that round like a CompactDecimalFormat, which is not a common use case.
+ //
+ // Perform a transformation on the number that is dependent
+ // on the type of substitution this is, then just call its
+ // rule set's format() method to format the result
+ int64_t numberToFormat = transformNumber(number);
+ UnicodeString temp;
+ numberFormat->format(numberToFormat, temp, status);
+ toInsertInto.insert(_pos + this->pos, temp);
+ }
}
}
@@ -809,22 +820,20 @@ UBool MultiplierSubstitution::operator==(const NFSubstitution& rhs) const
* regular rule.
*/
ModulusSubstitution::ModulusSubstitution(int32_t _pos,
- double _divisor,
+ const NFRule* rule,
const NFRule* predecessor,
const NFRuleSet* _ruleSet,
const UnicodeString& description,
UErrorCode& status)
: NFSubstitution(_pos, _ruleSet, description, status)
- , divisor(_divisor)
+ , divisor(rule->getDivisor())
, ruleToUse(NULL)
{
- ldivisor = util64_fromDouble(_divisor);
-
// the owning rule's divisor controls the behavior of this
// substitution: rather than keeping a backpointer to the rule,
// we keep a copy of the divisor
- if (ldivisor == 0) {
+ if (divisor == 0) {
status = U_PARSE_ERROR;
}
diff --git a/deps/icu-small/source/i18n/nfsubs.h b/deps/icu-small/source/i18n/nfsubs.h
index 4fb0c06caf..e77f7ada8c 100644
--- a/deps/icu-small/source/i18n/nfsubs.h
+++ b/deps/icu-small/source/i18n/nfsubs.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfsubs.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -91,7 +91,7 @@ public:
* @param radix The radix of the divisor
* @param exponent The exponent of the divisor
*/
- virtual void setDivisor(int32_t radix, int32_t exponent, UErrorCode& status);
+ virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status);
/**
* Replaces result with the string describing the substitution.
diff --git a/deps/icu-small/source/i18n/nortrans.cpp b/deps/icu-small/source/i18n/nortrans.cpp
index da0206776c..589c82482e 100644
--- a/deps/icu-small/source/i18n/nortrans.cpp
+++ b/deps/icu-small/source/i18n/nortrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/nortrans.h b/deps/icu-small/source/i18n/nortrans.h
index 79d1be3b07..d309452f9a 100644
--- a/deps/icu-small/source/i18n/nortrans.h
+++ b/deps/icu-small/source/i18n/nortrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/nultrans.cpp b/deps/icu-small/source/i18n/nultrans.cpp
index 600873e373..62d1290ac7 100644
--- a/deps/icu-small/source/i18n/nultrans.cpp
+++ b/deps/icu-small/source/i18n/nultrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/nultrans.h b/deps/icu-small/source/i18n/nultrans.h
index a9856bde5b..a01b04e9ba 100644
--- a/deps/icu-small/source/i18n/nultrans.h
+++ b/deps/icu-small/source/i18n/nultrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/numfmt.cpp b/deps/icu-small/source/i18n/numfmt.cpp
index c00955a781..90c53ce390 100644
--- a/deps/icu-small/source/i18n/numfmt.cpp
+++ b/deps/icu-small/source/i18n/numfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -529,7 +529,7 @@ UnicodeString& NumberFormat::format(const DigitList &number,
FieldPositionIterator* posIter,
UErrorCode& status) const {
// DecimalFormat overrides this function, and handles DigitList based big decimals.
- // Other subclasses (ChoiceFormat, RuleBasedNumberFormat) do not (yet) handle DigitLists,
+ // Other subclasses (ChoiceFormat) do not (yet) handle DigitLists,
// so this default implementation falls back to formatting decimal numbers as doubles.
if (U_FAILURE(status)) {
return appendTo;
@@ -547,7 +547,7 @@ NumberFormat::format(const DigitList &number,
FieldPosition& pos,
UErrorCode &status) const {
// DecimalFormat overrides this function, and handles DigitList based big decimals.
- // Other subclasses (ChoiceFormat, RuleBasedNumberFormat) do not (yet) handle DigitLists,
+ // Other subclasses (ChoiceFormat) do not (yet) handle DigitLists,
// so this default implementation falls back to formatting decimal numbers as doubles.
if (U_FAILURE(status)) {
return appendTo;
@@ -1188,7 +1188,7 @@ void NumberFormat::setCurrency(const UChar* theCurrency, UErrorCode& ec) {
}
}
-const UChar* NumberFormat::getCurrency() const {
+const char16_t* NumberFormat::getCurrency() const {
return fCurrency;
}
diff --git a/deps/icu-small/source/i18n/numsys.cpp b/deps/icu-small/source/i18n/numsys.cpp
index 442ad7f255..b24340f0d2 100644
--- a/deps/icu-small/source/i18n/numsys.cpp
+++ b/deps/icu-small/source/i18n/numsys.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -230,7 +230,7 @@ void NumberingSystem::setAlgorithmic(UBool c) {
algorithmic = c;
}
-void NumberingSystem::setDesc(UnicodeString d) {
+void NumberingSystem::setDesc(const UnicodeString &d) {
desc.setTo(d);
}
void NumberingSystem::setName(const char *n) {
diff --git a/deps/icu-small/source/i18n/numsys_impl.h b/deps/icu-small/source/i18n/numsys_impl.h
index d39faba5af..6385fa5408 100644
--- a/deps/icu-small/source/i18n/numsys_impl.h
+++ b/deps/icu-small/source/i18n/numsys_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/olsontz.cpp b/deps/icu-small/source/i18n/olsontz.cpp
index f4c3dd24c9..df025c0808 100644
--- a/deps/icu-small/source/i18n/olsontz.cpp
+++ b/deps/icu-small/source/i18n/olsontz.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/olsontz.h b/deps/icu-small/source/i18n/olsontz.h
index 7dbc303a05..6f0d36e5de 100644
--- a/deps/icu-small/source/i18n/olsontz.h
+++ b/deps/icu-small/source/i18n/olsontz.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/persncal.cpp b/deps/icu-small/source/i18n/persncal.cpp
index 210646ca8c..0ccff4d2bd 100644
--- a/deps/icu-small/source/i18n/persncal.cpp
+++ b/deps/icu-small/source/i18n/persncal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/persncal.h b/deps/icu-small/source/i18n/persncal.h
index 3fe5a61464..ec818822b3 100644
--- a/deps/icu-small/source/i18n/persncal.h
+++ b/deps/icu-small/source/i18n/persncal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/pluralaffix.cpp b/deps/icu-small/source/i18n/pluralaffix.cpp
index f6a51a79ef..ea400206b3 100644
--- a/deps/icu-small/source/i18n/pluralaffix.cpp
+++ b/deps/icu-small/source/i18n/pluralaffix.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/pluralaffix.h b/deps/icu-small/source/i18n/pluralaffix.h
index a08f2131d9..94366ce4cf 100644
--- a/deps/icu-small/source/i18n/pluralaffix.h
+++ b/deps/icu-small/source/i18n/pluralaffix.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/plurfmt.cpp b/deps/icu-small/source/i18n/plurfmt.cpp
index 8a000ce6e9..e14ef6d831 100644
--- a/deps/icu-small/source/i18n/plurfmt.cpp
+++ b/deps/icu-small/source/i18n/plurfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/plurrule.cpp b/deps/icu-small/source/i18n/plurrule.cpp
index 7b50634551..08ea969b5a 100644
--- a/deps/icu-small/source/i18n/plurrule.cpp
+++ b/deps/icu-small/source/i18n/plurrule.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -17,6 +17,8 @@
#include "unicode/plurrule.h"
#include "unicode/upluralrules.h"
#include "unicode/ures.h"
+#include "unicode/numfmt.h"
+#include "unicode/decimfmt.h"
#include "charstr.h"
#include "cmemory.h"
#include "cstring.h"
@@ -36,7 +38,6 @@
#include "digitinterval.h"
#include "visibledigits.h"
-
#if !UCONFIG_NO_FORMATTING
U_NAMESPACE_BEGIN
@@ -247,6 +248,26 @@ PluralRules::select(double number) const {
}
UnicodeString
+PluralRules::select(const Formattable& obj, const NumberFormat& fmt, UErrorCode& status) const {
+ if (U_SUCCESS(status)) {
+ const DecimalFormat *decFmt = dynamic_cast<const DecimalFormat *>(&fmt);
+ if (decFmt != NULL) {
+ VisibleDigitsWithExponent digits;
+ decFmt->initVisibleDigitsWithExponent(obj, digits, status);
+ if (U_SUCCESS(status)) {
+ return select(digits);
+ }
+ } else {
+ double number = obj.getDouble(status);
+ if (U_SUCCESS(status)) {
+ return select(number);
+ }
+ }
+ }
+ return UnicodeString();
+}
+
+UnicodeString
PluralRules::select(const FixedDecimal &number) const {
if (mRules == NULL) {
return UnicodeString(TRUE, PLURAL_DEFAULT_RULE, -1);
diff --git a/deps/icu-small/source/i18n/plurrule_impl.h b/deps/icu-small/source/i18n/plurrule_impl.h
index c6e4767a09..9f5f66c1b7 100644
--- a/deps/icu-small/source/i18n/plurrule_impl.h
+++ b/deps/icu-small/source/i18n/plurrule_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -24,6 +24,7 @@
#include "unicode/format.h"
#include "unicode/locid.h"
#include "unicode/parseerr.h"
+#include "unicode/strenum.h"
#include "unicode/ures.h"
#include "uvector.h"
#include "hash.h"
diff --git a/deps/icu-small/source/i18n/precision.cpp b/deps/icu-small/source/i18n/precision.cpp
index 5d07e0f9ee..4a68b0d886 100644
--- a/deps/icu-small/source/i18n/precision.cpp
+++ b/deps/icu-small/source/i18n/precision.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/precision.h b/deps/icu-small/source/i18n/precision.h
index f002fd228b..0598fa17d6 100644
--- a/deps/icu-small/source/i18n/precision.h
+++ b/deps/icu-small/source/i18n/precision.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/quant.cpp b/deps/icu-small/source/i18n/quant.cpp
index 6e08e628fc..1908a50484 100644
--- a/deps/icu-small/source/i18n/quant.cpp
+++ b/deps/icu-small/source/i18n/quant.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/quant.h b/deps/icu-small/source/i18n/quant.h
index 21adf19e70..1abb0db61a 100644
--- a/deps/icu-small/source/i18n/quant.h
+++ b/deps/icu-small/source/i18n/quant.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/quantityformatter.cpp b/deps/icu-small/source/i18n/quantityformatter.cpp
index c44357a53b..208e064700 100644
--- a/deps/icu-small/source/i18n/quantityformatter.cpp
+++ b/deps/icu-small/source/i18n/quantityformatter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/quantityformatter.h b/deps/icu-small/source/i18n/quantityformatter.h
index 0f61022666..6698b7a8a0 100644
--- a/deps/icu-small/source/i18n/quantityformatter.h
+++ b/deps/icu-small/source/i18n/quantityformatter.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/rbnf.cpp b/deps/icu-small/source/i18n/rbnf.cpp
index 5e32d80444..d4fd574998 100644
--- a/deps/icu-small/source/i18n/rbnf.cpp
+++ b/deps/icu-small/source/i18n/rbnf.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -27,12 +27,14 @@
#include "unicode/udata.h"
#include "unicode/udisplaycontext.h"
#include "unicode/brkiter.h"
-#include "nfrs.h"
+#include "unicode/ucasemap.h"
#include "cmemory.h"
#include "cstring.h"
#include "patternprops.h"
#include "uresimp.h"
+#include "nfrs.h"
+#include "digitlst.h"
// debugging
// #define RBNF_DEBUG
@@ -1079,17 +1081,76 @@ RuleBasedNumberFormat::findRuleSet(const UnicodeString& name, UErrorCode& status
}
UnicodeString&
+RuleBasedNumberFormat::format(const DigitList &number,
+ UnicodeString &appendTo,
+ FieldPositionIterator *posIter,
+ UErrorCode &status) const {
+ if (U_FAILURE(status)) {
+ return appendTo;
+ }
+ DigitList copy(number);
+ if (copy.fitsIntoInt64(false)) {
+ format(((DigitList &)number).getInt64(), appendTo, posIter, status);
+ }
+ else {
+ copy.roundAtExponent(0);
+ if (copy.fitsIntoInt64(false)) {
+ format(number.getDouble(), appendTo, posIter, status);
+ }
+ else {
+ // We're outside of our normal range that this framework can handle.
+ // The DecimalFormat will provide more accurate results.
+
+ // TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J.
+ NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status);
+ Formattable f;
+ f.adoptDigitList(new DigitList(number));
+ decimalFormat->format(f, appendTo, posIter, status);
+ delete decimalFormat;
+ }
+ }
+ return appendTo;
+}
+
+
+UnicodeString&
+RuleBasedNumberFormat::format(const DigitList &number,
+ UnicodeString& appendTo,
+ FieldPosition& pos,
+ UErrorCode &status) const {
+ if (U_FAILURE(status)) {
+ return appendTo;
+ }
+ DigitList copy(number);
+ if (copy.fitsIntoInt64(false)) {
+ format(((DigitList &)number).getInt64(), appendTo, pos, status);
+ }
+ else {
+ copy.roundAtExponent(0);
+ if (copy.fitsIntoInt64(false)) {
+ format(number.getDouble(), appendTo, pos, status);
+ }
+ else {
+ // We're outside of our normal range that this framework can handle.
+ // The DecimalFormat will provide more accurate results.
+
+ // TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J.
+ NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status);
+ Formattable f;
+ f.adoptDigitList(new DigitList(number));
+ decimalFormat->format(f, appendTo, pos, status);
+ delete decimalFormat;
+ }
+ }
+ return appendTo;
+}
+
+UnicodeString&
RuleBasedNumberFormat::format(int32_t number,
UnicodeString& toAppendTo,
- FieldPosition& /* pos */) const
+ FieldPosition& pos) const
{
- if (defaultRuleSet) {
- UErrorCode status = U_ZERO_ERROR;
- int32_t startPos = toAppendTo.length();
- defaultRuleSet->format((int64_t)number, toAppendTo, toAppendTo.length(), 0, status);
- adjustForCapitalizationContext(startPos, toAppendTo);
- }
- return toAppendTo;
+ return format((int64_t)number, toAppendTo, pos);
}
@@ -1100,9 +1161,7 @@ RuleBasedNumberFormat::format(int64_t number,
{
if (defaultRuleSet) {
UErrorCode status = U_ZERO_ERROR;
- int32_t startPos = toAppendTo.length();
- defaultRuleSet->format(number, toAppendTo, toAppendTo.length(), 0, status);
- adjustForCapitalizationContext(startPos, toAppendTo);
+ format(number, defaultRuleSet, toAppendTo, status);
}
return toAppendTo;
}
@@ -1114,11 +1173,11 @@ RuleBasedNumberFormat::format(double number,
FieldPosition& /* pos */) const
{
int32_t startPos = toAppendTo.length();
+ UErrorCode status = U_ZERO_ERROR;
if (defaultRuleSet) {
- UErrorCode status = U_ZERO_ERROR;
defaultRuleSet->format(number, toAppendTo, toAppendTo.length(), 0, status);
}
- return adjustForCapitalizationContext(startPos, toAppendTo);
+ return adjustForCapitalizationContext(startPos, toAppendTo, status);
}
@@ -1126,24 +1185,10 @@ UnicodeString&
RuleBasedNumberFormat::format(int32_t number,
const UnicodeString& ruleSetName,
UnicodeString& toAppendTo,
- FieldPosition& /* pos */,
+ FieldPosition& pos,
UErrorCode& status) const
{
- // return format((int64_t)number, ruleSetName, toAppendTo, pos, status);
- if (U_SUCCESS(status)) {
- if (ruleSetName.indexOf(gPercentPercent, 2, 0) == 0) {
- // throw new IllegalArgumentException("Can't use internal rule set");
- status = U_ILLEGAL_ARGUMENT_ERROR;
- } else {
- NFRuleSet *rs = findRuleSet(ruleSetName, status);
- if (rs) {
- int32_t startPos = toAppendTo.length();
- rs->format((int64_t)number, toAppendTo, toAppendTo.length(), 0, status);
- adjustForCapitalizationContext(startPos, toAppendTo);
- }
- }
- }
- return toAppendTo;
+ return format((int64_t)number, ruleSetName, toAppendTo, pos, status);
}
@@ -1161,9 +1206,7 @@ RuleBasedNumberFormat::format(int64_t number,
} else {
NFRuleSet *rs = findRuleSet(ruleSetName, status);
if (rs) {
- int32_t startPos = toAppendTo.length();
- rs->format(number, toAppendTo, toAppendTo.length(), 0, status);
- adjustForCapitalizationContext(startPos, toAppendTo);
+ format(number, rs, toAppendTo, status);
}
}
}
@@ -1187,27 +1230,72 @@ RuleBasedNumberFormat::format(double number,
if (rs) {
int32_t startPos = toAppendTo.length();
rs->format(number, toAppendTo, toAppendTo.length(), 0, status);
- adjustForCapitalizationContext(startPos, toAppendTo);
+ adjustForCapitalizationContext(startPos, toAppendTo, status);
}
}
}
return toAppendTo;
}
+/**
+ * Bottleneck through which all the public format() methods
+ * that take a long pass. By the time we get here, we know
+ * which rule set we're using to do the formatting.
+ * @param number The number to format
+ * @param ruleSet The rule set to use to format the number
+ * @return The text that resulted from formatting the number
+ */
+UnicodeString&
+RuleBasedNumberFormat::format(int64_t number, NFRuleSet *ruleSet, UnicodeString& toAppendTo, UErrorCode& status) const
+{
+ // all API format() routines that take a double vector through
+ // here. We have these two identical functions-- one taking a
+ // double and one taking a long-- the couple digits of precision
+ // that long has but double doesn't (both types are 8 bytes long,
+ // but double has to borrow some of the mantissa bits to hold
+ // the exponent).
+ // Create an empty string buffer where the result will
+ // be built, and pass it to the rule set (along with an insertion
+ // position of 0 and the number being formatted) to the rule set
+ // for formatting
+
+ if (U_SUCCESS(status)) {
+ if (number == U_INT64_MIN) {
+ // We can't handle this value right now. Provide an accurate default value.
+
+ // TODO this section should probably be optimized. The DecimalFormat is shared in ICU4J.
+ NumberFormat *decimalFormat = NumberFormat::createInstance(locale, UNUM_DECIMAL, status);
+ Formattable f;
+ FieldPosition pos(FieldPosition::DONT_CARE);
+ DigitList *digitList = new DigitList();
+ digitList->set(number);
+ f.adoptDigitList(digitList);
+ decimalFormat->format(f, toAppendTo, pos, status);
+ delete decimalFormat;
+ }
+ else {
+ int32_t startPos = toAppendTo.length();
+ ruleSet->format(number, toAppendTo, toAppendTo.length(), 0, status);
+ adjustForCapitalizationContext(startPos, toAppendTo, status);
+ }
+ }
+ return toAppendTo;
+}
+
UnicodeString&
RuleBasedNumberFormat::adjustForCapitalizationContext(int32_t startPos,
- UnicodeString& currentResult) const
+ UnicodeString& currentResult,
+ UErrorCode& status) const
{
#if !UCONFIG_NO_BREAK_ITERATION
- if (startPos==0 && currentResult.length() > 0) {
+ UDisplayContext capitalizationContext = getContext(UDISPCTX_TYPE_CAPITALIZATION, status);
+ if (capitalizationContext != UDISPCTX_CAPITALIZATION_NONE && startPos == 0 && currentResult.length() > 0) {
// capitalize currentResult according to context
UChar32 ch = currentResult.char32At(0);
- UErrorCode status = U_ZERO_ERROR;
- UDisplayContext capitalizationContext = getContext(UDISPCTX_TYPE_CAPITALIZATION, status);
- if ( u_islower(ch) && U_SUCCESS(status) && capitalizationBrkIter!= NULL &&
- ( capitalizationContext==UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE ||
- (capitalizationContext==UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU && capitalizationForUIListMenu) ||
- (capitalizationContext==UDISPCTX_CAPITALIZATION_FOR_STANDALONE && capitalizationForStandAlone)) ) {
+ if (u_islower(ch) && U_SUCCESS(status) && capitalizationBrkIter != NULL &&
+ ( capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE ||
+ (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU && capitalizationForUIListMenu) ||
+ (capitalizationContext == UDISPCTX_CAPITALIZATION_FOR_STANDALONE && capitalizationForStandAlone)) ) {
// titlecase first word of currentResult, here use sentence iterator unlike current implementations
// in LocaleDisplayNamesImpl::adjustForUsageAndContext and RelativeDateFormat::format
currentResult.toTitle(capitalizationBrkIter, locale, U_TITLECASE_NO_LOWERCASE | U_TITLECASE_NO_BREAK_ADJUSTMENT);
diff --git a/deps/icu-small/source/i18n/rbt.cpp b/deps/icu-small/source/i18n/rbt.cpp
index 62aae52f18..0444729b25 100644
--- a/deps/icu-small/source/i18n/rbt.cpp
+++ b/deps/icu-small/source/i18n/rbt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt.h b/deps/icu-small/source/i18n/rbt.h
index 9add715aca..005fb85384 100644
--- a/deps/icu-small/source/i18n/rbt.h
+++ b/deps/icu-small/source/i18n/rbt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_data.cpp b/deps/icu-small/source/i18n/rbt_data.cpp
index 1b6163956c..7a9707b988 100644
--- a/deps/icu-small/source/i18n/rbt_data.cpp
+++ b/deps/icu-small/source/i18n/rbt_data.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_data.h b/deps/icu-small/source/i18n/rbt_data.h
index 29e39a59ef..52a961dde0 100644
--- a/deps/icu-small/source/i18n/rbt_data.h
+++ b/deps/icu-small/source/i18n/rbt_data.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_pars.cpp b/deps/icu-small/source/i18n/rbt_pars.cpp
index 5e7c0ff5f9..8e49a8473a 100644
--- a/deps/icu-small/source/i18n/rbt_pars.cpp
+++ b/deps/icu-small/source/i18n/rbt_pars.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_pars.h b/deps/icu-small/source/i18n/rbt_pars.h
index 48067905b9..d51f2e852b 100644
--- a/deps/icu-small/source/i18n/rbt_pars.h
+++ b/deps/icu-small/source/i18n/rbt_pars.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_rule.cpp b/deps/icu-small/source/i18n/rbt_rule.cpp
index a04a535f0e..db02f76035 100644
--- a/deps/icu-small/source/i18n/rbt_rule.cpp
+++ b/deps/icu-small/source/i18n/rbt_rule.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_rule.h b/deps/icu-small/source/i18n/rbt_rule.h
index b25afd6ef0..eb8556df0c 100644
--- a/deps/icu-small/source/i18n/rbt_rule.h
+++ b/deps/icu-small/source/i18n/rbt_rule.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) {1999-2001}, International Business Machines Corporation and others. All Rights Reserved.
diff --git a/deps/icu-small/source/i18n/rbt_set.cpp b/deps/icu-small/source/i18n/rbt_set.cpp
index f2c78ca9c8..939c0ea39a 100644
--- a/deps/icu-small/source/i18n/rbt_set.cpp
+++ b/deps/icu-small/source/i18n/rbt_set.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbt_set.h b/deps/icu-small/source/i18n/rbt_set.h
index ed76e6ddf7..9b2b8b38db 100644
--- a/deps/icu-small/source/i18n/rbt_set.h
+++ b/deps/icu-small/source/i18n/rbt_set.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/rbtz.cpp b/deps/icu-small/source/i18n/rbtz.cpp
index fb458dd502..951073abc5 100644
--- a/deps/icu-small/source/i18n/rbtz.cpp
+++ b/deps/icu-small/source/i18n/rbtz.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/regexcmp.cpp b/deps/icu-small/source/i18n/regexcmp.cpp
index d0e166cfa4..6cfa61f187 100644
--- a/deps/icu-small/source/i18n/regexcmp.cpp
+++ b/deps/icu-small/source/i18n/regexcmp.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// file: regexcmp.cpp
@@ -2637,6 +2637,16 @@ void RegexCompile::findCaseInsensitiveStarters(UChar32 c, UnicodeSet *starterCh
}
+// Increment with overflow check.
+// val and delta will both be positive.
+
+static int32_t safeIncrement(int32_t val, int32_t delta) {
+ if (INT32_MAX - val > delta) {
+ return val + delta;
+ } else {
+ return INT32_MAX;
+ }
+}
//------------------------------------------------------------------------------
@@ -2737,7 +2747,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->add(URX_VAL(op));
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2750,7 +2760,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(*s);
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2787,7 +2797,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(*s);
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2802,7 +2812,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(sc);
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2819,7 +2829,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(s);
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2836,7 +2846,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(s);
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2855,7 +2865,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(s);
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2879,7 +2889,7 @@ void RegexCompile::matchStartType() {
}
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2895,7 +2905,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->complement();
numInitialStrings += 2;
}
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
atStart = FALSE;
break;
@@ -2975,7 +2985,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialStringLen = stringLen;
}
- currentLen += stringLen;
+ currentLen = safeIncrement(currentLen, stringLen);
atStart = FALSE;
}
break;
@@ -3000,7 +3010,7 @@ void RegexCompile::matchStartType() {
fRXPat->fInitialChars->addAll(s);
numInitialStrings += 2; // Matching on an initial string not possible.
}
- currentLen += stringLen;
+ currentLen = safeIncrement(currentLen, stringLen);
atStart = FALSE;
}
break;
@@ -3258,7 +3268,7 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) {
case URX_DOTANY_ALL: // . matches one or two.
case URX_DOTANY:
case URX_DOTANY_UNIX:
- currentLen++;
+ currentLen = safeIncrement(currentLen, 1);
break;
@@ -3310,7 +3320,7 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) {
{
loc++;
int32_t stringLenOp = (int32_t)fRXPat->fCompiledPat->elementAti(loc);
- currentLen += URX_VAL(stringLenOp);
+ currentLen = safeIncrement(currentLen, URX_VAL(stringLenOp));
}
break;
@@ -3323,7 +3333,7 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) {
// Assume a min length of one for now. A min length of zero causes
// optimization failures for a pattern like "string"+
// currentLen += URX_VAL(stringLenOp);
- currentLen += 1;
+ currentLen = safeIncrement(currentLen, 1);
}
break;
@@ -3433,18 +3443,6 @@ int32_t RegexCompile::minMatchLength(int32_t start, int32_t end) {
return currentLen;
}
-// Increment with overflow check.
-// val and delta will both be positive.
-
-static int32_t safeIncrement(int32_t val, int32_t delta) {
- if (INT32_MAX - val > delta) {
- return val + delta;
- } else {
- return INT32_MAX;
- }
-}
-
-
//------------------------------------------------------------------------------
//
// maxMatchLength Calculate the length of the longest string that could
diff --git a/deps/icu-small/source/i18n/regexcmp.h b/deps/icu-small/source/i18n/regexcmp.h
index 931f2387b5..85b7586793 100644
--- a/deps/icu-small/source/i18n/regexcmp.h
+++ b/deps/icu-small/source/i18n/regexcmp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// regexcmp.h
diff --git a/deps/icu-small/source/i18n/regexcst.h b/deps/icu-small/source/i18n/regexcst.h
index 259b44f5dd..a07d85a277 100644
--- a/deps/icu-small/source/i18n/regexcst.h
+++ b/deps/icu-small/source/i18n/regexcst.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//---------------------------------------------------------------------------------
//
diff --git a/deps/icu-small/source/i18n/regeximp.cpp b/deps/icu-small/source/i18n/regeximp.cpp
index c1360ebf6c..454e7f836b 100644
--- a/deps/icu-small/source/i18n/regeximp.cpp
+++ b/deps/icu-small/source/i18n/regeximp.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// Copyright (C) 2012 International Business Machines Corporation
@@ -19,8 +19,7 @@
U_NAMESPACE_BEGIN
CaseFoldingUTextIterator::CaseFoldingUTextIterator(UText &text) :
- fUText(text), fcsp(NULL), fFoldChars(NULL), fFoldLength(0) {
- fcsp = ucase_getSingleton();
+ fUText(text), fFoldChars(NULL), fFoldLength(0) {
}
CaseFoldingUTextIterator::~CaseFoldingUTextIterator() {}
@@ -35,7 +34,7 @@ UChar32 CaseFoldingUTextIterator::next() {
if (originalC == U_SENTINEL) {
return originalC;
}
- fFoldLength = ucase_toFullFolding(fcsp, originalC, &fFoldChars, U_FOLD_CASE_DEFAULT);
+ fFoldLength = ucase_toFullFolding(originalC, &fFoldChars, U_FOLD_CASE_DEFAULT);
if (fFoldLength >= UCASE_MAX_STRING_LENGTH || fFoldLength < 0) {
// input code point folds to a single code point, possibly itself.
// See comment in ucase.h for explanation of return values from ucase_toFullFoldings.
@@ -65,8 +64,7 @@ UBool CaseFoldingUTextIterator::inExpansion() {
CaseFoldingUCharIterator::CaseFoldingUCharIterator(const UChar *chars, int64_t start, int64_t limit) :
- fChars(chars), fIndex(start), fLimit(limit), fcsp(NULL), fFoldChars(NULL), fFoldLength(0) {
- fcsp = ucase_getSingleton();
+ fChars(chars), fIndex(start), fLimit(limit), fFoldChars(NULL), fFoldLength(0) {
}
@@ -84,7 +82,7 @@ UChar32 CaseFoldingUCharIterator::next() {
}
U16_NEXT(fChars, fIndex, fLimit, originalC);
- fFoldLength = ucase_toFullFolding(fcsp, originalC, &fFoldChars, U_FOLD_CASE_DEFAULT);
+ fFoldLength = ucase_toFullFolding(originalC, &fFoldChars, U_FOLD_CASE_DEFAULT);
if (fFoldLength >= UCASE_MAX_STRING_LENGTH || fFoldLength < 0) {
// input code point folds to a single code point, possibly itself.
// See comment in ucase.h for explanation of return values from ucase_toFullFoldings.
diff --git a/deps/icu-small/source/i18n/regeximp.h b/deps/icu-small/source/i18n/regeximp.h
index 0261c58c63..da4a861bde 100644
--- a/deps/icu-small/source/i18n/regeximp.h
+++ b/deps/icu-small/source/i18n/regeximp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// Copyright (C) 2002-2015 International Business Machines Corporation
@@ -374,7 +374,6 @@ class CaseFoldingUTextIterator: public UMemory {
// folding of the same code point from the orignal UText.
private:
UText &fUText;
- const UCaseProps *fcsp;
const UChar *fFoldChars;
int32_t fFoldLength;
int32_t fFoldIndex;
@@ -404,7 +403,6 @@ class CaseFoldingUCharIterator: public UMemory {
const UChar *fChars;
int64_t fIndex;
int64_t fLimit;
- const UCaseProps *fcsp;
const UChar *fFoldChars;
int32_t fFoldLength;
int32_t fFoldIndex;
diff --git a/deps/icu-small/source/i18n/regexst.cpp b/deps/icu-small/source/i18n/regexst.cpp
index a8feffa1bd..ad74ee508e 100644
--- a/deps/icu-small/source/i18n/regexst.cpp
+++ b/deps/icu-small/source/i18n/regexst.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// regexst.h
diff --git a/deps/icu-small/source/i18n/regexst.h b/deps/icu-small/source/i18n/regexst.h
index 21f7ec945c..f0696c25a3 100644
--- a/deps/icu-small/source/i18n/regexst.h
+++ b/deps/icu-small/source/i18n/regexst.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// regexst.h
diff --git a/deps/icu-small/source/i18n/regextxt.cpp b/deps/icu-small/source/i18n/regextxt.cpp
index d6157f5ed6..41bb4a944b 100644
--- a/deps/icu-small/source/i18n/regextxt.cpp
+++ b/deps/icu-small/source/i18n/regextxt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
diff --git a/deps/icu-small/source/i18n/regextxt.h b/deps/icu-small/source/i18n/regextxt.h
index c5651aefd4..9cfabbe415 100644
--- a/deps/icu-small/source/i18n/regextxt.h
+++ b/deps/icu-small/source/i18n/regextxt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
diff --git a/deps/icu-small/source/i18n/region.cpp b/deps/icu-small/source/i18n/region.cpp
index fdd467fc98..66f9ef35de 100644
--- a/deps/icu-small/source/i18n/region.cpp
+++ b/deps/icu-small/source/i18n/region.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/region_impl.h b/deps/icu-small/source/i18n/region_impl.h
index 852209603b..c0702af7df 100644
--- a/deps/icu-small/source/i18n/region_impl.h
+++ b/deps/icu-small/source/i18n/region_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/reldatefmt.cpp b/deps/icu-small/source/i18n/reldatefmt.cpp
index 7009b190a2..18c073b9ee 100644
--- a/deps/icu-small/source/i18n/reldatefmt.cpp
+++ b/deps/icu-small/source/i18n/reldatefmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -15,6 +15,7 @@
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
#include "unicode/dtfmtsym.h"
+#include "unicode/ucasemap.h"
#include "unicode/ureldatefmt.h"
#include "unicode/udisplaycontext.h"
#include "unicode/unum.h"
diff --git a/deps/icu-small/source/i18n/reldtfmt.cpp b/deps/icu-small/source/i18n/reldtfmt.cpp
index 4a92869535..d3ab45dc63 100644
--- a/deps/icu-small/source/i18n/reldtfmt.cpp
+++ b/deps/icu-small/source/i18n/reldtfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -20,7 +20,7 @@
#include "unicode/udisplaycontext.h"
#include "unicode/uchar.h"
#include "unicode/brkiter.h"
-
+#include "unicode/ucasemap.h"
#include "reldtfmt.h"
#include "cmemory.h"
#include "uresimp.h"
diff --git a/deps/icu-small/source/i18n/reldtfmt.h b/deps/icu-small/source/i18n/reldtfmt.h
index ea091a91c3..5063a6388f 100644
--- a/deps/icu-small/source/i18n/reldtfmt.h
+++ b/deps/icu-small/source/i18n/reldtfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/rematch.cpp b/deps/icu-small/source/i18n/rematch.cpp
index 5a5bb80e05..e3fdff7484 100644
--- a/deps/icu-small/source/i18n/rematch.cpp
+++ b/deps/icu-small/source/i18n/rematch.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**************************************************************************
@@ -3566,7 +3566,14 @@ GC_Done:
}
}
fp = StateSave(fp, fp->fPatIdx, status);
+ } else {
+ // Increment time-out counter. (StateSave() does it if count >= minCount)
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
}
+
fp->fPatIdx = opValue + 4; // Loop back.
}
break;
@@ -3623,6 +3630,11 @@ GC_Done:
// We haven't met the minimum number of matches yet.
// Loop back for another one.
fp->fPatIdx = opValue + 4; // Loop back.
+ // Increment time-out counter. (StateSave() does it if count >= minCount)
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
} else {
// We do have the minimum number of matches.
@@ -5099,6 +5111,12 @@ GC_Done:
}
}
fp = StateSave(fp, fp->fPatIdx, status);
+ } else {
+ // Increment time-out counter. (StateSave() does it if count >= minCount)
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
}
fp->fPatIdx = opValue + 4; // Loop back.
}
@@ -5156,6 +5174,10 @@ GC_Done:
// We haven't met the minimum number of matches yet.
// Loop back for another one.
fp->fPatIdx = opValue + 4; // Loop back.
+ fTickCounter--;
+ if (fTickCounter <= 0) {
+ IncrementTime(status); // Re-initializes fTickCounter
+ }
} else {
// We do have the minimum number of matches.
diff --git a/deps/icu-small/source/i18n/remtrans.cpp b/deps/icu-small/source/i18n/remtrans.cpp
index 89837f991d..70a6ed3935 100644
--- a/deps/icu-small/source/i18n/remtrans.cpp
+++ b/deps/icu-small/source/i18n/remtrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/remtrans.h b/deps/icu-small/source/i18n/remtrans.h
index a5635781f9..ed038d5f2f 100644
--- a/deps/icu-small/source/i18n/remtrans.h
+++ b/deps/icu-small/source/i18n/remtrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/repattrn.cpp b/deps/icu-small/source/i18n/repattrn.cpp
index b792ca0484..b03873066c 100644
--- a/deps/icu-small/source/i18n/repattrn.cpp
+++ b/deps/icu-small/source/i18n/repattrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// file: repattrn.cpp
diff --git a/deps/icu-small/source/i18n/rulebasedcollator.cpp b/deps/icu-small/source/i18n/rulebasedcollator.cpp
index 4852667ada..ab65f10a3b 100644
--- a/deps/icu-small/source/i18n/rulebasedcollator.cpp
+++ b/deps/icu-small/source/i18n/rulebasedcollator.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/scientificnumberformatter.cpp b/deps/icu-small/source/i18n/scientificnumberformatter.cpp
index 56a43f9b7f..adf032d989 100644
--- a/deps/icu-small/source/i18n/scientificnumberformatter.cpp
+++ b/deps/icu-small/source/i18n/scientificnumberformatter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/scriptset.cpp b/deps/icu-small/source/i18n/scriptset.cpp
index 951fe44080..9358e63b9e 100644
--- a/deps/icu-small/source/i18n/scriptset.cpp
+++ b/deps/icu-small/source/i18n/scriptset.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/scriptset.h b/deps/icu-small/source/i18n/scriptset.h
index e8de3b9613..385c3e3e53 100644
--- a/deps/icu-small/source/i18n/scriptset.h
+++ b/deps/icu-small/source/i18n/scriptset.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/search.cpp b/deps/icu-small/source/i18n/search.cpp
index 77323cc664..baf879414b 100644
--- a/deps/icu-small/source/i18n/search.cpp
+++ b/deps/icu-small/source/i18n/search.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/selfmt.cpp b/deps/icu-small/source/i18n/selfmt.cpp
index 041fea515c..29aee36457 100644
--- a/deps/icu-small/source/i18n/selfmt.cpp
+++ b/deps/icu-small/source/i18n/selfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
diff --git a/deps/icu-small/source/i18n/selfmtimpl.h b/deps/icu-small/source/i18n/selfmtimpl.h
index 75bc3e343a..74d6dc2181 100644
--- a/deps/icu-small/source/i18n/selfmtimpl.h
+++ b/deps/icu-small/source/i18n/selfmtimpl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
diff --git a/deps/icu-small/source/i18n/sharedbreakiterator.cpp b/deps/icu-small/source/i18n/sharedbreakiterator.cpp
index ca962c6283..82f482bdd7 100644
--- a/deps/icu-small/source/i18n/sharedbreakiterator.cpp
+++ b/deps/icu-small/source/i18n/sharedbreakiterator.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/sharedbreakiterator.h b/deps/icu-small/source/i18n/sharedbreakiterator.h
index 58be1f6a76..b6d67bc8e8 100644
--- a/deps/icu-small/source/i18n/sharedbreakiterator.h
+++ b/deps/icu-small/source/i18n/sharedbreakiterator.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/sharedcalendar.h b/deps/icu-small/source/i18n/sharedcalendar.h
index f6d97b55bc..1526f92e88 100644
--- a/deps/icu-small/source/i18n/sharedcalendar.h
+++ b/deps/icu-small/source/i18n/sharedcalendar.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/shareddateformatsymbols.h b/deps/icu-small/source/i18n/shareddateformatsymbols.h
index a11a8a391b..ca9a210819 100644
--- a/deps/icu-small/source/i18n/shareddateformatsymbols.h
+++ b/deps/icu-small/source/i18n/shareddateformatsymbols.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/sharednumberformat.h b/deps/icu-small/source/i18n/sharednumberformat.h
index fcb618a4d4..a7e105b5ac 100644
--- a/deps/icu-small/source/i18n/sharednumberformat.h
+++ b/deps/icu-small/source/i18n/sharednumberformat.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/sharedpluralrules.h b/deps/icu-small/source/i18n/sharedpluralrules.h
index faed6dea0e..28d8b25c14 100644
--- a/deps/icu-small/source/i18n/sharedpluralrules.h
+++ b/deps/icu-small/source/i18n/sharedpluralrules.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/significantdigitinterval.h b/deps/icu-small/source/i18n/significantdigitinterval.h
index 336af784a5..fc23370de5 100644
--- a/deps/icu-small/source/i18n/significantdigitinterval.h
+++ b/deps/icu-small/source/i18n/significantdigitinterval.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/simpletz.cpp b/deps/icu-small/source/i18n/simpletz.cpp
index 7dadef5ae6..557b02620b 100644
--- a/deps/icu-small/source/i18n/simpletz.cpp
+++ b/deps/icu-small/source/i18n/simpletz.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -1189,13 +1189,22 @@ SimpleTimeZone::initTransitionRules(UErrorCode& status) {
// Create a TimeZoneRule for initial time
if (firstStdStart < firstDstStart) {
initialRule = new InitialTimeZoneRule(tzid+UnicodeString(DST_STR), getRawOffset(), dstRule->getDSTSavings());
+ if (initialRule == NULL) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ deleteTransitionRules();
+ return;
+ }
firstTransition = new TimeZoneTransition(firstStdStart, *initialRule, *stdRule);
} else {
initialRule = new InitialTimeZoneRule(tzid+UnicodeString(STD_STR), getRawOffset(), 0);
+ if (initialRule == NULL) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ deleteTransitionRules();
+ return;
+ }
firstTransition = new TimeZoneTransition(firstDstStart, *initialRule, *dstRule);
}
- // Check for null pointers.
- if (initialRule == NULL || firstTransition == NULL) {
+ if (firstTransition == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
deleteTransitionRules();
return;
diff --git a/deps/icu-small/source/i18n/smallintformatter.cpp b/deps/icu-small/source/i18n/smallintformatter.cpp
index b96f6dad3b..0c56e38bd6 100644
--- a/deps/icu-small/source/i18n/smallintformatter.cpp
+++ b/deps/icu-small/source/i18n/smallintformatter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/smallintformatter.h b/deps/icu-small/source/i18n/smallintformatter.h
index 846d6b4054..3373a9c35f 100644
--- a/deps/icu-small/source/i18n/smallintformatter.h
+++ b/deps/icu-small/source/i18n/smallintformatter.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/smpdtfmt.cpp b/deps/icu-small/source/i18n/smpdtfmt.cpp
index 85cc162a11..3c0670446b 100644
--- a/deps/icu-small/source/i18n/smpdtfmt.cpp
+++ b/deps/icu-small/source/i18n/smpdtfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -48,6 +48,7 @@
#include "unicode/simpletz.h"
#include "unicode/rbtz.h"
#include "unicode/tzfmt.h"
+#include "unicode/ucasemap.h"
#include "unicode/utf16.h"
#include "unicode/vtzone.h"
#include "unicode/udisplaycontext.h"
@@ -64,6 +65,7 @@
#include <float.h>
#include "smpdtfst.h"
#include "sharednumberformat.h"
+#include "ucasemap_imp.h"
#include "ustr_imp.h"
#include "charstr.h"
#include "uvector.h"
diff --git a/deps/icu-small/source/i18n/smpdtfst.cpp b/deps/icu-small/source/i18n/smpdtfst.cpp
index 50980a99e4..ff0dec232d 100644
--- a/deps/icu-small/source/i18n/smpdtfst.cpp
+++ b/deps/icu-small/source/i18n/smpdtfst.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/smpdtfst.h b/deps/icu-small/source/i18n/smpdtfst.h
index 38ad558de2..ed8ce4371f 100644
--- a/deps/icu-small/source/i18n/smpdtfst.h
+++ b/deps/icu-small/source/i18n/smpdtfst.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -16,6 +16,7 @@
#ifndef SMPDTFST_H
#define SMPDTFST_H
+#include "unicode/uobject.h"
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
diff --git a/deps/icu-small/source/i18n/sortkey.cpp b/deps/icu-small/source/i18n/sortkey.cpp
index 68b0f062b8..fb030c4990 100644
--- a/deps/icu-small/source/i18n/sortkey.cpp
+++ b/deps/icu-small/source/i18n/sortkey.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/standardplural.cpp b/deps/icu-small/source/i18n/standardplural.cpp
index c39bae1ab1..0391034b3e 100644
--- a/deps/icu-small/source/i18n/standardplural.cpp
+++ b/deps/icu-small/source/i18n/standardplural.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/standardplural.h b/deps/icu-small/source/i18n/standardplural.h
index 56c63c347c..33e1d605f6 100644
--- a/deps/icu-small/source/i18n/standardplural.h
+++ b/deps/icu-small/source/i18n/standardplural.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/strmatch.cpp b/deps/icu-small/source/i18n/strmatch.cpp
index e72cfc9ab0..d5b018aa6b 100644
--- a/deps/icu-small/source/i18n/strmatch.cpp
+++ b/deps/icu-small/source/i18n/strmatch.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/strmatch.h b/deps/icu-small/source/i18n/strmatch.h
index 0241adfd3f..7152a24a07 100644
--- a/deps/icu-small/source/i18n/strmatch.h
+++ b/deps/icu-small/source/i18n/strmatch.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2001-2011, International Business Machines Corporation
diff --git a/deps/icu-small/source/i18n/strrepl.cpp b/deps/icu-small/source/i18n/strrepl.cpp
index d061eff579..132c844c2d 100644
--- a/deps/icu-small/source/i18n/strrepl.cpp
+++ b/deps/icu-small/source/i18n/strrepl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/strrepl.h b/deps/icu-small/source/i18n/strrepl.h
index a452db993f..feec058152 100644
--- a/deps/icu-small/source/i18n/strrepl.h
+++ b/deps/icu-small/source/i18n/strrepl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/stsearch.cpp b/deps/icu-small/source/i18n/stsearch.cpp
index 643ec21b27..bf4d80b6db 100644
--- a/deps/icu-small/source/i18n/stsearch.cpp
+++ b/deps/icu-small/source/i18n/stsearch.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/taiwncal.cpp b/deps/icu-small/source/i18n/taiwncal.cpp
index f1ca6fa135..e2757dbd55 100644
--- a/deps/icu-small/source/i18n/taiwncal.cpp
+++ b/deps/icu-small/source/i18n/taiwncal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/taiwncal.h b/deps/icu-small/source/i18n/taiwncal.h
index b15cff5beb..99bbfb53f2 100644
--- a/deps/icu-small/source/i18n/taiwncal.h
+++ b/deps/icu-small/source/i18n/taiwncal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/timezone.cpp b/deps/icu-small/source/i18n/timezone.cpp
index 427674aac4..e662bf7674 100644
--- a/deps/icu-small/source/i18n/timezone.cpp
+++ b/deps/icu-small/source/i18n/timezone.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/titletrn.cpp b/deps/icu-small/source/i18n/titletrn.cpp
index a1de8be666..4e75c824a0 100644
--- a/deps/icu-small/source/i18n/titletrn.cpp
+++ b/deps/icu-small/source/i18n/titletrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -97,7 +97,7 @@ void TitlecaseTransliterator::handleTransliterate(
int32_t start;
for (start = offsets.start - 1; start >= offsets.contextStart; start -= U16_LENGTH(c)) {
c = text.char32At(start);
- type=ucase_getTypeOrIgnorable(fCsp, c);
+ type=ucase_getTypeOrIgnorable(c);
if(type>0) { // cased
doTitle=FALSE;
break;
@@ -118,19 +118,19 @@ void TitlecaseTransliterator::handleTransliterate(
UnicodeString tmp;
const UChar *s;
- int32_t textPos, delta, result, locCache=0;
+ int32_t textPos, delta, result;
for(textPos=offsets.start; textPos<offsets.limit;) {
csc.cpStart=textPos;
c=text.char32At(textPos);
csc.cpLimit=textPos+=U16_LENGTH(c);
- type=ucase_getTypeOrIgnorable(fCsp, c);
+ type=ucase_getTypeOrIgnorable(c);
if(type>=0) { // not case-ignorable
if(doTitle) {
- result=ucase_toFullTitle(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache);
+ result=ucase_toFullTitle(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT);
} else {
- result=ucase_toFullLower(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache);
+ result=ucase_toFullLower(c, utrans_rep_caseContextIterator, &csc, &s, UCASE_LOC_ROOT);
}
doTitle = (UBool)(type==0); // doTitle=isUncased
diff --git a/deps/icu-small/source/i18n/titletrn.h b/deps/icu-small/source/i18n/titletrn.h
index a6380e3bd1..166378fe9d 100644
--- a/deps/icu-small/source/i18n/titletrn.h
+++ b/deps/icu-small/source/i18n/titletrn.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/tmunit.cpp b/deps/icu-small/source/i18n/tmunit.cpp
index d9da268125..ca308cca22 100644
--- a/deps/icu-small/source/i18n/tmunit.cpp
+++ b/deps/icu-small/source/i18n/tmunit.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tmutamt.cpp b/deps/icu-small/source/i18n/tmutamt.cpp
index 7be730765b..0e2b91fbb2 100644
--- a/deps/icu-small/source/i18n/tmutamt.cpp
+++ b/deps/icu-small/source/i18n/tmutamt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tmutfmt.cpp b/deps/icu-small/source/i18n/tmutfmt.cpp
index 1669546f76..50dac8b7ce 100644
--- a/deps/icu-small/source/i18n/tmutfmt.cpp
+++ b/deps/icu-small/source/i18n/tmutfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tolowtrn.cpp b/deps/icu-small/source/i18n/tolowtrn.cpp
index f0a59bbd0b..063cc88d1c 100644
--- a/deps/icu-small/source/i18n/tolowtrn.cpp
+++ b/deps/icu-small/source/i18n/tolowtrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/tolowtrn.h b/deps/icu-small/source/i18n/tolowtrn.h
index 616e59899f..e311431224 100644
--- a/deps/icu-small/source/i18n/tolowtrn.h
+++ b/deps/icu-small/source/i18n/tolowtrn.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/toupptrn.cpp b/deps/icu-small/source/i18n/toupptrn.cpp
index a34792e07c..098dba9a3c 100644
--- a/deps/icu-small/source/i18n/toupptrn.cpp
+++ b/deps/icu-small/source/i18n/toupptrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/toupptrn.h b/deps/icu-small/source/i18n/toupptrn.h
index eae44e7d18..677a04e5c7 100644
--- a/deps/icu-small/source/i18n/toupptrn.h
+++ b/deps/icu-small/source/i18n/toupptrn.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/translit.cpp b/deps/icu-small/source/i18n/translit.cpp
index 79328baa2b..de54e952dc 100644
--- a/deps/icu-small/source/i18n/translit.cpp
+++ b/deps/icu-small/source/i18n/translit.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/transreg.cpp b/deps/icu-small/source/i18n/transreg.cpp
index cc1d51dea8..d864ad3463 100644
--- a/deps/icu-small/source/i18n/transreg.cpp
+++ b/deps/icu-small/source/i18n/transreg.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/transreg.h b/deps/icu-small/source/i18n/transreg.h
index 334963f8d1..6fc35c8247 100644
--- a/deps/icu-small/source/i18n/transreg.h
+++ b/deps/icu-small/source/i18n/transreg.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/tridpars.cpp b/deps/icu-small/source/i18n/tridpars.cpp
index 140e3d7d1c..68bbd2d040 100644
--- a/deps/icu-small/source/i18n/tridpars.cpp
+++ b/deps/icu-small/source/i18n/tridpars.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/tridpars.h b/deps/icu-small/source/i18n/tridpars.h
index 7c226023ef..3d657ed17c 100644
--- a/deps/icu-small/source/i18n/tridpars.h
+++ b/deps/icu-small/source/i18n/tridpars.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**************************************************************************
diff --git a/deps/icu-small/source/i18n/tzfmt.cpp b/deps/icu-small/source/i18n/tzfmt.cpp
index 783edac34f..45eda6ffb6 100644
--- a/deps/icu-small/source/i18n/tzfmt.cpp
+++ b/deps/icu-small/source/i18n/tzfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -14,8 +14,10 @@
#include "unicode/calendar.h"
#include "unicode/tzfmt.h"
#include "unicode/numsys.h"
+#include "unicode/strenum.h"
#include "unicode/uchar.h"
#include "unicode/udat.h"
+#include "unicode/ustring.h"
#include "tzgnames.h"
#include "cmemory.h"
#include "cstring.h"
diff --git a/deps/icu-small/source/i18n/tzgnames.cpp b/deps/icu-small/source/i18n/tzgnames.cpp
index 4fc726ea54..b14e9835d9 100644
--- a/deps/icu-small/source/i18n/tzgnames.cpp
+++ b/deps/icu-small/source/i18n/tzgnames.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -18,6 +18,7 @@
#include "unicode/rbtz.h"
#include "unicode/simpleformatter.h"
#include "unicode/simpletz.h"
+#include "unicode/strenum.h"
#include "unicode/vtzone.h"
#include "cmemory.h"
diff --git a/deps/icu-small/source/i18n/tzgnames.h b/deps/icu-small/source/i18n/tzgnames.h
index e78e8ee991..d896af8ba8 100644
--- a/deps/icu-small/source/i18n/tzgnames.h
+++ b/deps/icu-small/source/i18n/tzgnames.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tznames.cpp b/deps/icu-small/source/i18n/tznames.cpp
index 6aefd13b53..689fdeb091 100644
--- a/deps/icu-small/source/i18n/tznames.cpp
+++ b/deps/icu-small/source/i18n/tznames.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tznames_impl.cpp b/deps/icu-small/source/i18n/tznames_impl.cpp
index 3e92acb6f9..d00d7e1145 100644
--- a/deps/icu-small/source/i18n/tznames_impl.cpp
+++ b/deps/icu-small/source/i18n/tznames_impl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -15,6 +15,7 @@
#if !UCONFIG_NO_FORMATTING
+#include "unicode/strenum.h"
#include "unicode/ustring.h"
#include "unicode/timezone.h"
diff --git a/deps/icu-small/source/i18n/tznames_impl.h b/deps/icu-small/source/i18n/tznames_impl.h
index 6b913bb6bf..9251f9ef47 100644
--- a/deps/icu-small/source/i18n/tznames_impl.h
+++ b/deps/icu-small/source/i18n/tznames_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tzrule.cpp b/deps/icu-small/source/i18n/tzrule.cpp
index 2ff61302b8..f60a5e0dd5 100644
--- a/deps/icu-small/source/i18n/tzrule.cpp
+++ b/deps/icu-small/source/i18n/tzrule.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/tztrans.cpp b/deps/icu-small/source/i18n/tztrans.cpp
index 76e259c5ae..3199b78ea8 100644
--- a/deps/icu-small/source/i18n/tztrans.cpp
+++ b/deps/icu-small/source/i18n/tztrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/ucal.cpp b/deps/icu-small/source/i18n/ucal.cpp
index a9377b1e51..4154eea83f 100644
--- a/deps/icu-small/source/i18n/ucal.cpp
+++ b/deps/icu-small/source/i18n/ucal.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/ucln_in.cpp b/deps/icu-small/source/i18n/ucln_in.cpp
index b33a689237..74c8acfab1 100644
--- a/deps/icu-small/source/i18n/ucln_in.cpp
+++ b/deps/icu-small/source/i18n/ucln_in.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -8,7 +8,7 @@
* *
******************************************************************************
* file name: ucln_in.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/ucln_in.h b/deps/icu-small/source/i18n/ucln_in.h
index b609fce0c2..35a8a23e90 100644
--- a/deps/icu-small/source/i18n/ucln_in.h
+++ b/deps/icu-small/source/i18n/ucln_in.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: ucln_in.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/ucol.cpp b/deps/icu-small/source/i18n/ucol.cpp
index c622aef7c2..34a394682f 100644
--- a/deps/icu-small/source/i18n/ucol.cpp
+++ b/deps/icu-small/source/i18n/ucol.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ucol.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/ucol_imp.h b/deps/icu-small/source/i18n/ucol_imp.h
index 7c9e8f6891..a251fc461d 100644
--- a/deps/icu-small/source/i18n/ucol_imp.h
+++ b/deps/icu-small/source/i18n/ucol_imp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -10,7 +10,7 @@
*
* Private implementation header for C collation
* file name: ucol_imp.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/ucol_res.cpp b/deps/icu-small/source/i18n/ucol_res.cpp
index 314b766ee6..d1597021c3 100644
--- a/deps/icu-small/source/i18n/ucol_res.cpp
+++ b/deps/icu-small/source/i18n/ucol_res.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ucol_res.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -680,6 +680,7 @@ ucol_getKeywordValuesForLocale(const char* /*key*/, const char* locale,
return NULL;
}
memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
+ ulist_resetList(sink.values); // Initialize the iterator.
en->context = sink.values;
sink.values = NULL; // Avoid deletion in the sink destructor.
return en;
diff --git a/deps/icu-small/source/i18n/ucol_sit.cpp b/deps/icu-small/source/i18n/ucol_sit.cpp
index c81977b8a3..cf507f61ed 100644
--- a/deps/icu-small/source/i18n/ucol_sit.cpp
+++ b/deps/icu-small/source/i18n/ucol_sit.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: ucol_sit.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/ucoleitr.cpp b/deps/icu-small/source/i18n/ucoleitr.cpp
index 4b46b205aa..6842061bab 100644
--- a/deps/icu-small/source/i18n/ucoleitr.cpp
+++ b/deps/icu-small/source/i18n/ucoleitr.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
diff --git a/deps/icu-small/source/i18n/ucsdet.cpp b/deps/icu-small/source/i18n/ucsdet.cpp
index dd69d9f548..46f69cf90c 100644
--- a/deps/icu-small/source/i18n/ucsdet.cpp
+++ b/deps/icu-small/source/i18n/ucsdet.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/udat.cpp b/deps/icu-small/source/i18n/udat.cpp
index b07e1ceab7..d086067c03 100644
--- a/deps/icu-small/source/i18n/udat.cpp
+++ b/deps/icu-small/source/i18n/udat.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/udateintervalformat.cpp b/deps/icu-small/source/i18n/udateintervalformat.cpp
index e6eec44847..44ba6b9fb1 100644
--- a/deps/icu-small/source/i18n/udateintervalformat.cpp
+++ b/deps/icu-small/source/i18n/udateintervalformat.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/udatpg.cpp b/deps/icu-small/source/i18n/udatpg.cpp
index d8824afdfc..9ba82b529c 100644
--- a/deps/icu-small/source/i18n/udatpg.cpp
+++ b/deps/icu-small/source/i18n/udatpg.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: udatpg.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/ufieldpositer.cpp b/deps/icu-small/source/i18n/ufieldpositer.cpp
index b1c9c64805..64de856c30 100644
--- a/deps/icu-small/source/i18n/ufieldpositer.cpp
+++ b/deps/icu-small/source/i18n/ufieldpositer.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/uitercollationiterator.cpp b/deps/icu-small/source/i18n/uitercollationiterator.cpp
index eb71725380..103c91cac8 100644
--- a/deps/icu-small/source/i18n/uitercollationiterator.cpp
+++ b/deps/icu-small/source/i18n/uitercollationiterator.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/uitercollationiterator.h b/deps/icu-small/source/i18n/uitercollationiterator.h
index da9f8d3468..62b6f83419 100644
--- a/deps/icu-small/source/i18n/uitercollationiterator.h
+++ b/deps/icu-small/source/i18n/uitercollationiterator.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/ulocdata.c b/deps/icu-small/source/i18n/ulocdata.cpp
index e1e61ce870..551f6c64ed 100644
--- a/deps/icu-small/source/i18n/ulocdata.c
+++ b/deps/icu-small/source/i18n/ulocdata.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -8,7 +8,7 @@
* *
******************************************************************************
* file name: ulocdata.c
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/umsg.cpp b/deps/icu-small/source/i18n/umsg.cpp
index 75647e37d6..a385eb487d 100644
--- a/deps/icu-small/source/i18n/umsg.cpp
+++ b/deps/icu-small/source/i18n/umsg.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: umsg.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/umsg_imp.h b/deps/icu-small/source/i18n/umsg_imp.h
index e3538d3971..43ef1c78f0 100644
--- a/deps/icu-small/source/i18n/umsg_imp.h
+++ b/deps/icu-small/source/i18n/umsg_imp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: umsg_imp.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/unesctrn.cpp b/deps/icu-small/source/i18n/unesctrn.cpp
index 2e79067dee..fcce9528e2 100644
--- a/deps/icu-small/source/i18n/unesctrn.cpp
+++ b/deps/icu-small/source/i18n/unesctrn.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unesctrn.h b/deps/icu-small/source/i18n/unesctrn.h
index 7ae8302b0f..e8e171f2bc 100644
--- a/deps/icu-small/source/i18n/unesctrn.h
+++ b/deps/icu-small/source/i18n/unesctrn.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/uni2name.cpp b/deps/icu-small/source/i18n/uni2name.cpp
index 24323b3f60..86d7a4904a 100644
--- a/deps/icu-small/source/i18n/uni2name.cpp
+++ b/deps/icu-small/source/i18n/uni2name.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/uni2name.h b/deps/icu-small/source/i18n/uni2name.h
index 7d85113f66..4d6eaa0a9a 100644
--- a/deps/icu-small/source/i18n/uni2name.h
+++ b/deps/icu-small/source/i18n/uni2name.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/alphaindex.h b/deps/icu-small/source/i18n/unicode/alphaindex.h
index e9e8739ed2..54bd29ff88 100644
--- a/deps/icu-small/source/i18n/unicode/alphaindex.h
+++ b/deps/icu-small/source/i18n/unicode/alphaindex.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -15,6 +15,7 @@
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/locid.h"
+#include "unicode/unistr.h"
#if !UCONFIG_NO_COLLATION
diff --git a/deps/icu-small/source/i18n/unicode/basictz.h b/deps/icu-small/source/i18n/unicode/basictz.h
index 8da4a00bf8..eb62abaf0a 100644
--- a/deps/icu-small/source/i18n/unicode/basictz.h
+++ b/deps/icu-small/source/i18n/unicode/basictz.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/calendar.h b/deps/icu-small/source/i18n/unicode/calendar.h
index b7da5f3c5b..e43c181c8a 100644
--- a/deps/icu-small/source/i18n/unicode/calendar.h
+++ b/deps/icu-small/source/i18n/unicode/calendar.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/choicfmt.h b/deps/icu-small/source/i18n/unicode/choicfmt.h
index ab3c28fe07..c9f0f1114f 100644
--- a/deps/icu-small/source/i18n/unicode/choicfmt.h
+++ b/deps/icu-small/source/i18n/unicode/choicfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/coleitr.h b/deps/icu-small/source/i18n/unicode/coleitr.h
index 628b461f94..bf0e1d51a4 100644
--- a/deps/icu-small/source/i18n/unicode/coleitr.h
+++ b/deps/icu-small/source/i18n/unicode/coleitr.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -47,6 +47,7 @@ U_NAMESPACE_BEGIN
struct CollationData;
+class CharacterIterator;
class CollationIterator;
class RuleBasedCollator;
class UCollationPCE;
diff --git a/deps/icu-small/source/i18n/unicode/coll.h b/deps/icu-small/source/i18n/unicode/coll.h
index e41be2ee81..7e467df80e 100644
--- a/deps/icu-small/source/i18n/unicode/coll.h
+++ b/deps/icu-small/source/i18n/unicode/coll.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -58,7 +58,7 @@
#include "unicode/uobject.h"
#include "unicode/ucol.h"
-#include "unicode/normlzr.h"
+#include "unicode/unorm.h"
#include "unicode/locid.h"
#include "unicode/uniset.h"
#include "unicode/umisc.h"
@@ -158,7 +158,7 @@ class CollationKey;
* @see CollationKey
* @see CollationElementIterator
* @see Locale
-* @see Normalizer
+* @see Normalizer2
* @version 2.0 11/15/01
*/
@@ -393,8 +393,8 @@ public:
* is less than, greater than or equal to another string array.
* <p>Example of use:
* <pre>
- * . UChar ABC[] = {0x41, 0x42, 0x43, 0}; // = "ABC"
- * . UChar abc[] = {0x61, 0x62, 0x63, 0}; // = "abc"
+ * . char16_t ABC[] = {0x41, 0x42, 0x43, 0}; // = "ABC"
+ * . char16_t abc[] = {0x61, 0x62, 0x63, 0}; // = "abc"
* . UErrorCode status = U_ZERO_ERROR;
* . Collator *myCollation =
* . Collator::createInstance(Locale::getUS(), status);
@@ -420,8 +420,8 @@ public:
* target
* @deprecated ICU 2.6 use the overload with UErrorCode &
*/
- virtual EComparisonResult compare(const UChar* source, int32_t sourceLength,
- const UChar* target, int32_t targetLength)
+ virtual EComparisonResult compare(const char16_t* source, int32_t sourceLength,
+ const char16_t* target, int32_t targetLength)
const;
/**
@@ -440,8 +440,8 @@ public:
* than target
* @stable ICU 2.6
*/
- virtual UCollationResult compare(const UChar* source, int32_t sourceLength,
- const UChar* target, int32_t targetLength,
+ virtual UCollationResult compare(const char16_t* source, int32_t sourceLength,
+ const char16_t* target, int32_t targetLength,
UErrorCode &status) const = 0;
/**
@@ -517,7 +517,7 @@ public:
* @see CollationKey#compare
* @stable ICU 2.0
*/
- virtual CollationKey& getCollationKey(const UChar*source,
+ virtual CollationKey& getCollationKey(const char16_t*source,
int32_t sourceLength,
CollationKey& key,
UErrorCode& status) const = 0;
@@ -911,7 +911,7 @@ public:
* the top of one of the supported reordering groups,
* and it must not be beyond the last of those groups.
* See setMaxVariable().
- * @param varTop one or more (if contraction) UChars to which the variable top should be set
+ * @param varTop one or more (if contraction) char16_ts to which the variable top should be set
* @param len length of variable top string. If -1 it is considered to be zero terminated.
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
@@ -920,7 +920,7 @@ public:
* @return variable top primary weight
* @deprecated ICU 53 Call setMaxVariable() instead.
*/
- virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status) = 0;
+ virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status) = 0;
/**
* Sets the variable top to the primary weight of the specified string.
@@ -929,7 +929,7 @@ public:
* the top of one of the supported reordering groups,
* and it must not be beyond the last of those groups.
* See setMaxVariable().
- * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set
+ * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
* U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
@@ -1002,7 +1002,7 @@ public:
int32_t resultLength) const = 0;
/**
- * Get the sort key as an array of bytes from a UChar buffer.
+ * Get the sort key as an array of bytes from a char16_t buffer.
* Sort key byte arrays are zero-terminated and can be compared using
* strcmp().
*
@@ -1020,7 +1020,7 @@ public:
* @return Number of bytes needed for storing the sort key
* @stable ICU 2.2
*/
- virtual int32_t getSortKey(const UChar*source, int32_t sourceLength,
+ virtual int32_t getSortKey(const char16_t*source, int32_t sourceLength,
uint8_t*result, int32_t resultLength) const = 0;
/**
diff --git a/deps/icu-small/source/i18n/unicode/compactdecimalformat.h b/deps/icu-small/source/i18n/unicode/compactdecimalformat.h
index 1fcc5c581e..3fbe5da9ce 100644
--- a/deps/icu-small/source/i18n/unicode/compactdecimalformat.h
+++ b/deps/icu-small/source/i18n/unicode/compactdecimalformat.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/curramt.h b/deps/icu-small/source/i18n/unicode/curramt.h
index 268d53c0b1..03ec856e3b 100644
--- a/deps/icu-small/source/i18n/unicode/curramt.h
+++ b/deps/icu-small/source/i18n/unicode/curramt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -46,7 +46,7 @@ class U_I18N_API CurrencyAmount: public Measure {
* is invalid, then this will be set to a failing value.
* @stable ICU 3.0
*/
- CurrencyAmount(const Formattable& amount, const UChar* isoCode,
+ CurrencyAmount(const Formattable& amount, ConstChar16Ptr isoCode,
UErrorCode &ec);
/**
@@ -59,7 +59,7 @@ class U_I18N_API CurrencyAmount: public Measure {
* then this will be set to a failing value.
* @stable ICU 3.0
*/
- CurrencyAmount(double amount, const UChar* isoCode,
+ CurrencyAmount(double amount, ConstChar16Ptr isoCode,
UErrorCode &ec);
/**
@@ -115,14 +115,14 @@ class U_I18N_API CurrencyAmount: public Measure {
* Return the ISO currency code of this object.
* @stable ICU 3.0
*/
- inline const UChar* getISOCurrency() const;
+ inline const char16_t* getISOCurrency() const;
};
inline const CurrencyUnit& CurrencyAmount::getCurrency() const {
return (const CurrencyUnit&) getUnit();
}
-inline const UChar* CurrencyAmount::getISOCurrency() const {
+inline const char16_t* CurrencyAmount::getISOCurrency() const {
return getCurrency().getISOCurrency();
}
diff --git a/deps/icu-small/source/i18n/unicode/currpinf.h b/deps/icu-small/source/i18n/unicode/currpinf.h
index 133de38fc2..1a327c5bae 100644
--- a/deps/icu-small/source/i18n/unicode/currpinf.h
+++ b/deps/icu-small/source/i18n/unicode/currpinf.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/currunit.h b/deps/icu-small/source/i18n/unicode/currunit.h
index 313c92a6ac..b72dc5e68d 100644
--- a/deps/icu-small/source/i18n/unicode/currunit.h
+++ b/deps/icu-small/source/i18n/unicode/currunit.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -28,7 +28,7 @@ U_NAMESPACE_BEGIN
/**
* A unit of currency, such as USD (U.S. dollars) or JPY (Japanese
- * yen). This class is a thin wrapper over a UChar string that
+ * yen). This class is a thin wrapper over a char16_t string that
* subclasses MeasureUnit, for use with Measure and MeasureFormat.
*
* @author Alan Liu
@@ -44,7 +44,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
* then this will be set to a failing value.
* @stable ICU 3.0
*/
- CurrencyUnit(const UChar* isoCode, UErrorCode &ec);
+ CurrencyUnit(ConstChar16Ptr isoCode, UErrorCode &ec);
/**
* Copy constructor
@@ -93,16 +93,16 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
* Return the ISO currency code of this object.
* @stable ICU 3.0
*/
- inline const UChar* getISOCurrency() const;
+ inline const char16_t* getISOCurrency() const;
private:
/**
* The ISO 4217 code of this object.
*/
- UChar isoCode[4];
+ char16_t isoCode[4];
};
-inline const UChar* CurrencyUnit::getISOCurrency() const {
+inline const char16_t* CurrencyUnit::getISOCurrency() const {
return isoCode;
}
diff --git a/deps/icu-small/source/i18n/unicode/datefmt.h b/deps/icu-small/source/i18n/unicode/datefmt.h
index 6e3a78f291..d70d8d1dd5 100644
--- a/deps/icu-small/source/i18n/unicode/datefmt.h
+++ b/deps/icu-small/source/i18n/unicode/datefmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/dcfmtsym.h b/deps/icu-small/source/i18n/unicode/dcfmtsym.h
index 946227addb..3a502d0ec0 100644
--- a/deps/icu-small/source/i18n/unicode/dcfmtsym.h
+++ b/deps/icu-small/source/i18n/unicode/dcfmtsym.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -35,6 +35,7 @@
#include "unicode/uobject.h"
#include "unicode/locid.h"
#include "unicode/unum.h"
+#include "unicode/unistr.h"
/**
* \file
@@ -392,7 +393,7 @@ public:
* Returns that pattern stored in currecy info. Internal API for use by NumberFormat API.
* @internal
*/
- inline const UChar* getCurrencyPattern(void) const;
+ inline const char16_t* getCurrencyPattern(void) const;
#endif /* U_HIDE_INTERNAL_API */
private:
@@ -423,7 +424,7 @@ private:
char actualLocale[ULOC_FULLNAME_CAPACITY];
char validLocale[ULOC_FULLNAME_CAPACITY];
- const UChar* currPattern;
+ const char16_t* currPattern;
UnicodeString currencySpcBeforeSym[UNUM_CURRENCY_SPACING_COUNT];
UnicodeString currencySpcAfterSym[UNUM_CURRENCY_SPACING_COUNT];
@@ -491,7 +492,7 @@ DecimalFormatSymbols::getLocale() const {
}
#ifndef U_HIDE_INTERNAL_API
-inline const UChar*
+inline const char16_t*
DecimalFormatSymbols::getCurrencyPattern() const {
return currPattern;
}
diff --git a/deps/icu-small/source/i18n/unicode/decimfmt.h b/deps/icu-small/source/i18n/unicode/decimfmt.h
index 7339399f72..1deff5bf92 100644
--- a/deps/icu-small/source/i18n/unicode/decimfmt.h
+++ b/deps/icu-small/source/i18n/unicode/decimfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -604,7 +604,7 @@ template class U_I18N_API EnumSet<UNumberFormatAttribute,
* including prefix and suffix, determines the format width. For example, in
* the pattern <code>"* #0 o''clock"</code>, the format width is 10.
*
- * <li>The width is counted in 16-bit code units (UChars).
+ * <li>The width is counted in 16-bit code units (char16_ts).
*
* <li>Some parameters which usually do not matter have meaning when padding is
* used, because the pattern width is significant with padding. In the pattern
@@ -1961,14 +1961,14 @@ public:
* @param ec input-output error code
* @stable ICU 3.0
*/
- virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec);
+ virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec);
/**
* Sets the currency used to display currency amounts. See
- * setCurrency(const UChar*, UErrorCode&).
- * @deprecated ICU 3.0. Use setCurrency(const UChar*, UErrorCode&).
+ * setCurrency(const char16_t*, UErrorCode&).
+ * @deprecated ICU 3.0. Use setCurrency(const char16_t*, UErrorCode&).
*/
- virtual void setCurrency(const UChar* theCurrency);
+ virtual void setCurrency(const char16_t* theCurrency);
/**
* Sets the <tt>Currency Context</tt> object used to display currency.
@@ -2108,7 +2108,7 @@ private:
void parse(const UnicodeString& text,
Formattable& result,
ParsePosition& pos,
- UChar* currency) const;
+ char16_t* currency) const;
enum {
fgStatusInfinite,
@@ -2124,7 +2124,7 @@ private:
int8_t type,
ParsePosition& parsePosition,
DigitList& digits, UBool* status,
- UChar* currency) const;
+ char16_t* currency) const;
// Mixed style parsing for currency.
// It parses against the current currency pattern
@@ -2135,7 +2135,7 @@ private:
ParsePosition& parsePosition,
DigitList& digits,
UBool* status,
- UChar* currency) const;
+ char16_t* currency) const;
int32_t skipPadding(const UnicodeString& text, int32_t position) const;
@@ -2146,7 +2146,7 @@ private:
const UnicodeString* affixPat,
UBool complexCurrencyParsing,
int8_t type,
- UChar* currency) const;
+ char16_t* currency) const;
static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix);
@@ -2169,7 +2169,7 @@ private:
const UnicodeString& input,
int32_t pos,
int8_t type,
- UChar* currency) const;
+ char16_t* currency) const;
static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
@@ -2195,11 +2195,11 @@ private:
void setupCurrencyAffixPatterns(UErrorCode& status);
// get the currency rounding with respect to currency usage
- double getCurrencyRounding(const UChar* currency,
+ double getCurrencyRounding(const char16_t* currency,
UErrorCode* ec) const;
// get the currency fraction with respect to currency usage
- int getCurrencyFractionDigits(const UChar* currency,
+ int getCurrencyFractionDigits(const char16_t* currency,
UErrorCode* ec) const;
// hashtable operations
@@ -2271,7 +2271,7 @@ protected:
* have a capacity of at least 4
* @internal
*/
- virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const;
+ virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
/** number of integer digits
* @stable ICU 2.4
diff --git a/deps/icu-small/source/i18n/unicode/dtfmtsym.h b/deps/icu-small/source/i18n/unicode/dtfmtsym.h
index 507868e2c3..ed7c189846 100644
--- a/deps/icu-small/source/i18n/unicode/dtfmtsym.h
+++ b/deps/icu-small/source/i18n/unicode/dtfmtsym.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -25,6 +25,7 @@
#if !UCONFIG_NO_FORMATTING
#include "unicode/calendar.h"
+#include "unicode/strenum.h"
#include "unicode/uobject.h"
#include "unicode/locid.h"
#include "unicode/udat.h"
@@ -426,13 +427,13 @@ public:
* doesn't specify any time separator, and always recognized when parsing.
* @internal
*/
- static const UChar DEFAULT_TIME_SEPARATOR = 0x003a; // ':'
+ static const char16_t DEFAULT_TIME_SEPARATOR = 0x003a; // ':'
/**
* This alternate time separator is always recognized when parsing.
* @internal
*/
- static const UChar ALTERNATE_TIME_SEPARATOR = 0x002e; // '.'
+ static const char16_t ALTERNATE_TIME_SEPARATOR = 0x002e; // '.'
/**
* Gets the time separator string. For example: ":".
@@ -566,7 +567,7 @@ public:
* @return the non-localized date-time pattern characters
* @stable ICU 2.0
*/
- static const UChar * U_EXPORT2 getPatternUChars(void);
+ static const char16_t * U_EXPORT2 getPatternUChars(void);
/**
* Gets localized date-time pattern characters. For example: 'u', 't', etc.
@@ -977,7 +978,7 @@ private:
* Returns the date format field index of the pattern character c,
* or UDAT_FIELD_COUNT if c is not a pattern character.
*/
- static UDateFormatField U_EXPORT2 getPatternCharIndex(UChar c);
+ static UDateFormatField U_EXPORT2 getPatternCharIndex(char16_t c);
/**
* Returns TRUE if f (with its pattern character repeated count times) is a numeric field.
@@ -987,7 +988,7 @@ private:
/**
* Returns TRUE if c (repeated count times) is the pattern character for a numeric field.
*/
- static UBool U_EXPORT2 isNumericPatternChar(UChar c, int32_t count);
+ static UBool U_EXPORT2 isNumericPatternChar(char16_t c, int32_t count);
public:
#ifndef U_HIDE_INTERNAL_API
/**
diff --git a/deps/icu-small/source/i18n/unicode/dtitvfmt.h b/deps/icu-small/source/i18n/unicode/dtitvfmt.h
index 68360b87df..5eaa559d0e 100644
--- a/deps/icu-small/source/i18n/unicode/dtitvfmt.h
+++ b/deps/icu-small/source/i18n/unicode/dtitvfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************************
* Copyright (C) 2008-2016, International Business Machines Corporation and
@@ -996,7 +996,7 @@ private:
// from calendar field to pattern letter
- static const UChar fgCalendarFieldToPatternLetter[];
+ static const char16_t fgCalendarFieldToPatternLetter[];
/**
diff --git a/deps/icu-small/source/i18n/unicode/dtitvinf.h b/deps/icu-small/source/i18n/unicode/dtitvinf.h
index b31061e16a..e537bed0c9 100644
--- a/deps/icu-small/source/i18n/unicode/dtitvinf.h
+++ b/deps/icu-small/source/i18n/unicode/dtitvinf.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/dtptngen.h b/deps/icu-small/source/i18n/unicode/dtptngen.h
index fd617ce3cd..6fd5f5fd30 100644
--- a/deps/icu-small/source/i18n/unicode/dtptngen.h
+++ b/deps/icu-small/source/i18n/unicode/dtptngen.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -27,6 +27,7 @@ U_NAMESPACE_BEGIN
*/
+class CharString;
class Hashtable;
class FormatParser;
class DateTimeMatcher;
@@ -517,7 +518,7 @@ private:
DateTimeMatcher *skipMatcher;
Hashtable *fAvailableFormatKeyHash;
UnicodeString emptyString;
- UChar fDefaultHourFormatChar;
+ char16_t fDefaultHourFormatChar;
int32_t fAllowedHourFormats[7]; // Actually an array of AllowedHourFormat enum type, ending with UNKNOWN.
diff --git a/deps/icu-small/source/i18n/unicode/dtrule.h b/deps/icu-small/source/i18n/unicode/dtrule.h
index 32d230ea77..24dfc69de1 100644
--- a/deps/icu-small/source/i18n/unicode/dtrule.h
+++ b/deps/icu-small/source/i18n/unicode/dtrule.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/fieldpos.h b/deps/icu-small/source/i18n/unicode/fieldpos.h
index 6091941106..78561a4de7 100644
--- a/deps/icu-small/source/i18n/unicode/fieldpos.h
+++ b/deps/icu-small/source/i18n/unicode/fieldpos.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/fmtable.h b/deps/icu-small/source/i18n/unicode/fmtable.h
index ac5daba893..766a71969d 100644
--- a/deps/icu-small/source/i18n/unicode/fmtable.h
+++ b/deps/icu-small/source/i18n/unicode/fmtable.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/format.h b/deps/icu-small/source/i18n/unicode/format.h
index 1484e9f00e..e64cc1c6eb 100644
--- a/deps/icu-small/source/i18n/unicode/format.h
+++ b/deps/icu-small/source/i18n/unicode/format.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/fpositer.h b/deps/icu-small/source/i18n/unicode/fpositer.h
index 694a1d8770..898b66ceea 100644
--- a/deps/icu-small/source/i18n/unicode/fpositer.h
+++ b/deps/icu-small/source/i18n/unicode/fpositer.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/gender.h b/deps/icu-small/source/i18n/unicode/gender.h
index 0294895184..467b64ec5e 100644
--- a/deps/icu-small/source/i18n/unicode/gender.h
+++ b/deps/icu-small/source/i18n/unicode/gender.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/gregocal.h b/deps/icu-small/source/i18n/unicode/gregocal.h
index 60ba0cc6ac..1d881e0be7 100644
--- a/deps/icu-small/source/i18n/unicode/gregocal.h
+++ b/deps/icu-small/source/i18n/unicode/gregocal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 1997-2013, International Business Machines Corporation and others.
diff --git a/deps/icu-small/source/i18n/unicode/measfmt.h b/deps/icu-small/source/i18n/unicode/measfmt.h
index 866d7d3227..dcd4f42343 100644
--- a/deps/icu-small/source/i18n/unicode/measfmt.h
+++ b/deps/icu-small/source/i18n/unicode/measfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/measunit.h b/deps/icu-small/source/i18n/unicode/measunit.h
index 9810b91194..1cb97ed549 100644
--- a/deps/icu-small/source/i18n/unicode/measunit.h
+++ b/deps/icu-small/source/i18n/unicode/measunit.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -345,35 +345,29 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createKarat(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns unit of concentr: milligram-per-deciliter.
* Caller owns returned value and must free it.
* @param status ICU error code.
- * @draft ICU 57
+ * @stable ICU 57
*/
static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns unit of concentr: millimole-per-liter.
* Caller owns returned value and must free it.
* @param status ICU error code.
- * @draft ICU 57
+ * @stable ICU 57
*/
static MeasureUnit *createMillimolePerLiter(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
/**
* Returns unit of concentr: part-per-million.
* Caller owns returned value and must free it.
* @param status ICU error code.
- * @draft ICU 57
+ * @stable ICU 57
*/
static MeasureUnit *createPartPerMillion(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns unit of consumption: liter-per-100kilometers.
@@ -399,55 +393,21 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createMilePerGallon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns unit of consumption: mile-per-gallon-imperial.
* Caller owns returned value and must free it.
* @param status ICU error code.
- * @draft ICU 57
+ * @stable ICU 57
*/
static MeasureUnit *createMilePerGallonImperial(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
-
-#ifndef U_HIDE_DRAFT_API
- /**
- * Returns unit of coordinate: east.
- * Caller owns returned value and must free it.
- * @param status ICU error code.
- * @draft ICU 58
- */
- static MeasureUnit *createEast(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
-#ifndef U_HIDE_DRAFT_API
- /**
- * Returns unit of coordinate: north.
- * Caller owns returned value and must free it.
- * @param status ICU error code.
- * @draft ICU 58
+ /*
+ * The following were draft ICU 58, but have been withdrawn:
+ * static MeasureUnit *createEast(UErrorCode &status);
+ * static MeasureUnit *createNorth(UErrorCode &status);
+ * static MeasureUnit *createSouth(UErrorCode &status);
+ * static MeasureUnit *createWest(UErrorCode &status);
*/
- static MeasureUnit *createNorth(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
-
-#ifndef U_HIDE_DRAFT_API
- /**
- * Returns unit of coordinate: south.
- * Caller owns returned value and must free it.
- * @param status ICU error code.
- * @draft ICU 58
- */
- static MeasureUnit *createSouth(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
-
-#ifndef U_HIDE_DRAFT_API
- /**
- * Returns unit of coordinate: west.
- * Caller owns returned value and must free it.
- * @param status ICU error code.
- * @draft ICU 58
- */
- static MeasureUnit *createWest(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns unit of digital: bit.
@@ -873,6 +833,16 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createPicometer(UErrorCode &status);
+#ifndef U_HIDE_DRAFT_API
+ /**
+ * Returns unit of length: point.
+ * Caller owns returned value and must free it.
+ * @param status ICU error code.
+ * @draft ICU 59
+ */
+ static MeasureUnit *createPoint(UErrorCode &status);
+#endif /* U_HIDE_DRAFT_API */
+
/**
* Returns unit of length: yard.
* Caller owns returned value and must free it.
@@ -1249,15 +1219,13 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit *createGallon(UErrorCode &status);
-#ifndef U_HIDE_DRAFT_API
/**
* Returns unit of volume: gallon-imperial.
* Caller owns returned value and must free it.
* @param status ICU error code.
- * @draft ICU 57
+ * @stable ICU 57
*/
static MeasureUnit *createGallonImperial(UErrorCode &status);
-#endif /* U_HIDE_DRAFT_API */
/**
* Returns unit of volume: hectoliter.
diff --git a/deps/icu-small/source/i18n/unicode/measure.h b/deps/icu-small/source/i18n/unicode/measure.h
index 719bc6bc8f..71438d5c85 100644
--- a/deps/icu-small/source/i18n/unicode/measure.h
+++ b/deps/icu-small/source/i18n/unicode/measure.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/msgfmt.h b/deps/icu-small/source/i18n/unicode/msgfmt.h
index 1a9973872d..fef8010774 100644
--- a/deps/icu-small/source/i18n/unicode/msgfmt.h
+++ b/deps/icu-small/source/i18n/unicode/msgfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2007-2013, International Business Machines Corporation and
@@ -939,7 +939,7 @@ private:
* @return the index of the list which matches the keyword s.
*/
static int32_t findKeyword( const UnicodeString& s,
- const UChar * const *list);
+ const char16_t * const *list);
/**
* Thin wrapper around the format(... AppendableWrapper ...) variant.
diff --git a/deps/icu-small/source/i18n/unicode/numfmt.h b/deps/icu-small/source/i18n/unicode/numfmt.h
index 9e3d5d34ec..7147204a7c 100644
--- a/deps/icu-small/source/i18n/unicode/numfmt.h
+++ b/deps/icu-small/source/i18n/unicode/numfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -931,7 +931,7 @@ public:
* @param ec input-output error code
* @stable ICU 3.0
*/
- virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec);
+ virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec);
/**
* Gets the currency used to display currency
@@ -940,7 +940,7 @@ public:
* the currency in use, or a pointer to the empty string.
* @stable ICU 2.6
*/
- const UChar* getCurrency() const;
+ const char16_t* getCurrency() const;
/**
* Set a particular UDisplayContext value in the formatter, such as
@@ -1018,7 +1018,7 @@ protected:
* have a capacity of at least 4
* @internal
*/
- virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const;
+ virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
#ifndef U_HIDE_INTERNAL_API
/**
@@ -1065,7 +1065,7 @@ private:
UBool fLenient; // TRUE => lenient parse is enabled
// ISO currency code
- UChar fCurrency[4];
+ char16_t fCurrency[4];
UDisplayContext fCapitalizationContext;
diff --git a/deps/icu-small/source/i18n/unicode/numsys.h b/deps/icu-small/source/i18n/unicode/numsys.h
index da181551c2..5f52721278 100644
--- a/deps/icu-small/source/i18n/unicode/numsys.h
+++ b/deps/icu-small/source/i18n/unicode/numsys.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -193,7 +193,7 @@ private:
void setAlgorithmic(UBool algorithmic);
- void setDesc(UnicodeString desc);
+ void setDesc(const UnicodeString &desc);
void setName(const char* name);
diff --git a/deps/icu-small/source/i18n/unicode/plurfmt.h b/deps/icu-small/source/i18n/unicode/plurfmt.h
index b10e4179b6..9a83e52550 100644
--- a/deps/icu-small/source/i18n/unicode/plurfmt.h
+++ b/deps/icu-small/source/i18n/unicode/plurfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/plurrule.h b/deps/icu-small/source/i18n/unicode/plurrule.h
index 146e6bea83..a14f392b7a 100644
--- a/deps/icu-small/source/i18n/unicode/plurrule.h
+++ b/deps/icu-small/source/i18n/unicode/plurrule.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -29,6 +29,9 @@
#include "unicode/format.h"
#include "unicode/upluralrules.h"
+#ifndef U_HIDE_INTERNAL_API
+#include "unicode/numfmt.h"
+#endif /* U_HIDE_INTERNAL_API */
/**
* Value returned by PluralRules::getUniqueKeywordValue() when there is no
@@ -346,6 +349,22 @@ public:
#ifndef U_HIDE_INTERNAL_API
/**
+ * Given a number and a format, returns the keyword of the first applicable
+ * rule for this PluralRules object.
+ * Note: This internal preview interface may be removed in the future if
+ * an architecturally cleaner solution reaches stable status.
+ * @param obj The numeric object for which the rule should be determined.
+ * @param fmt The NumberFormat specifying how the number will be formatted
+ * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars").
+ * @param status Input/output parameter. If at entry this indicates a
+ * failure status, the method returns immediately; otherwise
+ * this is set to indicate the outcome of the call.
+ * @return The keyword of the selected rule. Undefined in the case of an error.
+ * @internal ICU 59 technology preview, may be removed in the future
+ */
+ UnicodeString select(const Formattable& obj, const NumberFormat& fmt, UErrorCode& status) const;
+
+ /**
* @internal
*/
UnicodeString select(const FixedDecimal &number) const;
diff --git a/deps/icu-small/source/i18n/unicode/rbnf.h b/deps/icu-small/source/i18n/unicode/rbnf.h
index 14230f8982..b4cbb06732 100644
--- a/deps/icu-small/source/i18n/unicode/rbnf.h
+++ b/deps/icu-small/source/i18n/unicode/rbnf.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -866,6 +866,52 @@ public:
FieldPosition& pos,
UErrorCode& status) const;
+protected:
+ /**
+ * Format a decimal number.
+ * The number is a DigitList wrapper onto a floating point decimal number.
+ * The default implementation in NumberFormat converts the decimal number
+ * to a double and formats that. Subclasses of NumberFormat that want
+ * to specifically handle big decimal numbers must override this method.
+ * class DecimalFormat does so.
+ *
+ * @param number The number, a DigitList format Decimal Floating Point.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param posIter On return, can be used to iterate over positions
+ * of fields generated by this format call.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ virtual UnicodeString& format(const DigitList &number,
+ UnicodeString& appendTo,
+ FieldPositionIterator* posIter,
+ UErrorCode& status) const;
+
+ /**
+ * Format a decimal number.
+ * The number is a DigitList wrapper onto a floating point decimal number.
+ * The default implementation in NumberFormat converts the decimal number
+ * to a double and formats that. Subclasses of NumberFormat that want
+ * to specifically handle big decimal numbers must override this method.
+ * class DecimalFormat does so.
+ *
+ * @param number The number, a DigitList format Decimal Floating Point.
+ * @param appendTo Output parameter to receive result.
+ * Result is appended to existing contents.
+ * @param pos On input: an alignment field, if desired.
+ * On output: the offsets of the alignment field.
+ * @param status Output param filled with success/failure status.
+ * @return Reference to 'appendTo' parameter.
+ * @internal
+ */
+ virtual UnicodeString& format(const DigitList &number,
+ UnicodeString& appendTo,
+ FieldPosition& pos,
+ UErrorCode& status) const;
+public:
+
using NumberFormat::parse;
/**
@@ -1031,7 +1077,8 @@ private:
NFRule * initializeDefaultNaNRule(UErrorCode &status);
const NFRule * getDefaultNaNRule() const;
PluralFormat *createPluralFormat(UPluralType pluralType, const UnicodeString &pattern, UErrorCode& status) const;
- UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult) const;
+ UnicodeString& adjustForCapitalizationContext(int32_t startPos, UnicodeString& currentResult, UErrorCode& status) const;
+ UnicodeString& format(int64_t number, NFRuleSet *ruleSet, UnicodeString& toAppendTo, UErrorCode& status) const;
private:
NFRuleSet **ruleSets;
diff --git a/deps/icu-small/source/i18n/unicode/rbtz.h b/deps/icu-small/source/i18n/unicode/rbtz.h
index 20de34bb17..542a7c140c 100644
--- a/deps/icu-small/source/i18n/unicode/rbtz.h
+++ b/deps/icu-small/source/i18n/unicode/rbtz.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/regex.h b/deps/icu-small/source/i18n/unicode/regex.h
index 96c64874a4..7a68039fe8 100644
--- a/deps/icu-small/source/i18n/unicode/regex.h
+++ b/deps/icu-small/source/i18n/unicode/regex.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: regex.h
-* encoding: US-ASCII
+* encoding: UTF-8
* indentation:4
*
* created on: 2002oct22
@@ -350,17 +350,17 @@ public:
private:
/**
* Cause a compilation error if an application accidentally attempts to
- * create a matcher with a (UChar *) string as input rather than
+ * create a matcher with a (char16_t *) string as input rather than
* a UnicodeString. Avoids a dangling reference to a temporary string.
* <p>
- * To efficiently work with UChar *strings, wrap the data in a UnicodeString
+ * To efficiently work with char16_t *strings, wrap the data in a UnicodeString
* using one of the aliasing constructors, such as
- * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code>
+ * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code>
* or in a UText, using
- * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code>
+ * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code>
*
*/
- RegexMatcher *matcher(const UChar *input,
+ RegexMatcher *matcher(const char16_t *input,
UErrorCode &status) const;
public:
@@ -748,17 +748,17 @@ public:
private:
/**
* Cause a compilation error if an application accidentally attempts to
- * create a matcher with a (UChar *) string as input rather than
+ * create a matcher with a (char16_t *) string as input rather than
* a UnicodeString. Avoids a dangling reference to a temporary string.
* <p>
- * To efficiently work with UChar *strings, wrap the data in a UnicodeString
+ * To efficiently work with char16_t *strings, wrap the data in a UnicodeString
* using one of the aliasing constructors, such as
- * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code>
+ * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code>
* or in a UText, using
- * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code>
+ * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code>
*
*/
- RegexMatcher(const UnicodeString &regexp, const UChar *input,
+ RegexMatcher(const UnicodeString &regexp, const char16_t *input,
uint32_t flags, UErrorCode &status);
public:
@@ -1156,17 +1156,17 @@ public:
private:
/**
* Cause a compilation error if an application accidentally attempts to
- * reset a matcher with a (UChar *) string as input rather than
+ * reset a matcher with a (char16_t *) string as input rather than
* a UnicodeString. Avoids a dangling reference to a temporary string.
* <p>
- * To efficiently work with UChar *strings, wrap the data in a UnicodeString
+ * To efficiently work with char16_t *strings, wrap the data in a UnicodeString
* using one of the aliasing constructors, such as
- * <code>UnicodeString(UBool isTerminated, const UChar *text, int32_t textLength);</code>
+ * <code>UnicodeString(UBool isTerminated, const char16_t *text, int32_t textLength);</code>
* or in a UText, using
- * <code>utext_openUChars(UText *ut, const UChar *text, int64_t textLength, UErrorCode *status);</code>
+ * <code>utext_openUChars(UText *ut, const char16_t *text, int64_t textLength, UErrorCode *status);</code>
*
*/
- RegexMatcher &reset(const UChar *input);
+ RegexMatcher &reset(const char16_t *input);
public:
/**
diff --git a/deps/icu-small/source/i18n/unicode/region.h b/deps/icu-small/source/i18n/unicode/region.h
index 47829944a3..667c4051f0 100644
--- a/deps/icu-small/source/i18n/unicode/region.h
+++ b/deps/icu-small/source/i18n/unicode/region.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/reldatefmt.h b/deps/icu-small/source/i18n/unicode/reldatefmt.h
index 8e659e2bc8..abd43522c3 100644
--- a/deps/icu-small/source/i18n/unicode/reldatefmt.h
+++ b/deps/icu-small/source/i18n/unicode/reldatefmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************
@@ -230,6 +230,7 @@ typedef enum UDateDirection {
U_NAMESPACE_BEGIN
+class BreakIterator;
class RelativeDateTimeCacheData;
class SharedNumberFormat;
class SharedPluralRules;
@@ -414,7 +415,6 @@ public:
UnicodeString& appendTo,
UErrorCode& status) const;
-#ifndef U_HIDE_DRAFT_API
/**
* Format a combination of URelativeDateTimeUnit and numeric offset
* using a numeric style, e.g. "1 week ago", "in 1 week",
@@ -430,7 +430,7 @@ public:
* appended.
* @param status ICU error code returned here.
* @return appendTo
- * @draft ICU 57
+ * @stable ICU 57
*/
UnicodeString& formatNumeric(
double offset,
@@ -453,14 +453,13 @@ public:
* appended.
* @param status ICU error code returned here.
* @return appendTo
- * @draft ICU 57
+ * @stable ICU 57
*/
UnicodeString& format(
double offset,
URelativeDateTimeUnit unit,
UnicodeString& appendTo,
UErrorCode& status) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Combines a relative date string and a time string in this object's
diff --git a/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h b/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h
index 0b34755dc2..30edee7ecc 100644
--- a/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h
+++ b/deps/icu-small/source/i18n/unicode/scientificnumberformatter.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/search.h b/deps/icu-small/source/i18n/unicode/search.h
index 35a0552623..12dd5c7727 100644
--- a/deps/icu-small/source/i18n/unicode/search.h
+++ b/deps/icu-small/source/i18n/unicode/search.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/selfmt.h b/deps/icu-small/source/i18n/unicode/selfmt.h
index 37a8f2b821..08e9d444ee 100755
--- a/deps/icu-small/source/i18n/unicode/selfmt.h
+++ b/deps/icu-small/source/i18n/unicode/selfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
diff --git a/deps/icu-small/source/i18n/unicode/simpletz.h b/deps/icu-small/source/i18n/unicode/simpletz.h
index 7e41a4ab8a..1b23ab79d1 100644
--- a/deps/icu-small/source/i18n/unicode/simpletz.h
+++ b/deps/icu-small/source/i18n/unicode/simpletz.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/smpdtfmt.h b/deps/icu-small/source/i18n/unicode/smpdtfmt.h
index e6cf28d22b..4733e759aa 100644
--- a/deps/icu-small/source/i18n/unicode/smpdtfmt.h
+++ b/deps/icu-small/source/i18n/unicode/smpdtfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 1997-2016, International Business Machines Corporation and
@@ -1170,7 +1170,7 @@ public:
* @param field The UDateFormatField to get
* @stable ICU 54
*/
- const NumberFormat * getNumberFormatForField(UChar field) const;
+ const NumberFormat * getNumberFormatForField(char16_t field) const;
#ifndef U_HIDE_INTERNAL_API
/**
@@ -1262,7 +1262,7 @@ private:
* succeeds.
*/
void subFormat(UnicodeString &appendTo,
- UChar ch,
+ char16_t ch,
int32_t count,
UDisplayContext capitalizationContext,
int32_t fieldNum,
@@ -1294,7 +1294,7 @@ private:
* Return true if the given format character, occuring count
* times, represents a numeric field.
*/
- static UBool isNumeric(UChar formatChar, int32_t count);
+ static UBool isNumeric(char16_t formatChar, int32_t count);
/**
* Returns TRUE if the patternOffset is at the start of a numeric field.
@@ -1412,7 +1412,7 @@ private:
* @return the new start position if matching succeeded; a negative number
* indicating matching failure, otherwise.
*/
- int32_t subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count,
+ int32_t subParse(const UnicodeString& text, int32_t& start, char16_t ch, int32_t count,
UBool obeyCount, UBool allowNegative, UBool ambiguousYear[], int32_t& saveHebrewMonth, Calendar& cal,
int32_t patLoc, MessageFormat * numericLeapMonthFormatter, UTimeZoneFormatTimeType *tzTimeType, SimpleDateFormatMutableNFs &mutableNFs,
int32_t *dayPeriod=NULL) const;
@@ -1523,12 +1523,12 @@ private:
/**
* Map calendar field letter into calendar field level.
*/
- static int32_t getLevelFromChar(UChar ch);
+ static int32_t getLevelFromChar(char16_t ch);
/**
* Tell if a character can be used to define a field in a format string.
*/
- static UBool isSyntaxChar(UChar ch);
+ static UBool isSyntaxChar(char16_t ch);
/**
* The formatting pattern for this formatter.
diff --git a/deps/icu-small/source/i18n/unicode/sortkey.h b/deps/icu-small/source/i18n/unicode/sortkey.h
index 6f1543da40..6895be7a2b 100644
--- a/deps/icu-small/source/i18n/unicode/sortkey.h
+++ b/deps/icu-small/source/i18n/unicode/sortkey.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/stsearch.h b/deps/icu-small/source/i18n/unicode/stsearch.h
index 1cae53d128..46bc51b30e 100644
--- a/deps/icu-small/source/i18n/unicode/stsearch.h
+++ b/deps/icu-small/source/i18n/unicode/stsearch.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/tblcoll.h b/deps/icu-small/source/i18n/unicode/tblcoll.h
index c48ea38c13..24ba213b41 100644
--- a/deps/icu-small/source/i18n/unicode/tblcoll.h
+++ b/deps/icu-small/source/i18n/unicode/tblcoll.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -308,8 +308,8 @@ public:
* than target
* @stable ICU 2.6
*/
- virtual UCollationResult compare(const UChar* source, int32_t sourceLength,
- const UChar* target, int32_t targetLength,
+ virtual UCollationResult compare(const char16_t* source, int32_t sourceLength,
+ const char16_t* target, int32_t targetLength,
UErrorCode &status) const;
/**
@@ -377,7 +377,7 @@ public:
* @see CollationKey
* @stable ICU 2.0
*/
- virtual CollationKey& getCollationKey(const UChar *source,
+ virtual CollationKey& getCollationKey(const char16_t *source,
int32_t sourceLength,
CollationKey& key,
UErrorCode& status) const;
@@ -552,7 +552,7 @@ public:
* the top of one of the supported reordering groups,
* and it must not be beyond the last of those groups.
* See setMaxVariable().
- * @param varTop one or more (if contraction) UChars to which the variable top should be set
+ * @param varTop one or more (if contraction) char16_ts to which the variable top should be set
* @param len length of variable top string. If -1 it is considered to be zero terminated.
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
@@ -561,7 +561,7 @@ public:
* @return variable top primary weight
* @deprecated ICU 53 Call setMaxVariable() instead.
*/
- virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status);
+ virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status);
/**
* Sets the variable top to the primary weight of the specified string.
@@ -570,7 +570,7 @@ public:
* the top of one of the supported reordering groups,
* and it must not be beyond the last of those groups.
* See setMaxVariable().
- * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set
+ * @param varTop a UnicodeString size 1 or more (if contraction) of char16_ts to which the variable top should be set
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
* U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
@@ -631,7 +631,7 @@ public:
int32_t resultLength) const;
/**
- * Get the sort key as an array of bytes from a UChar buffer.
+ * Get the sort key as an array of bytes from a char16_t buffer.
*
* Note that sort keys are often less efficient than simply doing comparison.
* For more details, see the ICU User Guide.
@@ -646,7 +646,7 @@ public:
* @return Number of bytes needed for storing the sort key
* @stable ICU 2.2
*/
- virtual int32_t getSortKey(const UChar *source, int32_t sourceLength,
+ virtual int32_t getSortKey(const char16_t *source, int32_t sourceLength,
uint8_t *result, int32_t resultLength) const;
/**
@@ -821,17 +821,17 @@ private:
void adoptTailoring(CollationTailoring *t, UErrorCode &errorCode);
// Both lengths must be <0 or else both must be >=0.
- UCollationResult doCompare(const UChar *left, int32_t leftLength,
- const UChar *right, int32_t rightLength,
+ UCollationResult doCompare(const char16_t *left, int32_t leftLength,
+ const char16_t *right, int32_t rightLength,
UErrorCode &errorCode) const;
UCollationResult doCompare(const uint8_t *left, int32_t leftLength,
const uint8_t *right, int32_t rightLength,
UErrorCode &errorCode) const;
- void writeSortKey(const UChar *s, int32_t length,
+ void writeSortKey(const char16_t *s, int32_t length,
SortKeyByteSink &sink, UErrorCode &errorCode) const;
- void writeIdenticalLevel(const UChar *s, const UChar *limit,
+ void writeIdenticalLevel(const char16_t *s, const char16_t *limit,
SortKeyByteSink &sink, UErrorCode &errorCode) const;
const CollationSettings &getDefaultSettings() const;
diff --git a/deps/icu-small/source/i18n/unicode/timezone.h b/deps/icu-small/source/i18n/unicode/timezone.h
index 58c84d062b..d4cd7cb36d 100644
--- a/deps/icu-small/source/i18n/unicode/timezone.h
+++ b/deps/icu-small/source/i18n/unicode/timezone.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*************************************************************************
* Copyright (c) 1997-2016, International Business Machines Corporation
@@ -863,7 +863,7 @@ private:
* @param id zone id string
* @return the pointer of the ID resource, or NULL.
*/
- static const UChar* findID(const UnicodeString& id);
+ static const char16_t* findID(const UnicodeString& id);
/**
* Resolve a link in Olson tzdata. When the given id is known and it's not a link,
@@ -873,7 +873,7 @@ private:
* @param id zone id string
* @return the dereferenced zone or NULL
*/
- static const UChar* dereferOlsonLink(const UnicodeString& id);
+ static const char16_t* dereferOlsonLink(const UnicodeString& id);
/**
* Returns the region code associated with the given zone,
@@ -881,7 +881,7 @@ private:
* @param id zone id string
* @return the region associated with the given zone
*/
- static const UChar* getRegion(const UnicodeString& id);
+ static const char16_t* getRegion(const UnicodeString& id);
public:
#ifndef U_HIDE_INTERNAL_API
@@ -893,7 +893,7 @@ private:
* @return the region associated with the given zone
* @internal
*/
- static const UChar* getRegion(const UnicodeString& id, UErrorCode& status);
+ static const char16_t* getRegion(const UnicodeString& id, UErrorCode& status);
#endif /* U_HIDE_INTERNAL_API */
private:
diff --git a/deps/icu-small/source/i18n/unicode/tmunit.h b/deps/icu-small/source/i18n/unicode/tmunit.h
index a19a1f3c17..fa59f10473 100644
--- a/deps/icu-small/source/i18n/unicode/tmunit.h
+++ b/deps/icu-small/source/i18n/unicode/tmunit.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/tmutamt.h b/deps/icu-small/source/i18n/unicode/tmutamt.h
index 887150121f..1717b7605f 100644
--- a/deps/icu-small/source/i18n/unicode/tmutamt.h
+++ b/deps/icu-small/source/i18n/unicode/tmutamt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/tmutfmt.h b/deps/icu-small/source/i18n/unicode/tmutfmt.h
index b90d4a096d..8f245859a6 100644
--- a/deps/icu-small/source/i18n/unicode/tmutfmt.h
+++ b/deps/icu-small/source/i18n/unicode/tmutfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/translit.h b/deps/icu-small/source/i18n/unicode/translit.h
index 1e49bfb969..dc31d97bc6 100644
--- a/deps/icu-small/source/i18n/unicode/translit.h
+++ b/deps/icu-small/source/i18n/unicode/translit.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -1319,7 +1319,7 @@ inline int32_t Transliterator::getMaximumContextLength(void) const {
inline void Transliterator::setID(const UnicodeString& id) {
ID = id;
// NUL-terminate the ID string, which is a non-aliased copy.
- ID.append((UChar)0);
+ ID.append((char16_t)0);
ID.truncate(ID.length()-1);
}
diff --git a/deps/icu-small/source/i18n/unicode/tzfmt.h b/deps/icu-small/source/i18n/unicode/tzfmt.h
index dd86f1b48c..633cd8dc69 100644
--- a/deps/icu-small/source/i18n/unicode/tzfmt.h
+++ b/deps/icu-small/source/i18n/unicode/tzfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -942,7 +942,7 @@ private:
* @param parsedLen the parsed length, or 0 on failure.
* @return the parsed offset in milliseconds.
*/
- int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, UChar separator,
+ int32_t parseDefaultOffsetFields(const UnicodeString& text, int32_t start, char16_t separator,
int32_t& parsedLen) const;
/**
@@ -982,7 +982,7 @@ private:
* @param maxFields The maximum fields
* @return The offset string
*/
- static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, UChar sep,
+ static UnicodeString& formatOffsetWithAsciiDigits(int32_t offset, char16_t sep,
OffsetFields minFields, OffsetFields maxFields, UnicodeString& result);
/**
@@ -1012,7 +1012,7 @@ private:
* @param maxFields The maximum Fields to be parsed
* @return Parsed offset, 0 or positive number.
*/
- static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, UChar sep,
+ static int32_t parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, char16_t sep,
OffsetFields minFields, OffsetFields maxFields);
/**
diff --git a/deps/icu-small/source/i18n/unicode/tznames.h b/deps/icu-small/source/i18n/unicode/tznames.h
index 8861a7d026..60f0e5e4a1 100644
--- a/deps/icu-small/source/i18n/unicode/tznames.h
+++ b/deps/icu-small/source/i18n/unicode/tznames.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/tzrule.h b/deps/icu-small/source/i18n/unicode/tzrule.h
index 5e020bc1a3..171486f1c7 100644
--- a/deps/icu-small/source/i18n/unicode/tzrule.h
+++ b/deps/icu-small/source/i18n/unicode/tzrule.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/tztrans.h b/deps/icu-small/source/i18n/unicode/tztrans.h
index b2e09999bb..1276d67c31 100644
--- a/deps/icu-small/source/i18n/unicode/tztrans.h
+++ b/deps/icu-small/source/i18n/unicode/tztrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/ucal.h b/deps/icu-small/source/i18n/unicode/ucal.h
index 18522f6475..10d8bc5274 100644
--- a/deps/icu-small/source/i18n/unicode/ucal.h
+++ b/deps/icu-small/source/i18n/unicode/ucal.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -425,8 +425,8 @@ enum UCalendarDateFields {
*/
UCAL_IS_LEAP_MONTH,
- // Do not conditionalize with #ifndef U_HIDE_DEPRECATED_API,
- // it is needed for layout of Calendar, DateFormat, and other objects
+ /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
+ * it is needed for layout of Calendar, DateFormat, and other objects */
/**
* One more than the highest normal UCalendarDateFields value.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
diff --git a/deps/icu-small/source/i18n/unicode/ucol.h b/deps/icu-small/source/i18n/unicode/ucol.h
index 0b3fab90b1..b5bacbfcb4 100644
--- a/deps/icu-small/source/i18n/unicode/ucol.h
+++ b/deps/icu-small/source/i18n/unicode/ucol.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -131,7 +131,7 @@ typedef enum {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UCOL_ATTRIBUTE_VALUE_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UColAttributeValue;
/**
@@ -204,7 +204,7 @@ typedef enum {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UCOL_REORDER_CODE_LIMIT = 0x1005
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UColReorderCode;
/**
@@ -342,8 +342,8 @@ typedef enum {
*/
UCOL_NUMERIC_COLLATION = UCOL_STRENGTH + 2,
- // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
- // it is needed for layout of RuleBasedCollator object.
+ /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
+ * it is needed for layout of RuleBasedCollator object. */
/**
* One more than the highest normal UColAttribute value.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
@@ -1067,7 +1067,7 @@ typedef enum {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UCOL_BOUND_VALUE_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UColBoundMode;
/**
diff --git a/deps/icu-small/source/i18n/unicode/ucoleitr.h b/deps/icu-small/source/i18n/unicode/ucoleitr.h
index 89fd9e85cf..1d644fc259 100644
--- a/deps/icu-small/source/i18n/unicode/ucoleitr.h
+++ b/deps/icu-small/source/i18n/unicode/ucoleitr.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/ucsdet.h b/deps/icu-small/source/i18n/unicode/ucsdet.h
index a926d2f22c..7a8564f9ea 100644
--- a/deps/icu-small/source/i18n/unicode/ucsdet.h
+++ b/deps/icu-small/source/i18n/unicode/ucsdet.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: ucsdet.h
- * encoding: US-ASCII
+ * encoding: UTF-8
* indentation:4
*
* created on: 2005Aug04
@@ -45,6 +45,10 @@
* in a single language, and a minimum of a few hundred bytes worth of plain text
* in the language are needed. The detection process will attempt to
* ignore html or xml style markup that could otherwise obscure the content.
+ * <p>
+ * An alternative to the ICU Charset Detector is the
+ * Compact Encoding Detector, https://github.com/google/compact_enc_det.
+ * It often gives more accurate results, especially with short input samples.
*/
@@ -395,7 +399,7 @@ ucsdet_getDetectableCharsets(const UCharsetDetector *ucsd, UErrorCode *status);
/**
* Enable or disable individual charset encoding.
* A name of charset encoding must be included in the names returned by
- * {@link #getAllDetectableCharsets()}.
+ * {@link #ucsdet_getAllDetectableCharsets()}.
*
* @param ucsd a Charset detector.
* @param encoding encoding the name of charset encoding.
diff --git a/deps/icu-small/source/i18n/unicode/udat.h b/deps/icu-small/source/i18n/unicode/udat.h
index cacfbe8500..90aff20df2 100644
--- a/deps/icu-small/source/i18n/unicode/udat.h
+++ b/deps/icu-small/source/i18n/unicode/udat.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -763,21 +763,19 @@ typedef enum UDateFormatField {
UDAT_RELATED_YEAR_FIELD = 34,
#endif /* U_HIDE_INTERNAL_API */
-#ifndef U_HIDE_DRAFT_API
/**
* FieldPosition selector for 'b' field alignment.
* Displays midnight and noon for 12am and 12pm, respectively, if available;
* otherwise fall back to AM / PM.
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_AM_PM_MIDNIGHT_NOON_FIELD = 35,
/* FieldPosition selector for 'B' field alignment.
* Displays flexible day periods, such as "in the morning", if available.
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_FLEXIBLE_DAY_PERIOD_FIELD = 36,
-#endif /* U_HIDE_DRAFT_API */
#ifndef U_HIDE_INTERNAL_API
/**
@@ -797,7 +795,7 @@ typedef enum UDateFormatField {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UDAT_FIELD_COUNT = 38
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UDateFormatField;
@@ -819,7 +817,7 @@ typedef enum UDateFormatField {
* of error (e.g., the input field is UDAT_FIELD_COUNT).
* @stable ICU 4.4
*/
-U_STABLE UCalendarDateFields U_EXPORT2
+U_CAPI UCalendarDateFields U_EXPORT2
udat_toCalendarDateField(UDateFormatField field);
@@ -851,7 +849,7 @@ udat_toCalendarDateField(UDateFormatField field);
* an error occurred.
* @stable ICU 2.0
*/
-U_STABLE UDateFormat* U_EXPORT2
+U_CAPI UDateFormat* U_EXPORT2
udat_open(UDateFormatStyle timeStyle,
UDateFormatStyle dateStyle,
const char *locale,
@@ -868,7 +866,7 @@ udat_open(UDateFormatStyle timeStyle,
* @param format The formatter to close.
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_close(UDateFormat* format);
@@ -902,8 +900,8 @@ typedef enum UDateFormatBooleanAttribute {
*/
UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3,
- // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
- // it is needed for layout of DateFormat object.
+ /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
+ * it is needed for layout of DateFormat object. */
/**
* One more than the highest normal UDateFormatBooleanAttribute value.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
@@ -921,7 +919,7 @@ typedef enum UDateFormatBooleanAttribute {
* @return The value of attr.
* @stable ICU 53
*/
-U_STABLE UBool U_EXPORT2
+U_CAPI UBool U_EXPORT2
udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status);
/**
@@ -934,7 +932,7 @@ udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute att
* @param status A pointer to an UErrorCode to receive any errors
* @stable ICU 53
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status);
@@ -966,7 +964,7 @@ U_NAMESPACE_END
* @return A pointer to a UDateFormat identical to fmt.
* @stable ICU 2.0
*/
-U_STABLE UDateFormat* U_EXPORT2
+U_CAPI UDateFormat* U_EXPORT2
udat_clone(const UDateFormat *fmt,
UErrorCode *status);
@@ -988,7 +986,7 @@ udat_clone(const UDateFormat *fmt,
* @see UFieldPosition
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_format( const UDateFormat* format,
UDate dateToFormat,
UChar* result,
@@ -1018,7 +1016,7 @@ udat_format( const UDateFormat* format,
* @see UFieldPosition
* @stable ICU 55
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_formatCalendar( const UDateFormat* format,
UCalendar* calendar,
UChar* result,
@@ -1053,7 +1051,7 @@ udat_formatCalendar( const UDateFormat* format,
* @see UFieldPositionIterator
* @stable ICU 55
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_formatForFields( const UDateFormat* format,
UDate dateToFormat,
UChar* result,
@@ -1091,7 +1089,7 @@ udat_formatForFields( const UDateFormat* format,
* @see UFieldPositionIterator
* @stable ICU 55
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_formatCalendarForFields( const UDateFormat* format,
UCalendar* calendar,
UChar* result,
@@ -1125,7 +1123,7 @@ udat_formatCalendarForFields( const UDateFormat* format,
* @see udat_format
* @stable ICU 2.0
*/
-U_STABLE UDate U_EXPORT2
+U_CAPI UDate U_EXPORT2
udat_parse(const UDateFormat* format,
const UChar* text,
int32_t textLength,
@@ -1153,7 +1151,7 @@ udat_parse(const UDateFormat* format,
* @see udat_format
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_parseCalendar(const UDateFormat* format,
UCalendar* calendar,
const UChar* text,
@@ -1170,7 +1168,7 @@ udat_parseCalendar(const UDateFormat* format,
* @see udat_setLenient
* @stable ICU 2.0
*/
-U_STABLE UBool U_EXPORT2
+U_CAPI UBool U_EXPORT2
udat_isLenient(const UDateFormat* fmt);
/**
@@ -1182,7 +1180,7 @@ udat_isLenient(const UDateFormat* fmt);
* @see dat_isLenient
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setLenient( UDateFormat* fmt,
UBool isLenient);
@@ -1195,7 +1193,7 @@ udat_setLenient( UDateFormat* fmt,
* @see udat_setCalendar
* @stable ICU 2.0
*/
-U_STABLE const UCalendar* U_EXPORT2
+U_CAPI const UCalendar* U_EXPORT2
udat_getCalendar(const UDateFormat* fmt);
/**
@@ -1207,7 +1205,7 @@ udat_getCalendar(const UDateFormat* fmt);
* @see udat_setCalendar
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setCalendar( UDateFormat* fmt,
const UCalendar* calendarToSet);
@@ -1220,7 +1218,7 @@ udat_setCalendar( UDateFormat* fmt,
* @see udat_setNumberFormat
* @stable ICU 2.0
*/
-U_STABLE const UNumberFormat* U_EXPORT2
+U_CAPI const UNumberFormat* U_EXPORT2
udat_getNumberFormat(const UDateFormat* fmt);
/**
@@ -1232,7 +1230,7 @@ udat_getNumberFormat(const UDateFormat* fmt);
* @see udat_setNumberFormatForField
* @stable ICU 54
*/
-U_STABLE const UNumberFormat* U_EXPORT2
+U_CAPI const UNumberFormat* U_EXPORT2
udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
/**
@@ -1250,7 +1248,7 @@ udat_getNumberFormatForField(const UDateFormat* fmt, UChar field);
* @see udat_getNumberFormatForField
* @stable ICU 54
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_adoptNumberFormatForFields( UDateFormat* fmt,
const UChar* fields,
UNumberFormat* numberFormatToSet,
@@ -1267,7 +1265,7 @@ udat_adoptNumberFormatForFields( UDateFormat* fmt,
* @see udat_setNumberFormatForField
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setNumberFormat( UDateFormat* fmt,
const UNumberFormat* numberFormatToSet);
/**
@@ -1279,7 +1277,7 @@ udat_setNumberFormat( UDateFormat* fmt,
* @see udat_getNumberFormat
* @stable ICU 54
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_adoptNumberFormat( UDateFormat* fmt,
UNumberFormat* numberFormatToAdopt);
/**
@@ -1291,7 +1289,7 @@ udat_adoptNumberFormat( UDateFormat* fmt,
* @see udat_countAvailable
* @stable ICU 2.0
*/
-U_STABLE const char* U_EXPORT2
+U_CAPI const char* U_EXPORT2
udat_getAvailable(int32_t localeIndex);
/**
@@ -1302,7 +1300,7 @@ udat_getAvailable(int32_t localeIndex);
* @see udat_getAvailable
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_countAvailable(void);
/**
@@ -1315,7 +1313,7 @@ udat_countAvailable(void);
* @see udat_Set2DigitYearStart
* @stable ICU 2.0
*/
-U_STABLE UDate U_EXPORT2
+U_CAPI UDate U_EXPORT2
udat_get2DigitYearStart( const UDateFormat *fmt,
UErrorCode *status);
@@ -1329,7 +1327,7 @@ udat_get2DigitYearStart( const UDateFormat *fmt,
* @see udat_Set2DigitYearStart
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_set2DigitYearStart( UDateFormat *fmt,
UDate d,
UErrorCode *status);
@@ -1346,7 +1344,7 @@ udat_set2DigitYearStart( UDateFormat *fmt,
* @see udat_applyPattern
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_toPattern( const UDateFormat *fmt,
UBool localized,
UChar *result,
@@ -1363,7 +1361,7 @@ udat_toPattern( const UDateFormat *fmt,
* @see udat_toPattern
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_applyPattern( UDateFormat *format,
UBool localized,
const UChar *pattern,
@@ -1489,7 +1487,7 @@ typedef struct UDateFormatSymbols UDateFormatSymbols;
* @see udat_setSymbols
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_getSymbols(const UDateFormat *fmt,
UDateFormatSymbolType type,
int32_t symbolIndex,
@@ -1509,7 +1507,7 @@ udat_getSymbols(const UDateFormat *fmt,
* @see udat_setSymbols
* @stable ICU 2.0
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
udat_countSymbols( const UDateFormat *fmt,
UDateFormatSymbolType type);
@@ -1528,7 +1526,7 @@ udat_countSymbols( const UDateFormat *fmt,
* @see udat_countSymbols
* @stable ICU 2.0
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setSymbols( UDateFormat *format,
UDateFormatSymbolType type,
int32_t symbolIndex,
@@ -1545,7 +1543,7 @@ udat_setSymbols( UDateFormat *format,
* @return the locale name
* @stable ICU 2.8
*/
-U_STABLE const char* U_EXPORT2
+U_CAPI const char* U_EXPORT2
udat_getLocaleByType(const UDateFormat *fmt,
ULocDataLocaleType type,
UErrorCode* status);
@@ -1558,7 +1556,7 @@ udat_getLocaleByType(const UDateFormat *fmt,
* @param status A pointer to an UErrorCode to receive any errors
* @stable ICU 51
*/
-U_DRAFT void U_EXPORT2
+U_CAPI void U_EXPORT2
udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status);
/**
@@ -1570,7 +1568,7 @@ udat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status);
* @return The UDisplayContextValue for the specified type.
* @stable ICU 53
*/
-U_STABLE UDisplayContext U_EXPORT2
+U_CAPI UDisplayContext U_EXPORT2
udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status);
#ifndef U_HIDE_INTERNAL_API
diff --git a/deps/icu-small/source/i18n/unicode/udateintervalformat.h b/deps/icu-small/source/i18n/unicode/udateintervalformat.h
index 81bff16d6e..70cbadeb57 100644
--- a/deps/icu-small/source/i18n/unicode/udateintervalformat.h
+++ b/deps/icu-small/source/i18n/unicode/udateintervalformat.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/udatpg.h b/deps/icu-small/source/i18n/unicode/udatpg.h
index 365d51c493..9e3bdd4114 100644
--- a/deps/icu-small/source/i18n/unicode/udatpg.h
+++ b/deps/icu-small/source/i18n/unicode/udatpg.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: udatpg.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -86,8 +86,8 @@ typedef enum UDateTimePatternField {
/** @stable ICU 3.8 */
UDATPG_ZONE_FIELD,
- // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
- // it is needed for layout of DateTimePatternGenerator object.
+ /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
+ * it is needed for layout of DateTimePatternGenerator object. */
/**
* One more than the highest normal UDateTimePatternField value.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
diff --git a/deps/icu-small/source/i18n/unicode/ufieldpositer.h b/deps/icu-small/source/i18n/unicode/ufieldpositer.h
index 8dfa3df5a4..3ae73b6d84 100644
--- a/deps/icu-small/source/i18n/unicode/ufieldpositer.h
+++ b/deps/icu-small/source/i18n/unicode/ufieldpositer.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/uformattable.h b/deps/icu-small/source/i18n/unicode/uformattable.h
index e4683d56c3..9ba2a36901 100644
--- a/deps/icu-small/source/i18n/unicode/uformattable.h
+++ b/deps/icu-small/source/i18n/unicode/uformattable.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -57,7 +57,7 @@ typedef enum UFormattableType {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UFMT_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UFormattableType;
diff --git a/deps/icu-small/source/i18n/unicode/ugender.h b/deps/icu-small/source/i18n/unicode/ugender.h
index c1e591ed28..d015a2300c 100644
--- a/deps/icu-small/source/i18n/unicode/ugender.h
+++ b/deps/icu-small/source/i18n/unicode/ugender.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/ulocdata.h b/deps/icu-small/source/i18n/unicode/ulocdata.h
index ecf6fdcb3f..de8d8539c6 100644
--- a/deps/icu-small/source/i18n/unicode/ulocdata.h
+++ b/deps/icu-small/source/i18n/unicode/ulocdata.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -8,7 +8,7 @@
* *
******************************************************************************
* file name: ulocdata.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@@ -55,7 +55,7 @@ typedef enum ULocaleDataExemplarSetType {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
ULOCDATA_ES_COUNT=4
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} ULocaleDataExemplarSetType;
/** The possible types of delimiters.
@@ -76,7 +76,7 @@ typedef enum ULocaleDataDelimiterType {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
ULOCDATA_DELIMITER_COUNT = 4
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} ULocaleDataDelimiterType;
/**
@@ -207,7 +207,7 @@ typedef enum UMeasurementSystem {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UMS_LIMIT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UMeasurementSystem;
/**
diff --git a/deps/icu-small/source/i18n/unicode/umsg.h b/deps/icu-small/source/i18n/unicode/umsg.h
index 0beb39d5ab..6818820612 100644
--- a/deps/icu-small/source/i18n/unicode/umsg.h
+++ b/deps/icu-small/source/i18n/unicode/umsg.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
@@ -8,7 +8,7 @@
********************************************************************
*
* file name: umsg.h
- * encoding: US-ASCII
+ * encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/unicode/unirepl.h b/deps/icu-small/source/i18n/unicode/unirepl.h
index 37815a9a24..8fb25d4689 100644
--- a/deps/icu-small/source/i18n/unicode/unirepl.h
+++ b/deps/icu-small/source/i18n/unicode/unirepl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/unum.h b/deps/icu-small/source/i18n/unicode/unum.h
index 7c652e09cf..5fc65486fc 100644
--- a/deps/icu-small/source/i18n/unicode/unum.h
+++ b/deps/icu-small/source/i18n/unicode/unum.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -25,6 +25,7 @@
#include "unicode/parseerr.h"
#include "unicode/uformattable.h"
#include "unicode/udisplaycontext.h"
+#include "unicode/ufieldpositer.h"
/**
* \file
@@ -249,7 +250,7 @@ typedef enum UNumberFormatStyle {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UNUM_FORMAT_STYLE_COUNT=17,
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
/**
* Default format
@@ -326,8 +327,8 @@ enum UCurrencySpacing {
/** @stable ICU 4.8 */
UNUM_CURRENCY_INSERT,
- // Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
- // it is needed for layout of DecimalFormatSymbols object.
+ /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API,
+ * it is needed for layout of DecimalFormatSymbols object. */
/**
* One more than the highest normal UCurrencySpacing value.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
@@ -371,7 +372,7 @@ typedef enum UNumberFormatFields {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UNUM_FIELD_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UNumberFormatFields;
@@ -553,6 +554,59 @@ unum_formatDouble( const UNumberFormat* fmt,
UFieldPosition *pos, /* 0 if ignore */
UErrorCode* status);
+#ifndef U_HIDE_DRAFT_API
+/**
+* Format a double using a UNumberFormat according to the UNumberFormat's locale,
+* and initialize a UFieldPositionIterator that enumerates the subcomponents of
+* the resulting string.
+*
+* @param format
+* The formatter to use.
+* @param number
+* The number to format.
+* @param result
+* A pointer to a buffer to receive the NULL-terminated formatted
+* number. If the formatted number fits into dest but cannot be
+* NULL-terminated (length == resultLength) then the error code is set
+* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't
+* fit into result then the error code is set to
+* U_BUFFER_OVERFLOW_ERROR.
+* @param resultLength
+* The maximum size of result.
+* @param fpositer
+* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open}
+* (may be NULL if field position information is not needed, but in this
+* case it's preferable to use {@link #unum_formatDouble}). Iteration
+* information already present in the UFieldPositionIterator is deleted,
+* and the iterator is reset to apply to the fields in the formatted
+* string created by this function call. The field values and indexes
+* returned by {@link #ufieldpositer_next} represent fields denoted by
+* the UNumberFormatFields enum. Fields are not returned in a guaranteed
+* order. Fields cannot overlap, but they may nest. For example, 1234
+* could format as "1,234" which might consist of a grouping separator
+* field for ',' and an integer field encompassing the entire string.
+* @param status
+* A pointer to an UErrorCode to receive any errors
+* @return
+* The total buffer size needed; if greater than resultLength, the
+* output was truncated.
+* @see unum_formatDouble
+* @see unum_parse
+* @see unum_parseDouble
+* @see UFieldPositionIterator
+* @see UNumberFormatFields
+* @draft ICU 59
+*/
+U_DRAFT int32_t U_EXPORT2
+unum_formatDoubleForFields(const UNumberFormat* format,
+ double number,
+ UChar* result,
+ int32_t resultLength,
+ UFieldPositionIterator* fpositer,
+ UErrorCode* status);
+
+#endif /* U_HIDE_DRAFT_API */
+
/**
* Format a decimal number using a UNumberFormat.
* The number will be formatted according to the UNumberFormat's locale.
@@ -1291,7 +1345,7 @@ typedef enum UNumberFormatSymbol {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UNUM_FORMAT_SYMBOL_COUNT = 28
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UNumberFormatSymbol;
/**
diff --git a/deps/icu-small/source/i18n/unicode/unumsys.h b/deps/icu-small/source/i18n/unicode/unumsys.h
index 396d55d6b7..2c794c23d3 100644
--- a/deps/icu-small/source/i18n/unicode/unumsys.h
+++ b/deps/icu-small/source/i18n/unicode/unumsys.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/upluralrules.h b/deps/icu-small/source/i18n/unicode/upluralrules.h
index 52e34d8d25..99d93a4e05 100644
--- a/deps/icu-small/source/i18n/unicode/upluralrules.h
+++ b/deps/icu-small/source/i18n/unicode/upluralrules.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
@@ -15,6 +15,10 @@
#if !UCONFIG_NO_FORMATTING
#include "unicode/localpointer.h"
+#include "unicode/uenum.h"
+#ifndef U_HIDE_INTERNAL_API
+#include "unicode/unum.h"
+#endif /* U_HIDE_INTERNAL_API */
/**
* \file
@@ -60,7 +64,7 @@ enum UPluralType {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UPLURAL_TYPE_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
};
/**
* @stable ICU 50
@@ -83,7 +87,7 @@ typedef struct UPluralRules UPluralRules; /**< C typedef for struct UPluralRule
* @return A UPluralRules for the specified locale, or NULL if an error occurred.
* @stable ICU 4.8
*/
-U_STABLE UPluralRules* U_EXPORT2
+U_CAPI UPluralRules* U_EXPORT2
uplrules_open(const char *locale, UErrorCode *status);
/**
@@ -95,7 +99,7 @@ uplrules_open(const char *locale, UErrorCode *status);
* @return A UPluralRules for the specified locale, or NULL if an error occurred.
* @stable ICU 50
*/
-U_DRAFT UPluralRules* U_EXPORT2
+U_CAPI UPluralRules* U_EXPORT2
uplrules_openForType(const char *locale, UPluralType type, UErrorCode *status);
/**
@@ -103,7 +107,7 @@ uplrules_openForType(const char *locale, UPluralType type, UErrorCode *status);
* @param uplrules The UPluralRules object to close.
* @stable ICU 4.8
*/
-U_STABLE void U_EXPORT2
+U_CAPI void U_EXPORT2
uplrules_close(UPluralRules *uplrules);
@@ -138,12 +142,55 @@ U_NAMESPACE_END
* @return The length of keyword.
* @stable ICU 4.8
*/
-U_STABLE int32_t U_EXPORT2
+U_CAPI int32_t U_EXPORT2
uplrules_select(const UPluralRules *uplrules,
double number,
UChar *keyword, int32_t capacity,
UErrorCode *status);
+#ifndef U_HIDE_INTERNAL_API
+/**
+ * Given a number, returns the keyword of the first rule that applies to the
+ * number, according to the UPluralRules object and given the number format
+ * specified by the UNumberFormat object.
+ * Note: This internal preview interface may be removed in the future if
+ * an architecturally cleaner solution reaches stable status.
+ * @param uplrules The UPluralRules object specifying the rules.
+ * @param number The number for which the rule has to be determined.
+ * @param fmt The UNumberFormat specifying how the number will be formatted
+ * (this can affect the plural form, e.g. "1 dollar" vs "1.0 dollars").
+ * If this is NULL, the function behaves like uplrules_select.
+ * @param keyword The keyword of the rule that applies to number.
+ * @param capacity The capacity of the keyword buffer.
+ * @param status A pointer to a UErrorCode to receive any errors.
+ * @return The length of keyword.
+ * @internal ICU 59 technology preview, may be removed in the future
+ */
+U_INTERNAL int32_t U_EXPORT2
+uplrules_selectWithFormat(const UPluralRules *uplrules,
+ double number,
+ const UNumberFormat *fmt,
+ UChar *keyword, int32_t capacity,
+ UErrorCode *status);
+
+#endif /* U_HIDE_INTERNAL_API */
+
+#ifndef U_HIDE_DRAFT_API
+/**
+ * Creates a string enumeration of all plural rule keywords used in this
+ * UPluralRules object. The rule "other" is always present by default.
+ * @param uplrules The UPluralRules object specifying the rules for
+ * a given locale.
+ * @param status A pointer to a UErrorCode to receive any errors.
+ * @return a string enumeration over plural rule keywords, or NULL
+ * upon error. The caller is responsible for closing the result.
+ * @draft ICU 59
+ */
+U_DRAFT UEnumeration* U_EXPORT2
+uplrules_getKeywords(const UPluralRules *uplrules,
+ UErrorCode *status);
+#endif /* U_HIDE_DRAFT_API */
+
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif
diff --git a/deps/icu-small/source/i18n/unicode/uregex.h b/deps/icu-small/source/i18n/unicode/uregex.h
index 7806a74afc..69c0eead95 100644
--- a/deps/icu-small/source/i18n/unicode/uregex.h
+++ b/deps/icu-small/source/i18n/unicode/uregex.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -6,7 +6,7 @@
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: uregex.h
-* encoding: US-ASCII
+* encoding: UTF-8
* indentation:4
*
* created on: 2004mar09
diff --git a/deps/icu-small/source/i18n/unicode/uregion.h b/deps/icu-small/source/i18n/unicode/uregion.h
index b5d03691ca..9d0c1e99de 100644
--- a/deps/icu-small/source/i18n/unicode/uregion.h
+++ b/deps/icu-small/source/i18n/unicode/uregion.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
@@ -113,7 +113,7 @@ typedef enum URegionType {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
URGN_LIMIT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} URegionType;
#if !UCONFIG_NO_FORMATTING
diff --git a/deps/icu-small/source/i18n/unicode/ureldatefmt.h b/deps/icu-small/source/i18n/unicode/ureldatefmt.h
index fad8ffd9e1..0eff80a16b 100644
--- a/deps/icu-small/source/i18n/unicode/ureldatefmt.h
+++ b/deps/icu-small/source/i18n/unicode/ureldatefmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
@@ -34,7 +34,7 @@
* for determining which unit to use, such as deciding between "in 7 days"
* and "in 1 week".
*
- * @draft ICU 57
+ * @stable ICU 57
*/
/**
@@ -66,104 +66,103 @@ typedef enum UDateRelativeDateTimeFormatterStyle {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UDAT_STYLE_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} UDateRelativeDateTimeFormatterStyle;
-#ifndef U_HIDE_DRAFT_API
/**
* Represents the unit for formatting a relative date. e.g "in 5 days"
* or "next year"
- * @draft ICU 57
+ * @stable ICU 57
*/
typedef enum URelativeDateTimeUnit {
/**
* Specifies that relative unit is year, e.g. "last year",
* "in 5 years".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_YEAR,
/**
* Specifies that relative unit is quarter, e.g. "last quarter",
* "in 5 quarters".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_QUARTER,
/**
* Specifies that relative unit is month, e.g. "last month",
* "in 5 months".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_MONTH,
/**
* Specifies that relative unit is week, e.g. "last week",
* "in 5 weeks".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_WEEK,
/**
* Specifies that relative unit is day, e.g. "yesterday",
* "in 5 days".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_DAY,
/**
* Specifies that relative unit is hour, e.g. "1 hour ago",
* "in 5 hours".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_HOUR,
/**
* Specifies that relative unit is minute, e.g. "1 minute ago",
* "in 5 minutes".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_MINUTE,
/**
* Specifies that relative unit is second, e.g. "1 second ago",
* "in 5 seconds".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_SECOND,
/**
* Specifies that relative unit is Sunday, e.g. "last Sunday",
* "this Sunday", "next Sunday", "in 5 Sundays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_SUNDAY,
/**
* Specifies that relative unit is Monday, e.g. "last Monday",
* "this Monday", "next Monday", "in 5 Mondays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_MONDAY,
/**
* Specifies that relative unit is Tuesday, e.g. "last Tuesday",
* "this Tuesday", "next Tuesday", "in 5 Tuesdays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_TUESDAY,
/**
* Specifies that relative unit is Wednesday, e.g. "last Wednesday",
* "this Wednesday", "next Wednesday", "in 5 Wednesdays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_WEDNESDAY,
/**
* Specifies that relative unit is Thursday, e.g. "last Thursday",
* "this Thursday", "next Thursday", "in 5 Thursdays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_THURSDAY,
/**
* Specifies that relative unit is Friday, e.g. "last Friday",
* "this Friday", "next Friday", "in 5 Fridays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_FRIDAY,
/**
* Specifies that relative unit is Saturday, e.g. "last Saturday",
* "this Saturday", "next Saturday", "in 5 Saturdays".
- * @draft ICU 57
+ * @stable ICU 57
*/
UDAT_REL_UNIT_SATURDAY,
#ifndef U_HIDE_DEPRECATED_API
@@ -172,18 +171,15 @@ typedef enum URelativeDateTimeUnit {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
UDAT_REL_UNIT_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} URelativeDateTimeUnit;
-#endif /* U_HIDE_DRAFT_API */
-
-#ifndef U_HIDE_DRAFT_API
/**
* Opaque URelativeDateTimeFormatter object for use in C programs.
- * @draft ICU 57
+ * @stable ICU 57
*/
struct URelativeDateTimeFormatter;
-typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @draft ICU 57 */
+typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C typedef for struct URelativeDateTimeFormatter. @stable ICU 57 */
/**
@@ -216,9 +212,9 @@ typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter; /**< C ty
* @return
* A pointer to a URelativeDateTimeFormatter object for the specified locale,
* or NULL if an error occurred.
- * @draft ICU 57
+ * @stable ICU 57
*/
-U_DRAFT URelativeDateTimeFormatter* U_EXPORT2
+U_STABLE URelativeDateTimeFormatter* U_EXPORT2
ureldatefmt_open( const char* locale,
UNumberFormat* nfToAdopt,
UDateRelativeDateTimeFormatterStyle width,
@@ -229,9 +225,9 @@ ureldatefmt_open( const char* locale,
* Close a URelativeDateTimeFormatter object. Once closed it may no longer be used.
* @param reldatefmt
* The URelativeDateTimeFormatter object to close.
- * @draft ICU 57
+ * @stable ICU 57
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
#if U_SHOW_CPLUSPLUS_API
@@ -245,7 +241,7 @@ U_NAMESPACE_BEGIN
*
* @see LocalPointerBase
* @see LocalPointer
- * @draft ICU 57
+ * @stable ICU 57
*/
U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
@@ -279,9 +275,9 @@ U_NAMESPACE_END
* @return
* The length of the formatted result; may be greater
* than resultCapacity, in which case an error is returned.
- * @draft ICU 57
+ * @stable ICU 57
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
double offset,
URelativeDateTimeUnit unit,
@@ -315,9 +311,9 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
* @return
* The length of the formatted result; may be greater
* than resultCapacity, in which case an error is returned.
- * @draft ICU 57
+ * @stable ICU 57
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
double offset,
URelativeDateTimeUnit unit,
@@ -352,9 +348,9 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
* @return
* The length of the formatted result; may be greater than resultCapacity,
* in which case an error is returned.
- * @draft ICU 57
+ * @stable ICU 57
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
const UChar * relativeDateString,
int32_t relativeDateStringLen,
@@ -364,8 +360,6 @@ ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
int32_t resultCapacity,
UErrorCode* status );
-#endif /* U_HIDE_DRAFT_API */
-
#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */
#endif
diff --git a/deps/icu-small/source/i18n/unicode/usearch.h b/deps/icu-small/source/i18n/unicode/usearch.h
index dcdb7fe420..600f9142b4 100644
--- a/deps/icu-small/source/i18n/unicode/usearch.h
+++ b/deps/icu-small/source/i18n/unicode/usearch.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@@ -196,7 +196,7 @@ typedef enum {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
USEARCH_ATTRIBUTE_COUNT = 3
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} USearchAttribute;
/**
@@ -272,7 +272,7 @@ typedef enum {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
USEARCH_ATTRIBUTE_VALUE_COUNT
-#endif // U_HIDE_DEPRECATED_API
+#endif /* U_HIDE_DEPRECATED_API */
} USearchAttributeValue;
/* open and close ------------------------------------------------------ */
diff --git a/deps/icu-small/source/i18n/unicode/uspoof.h b/deps/icu-small/source/i18n/unicode/uspoof.h
index 40b73380c5..6c2ac5e109 100644
--- a/deps/icu-small/source/i18n/unicode/uspoof.h
+++ b/deps/icu-small/source/i18n/unicode/uspoof.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
***************************************************************************
@@ -6,7 +6,7 @@
* and others. All Rights Reserved.
***************************************************************************
* file name: uspoof.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/unicode/utmscale.h b/deps/icu-small/source/i18n/unicode/utmscale.h
index 6b4b389ac8..2392c6414e 100644
--- a/deps/icu-small/source/i18n/unicode/utmscale.h
+++ b/deps/icu-small/source/i18n/unicode/utmscale.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -283,10 +283,14 @@ typedef enum UDateTimeScale {
*/
UDTS_UNIX_MICROSECONDS_TIME,
+#ifndef U_HIDE_DEPRECATED_API
/**
* The first unused time scale value. The limit of this enum
+ * @deprecated ICU 59 The numeric value may change over time, see ICU ticket #12420.
*/
UDTS_MAX_SCALE
+#endif /* U_HIDE_DEPRECATED_API */
+
} UDateTimeScale;
/**
@@ -423,12 +427,15 @@ typedef enum UTimeScaleValue {
#endif /* U_HIDE_INTERNAL_API */
+#ifndef U_HIDE_DEPRECATED_API
/**
* The number of time scale values, in other words limit of this enum.
*
* @see utmscale_getTimeScaleValue
+ * @deprecated ICU 59 The numeric value may change over time, see ICU ticket #12420.
*/
UTSV_MAX_SCALE_VALUE=11
+#endif /* U_HIDE_DEPRECATED_API */
} UTimeScaleValue;
diff --git a/deps/icu-small/source/i18n/unicode/utrans.h b/deps/icu-small/source/i18n/unicode/utrans.h
index 661ee5d385..a4158726ca 100644
--- a/deps/icu-small/source/i18n/unicode/utrans.h
+++ b/deps/icu-small/source/i18n/unicode/utrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unicode/vtzone.h b/deps/icu-small/source/i18n/unicode/vtzone.h
index 1682a3d526..5d16177868 100644
--- a/deps/icu-small/source/i18n/unicode/vtzone.h
+++ b/deps/icu-small/source/i18n/unicode/vtzone.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/unum.cpp b/deps/icu-small/source/i18n/unum.cpp
index 0e224858db..95c744c128 100644
--- a/deps/icu-small/source/i18n/unum.cpp
+++ b/deps/icu-small/source/i18n/unum.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -247,6 +247,33 @@ unum_formatDouble( const UNumberFormat* fmt,
return res.extract(result, resultLength, *status);
}
+U_CAPI int32_t U_EXPORT2
+unum_formatDoubleForFields(const UNumberFormat* format,
+ double number,
+ UChar* result,
+ int32_t resultLength,
+ UFieldPositionIterator* fpositer,
+ UErrorCode* status)
+{
+ if (U_FAILURE(*status))
+ return -1;
+
+ if (result == NULL ? resultLength != 0 : resultLength < 0) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return -1;
+ }
+
+ UnicodeString res;
+ if (result != NULL) {
+ // NULL destination for pure preflighting: empty dummy string
+ // otherwise, alias the destination buffer
+ res.setTo(result, 0, resultLength);
+ }
+
+ ((const NumberFormat*)format)->format(number, res, (FieldPositionIterator*)fpositer, *status);
+
+ return res.extract(result, resultLength, *status);
+}
U_CAPI int32_t U_EXPORT2
unum_formatDecimal(const UNumberFormat* fmt,
diff --git a/deps/icu-small/source/i18n/unumsys.cpp b/deps/icu-small/source/i18n/unumsys.cpp
index f643e342eb..4a0d0fa3b6 100644
--- a/deps/icu-small/source/i18n/unumsys.cpp
+++ b/deps/icu-small/source/i18n/unumsys.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/upluralrules.cpp b/deps/icu-small/source/i18n/upluralrules.cpp
index 5e1eebf53d..24e74e3ee2 100644
--- a/deps/icu-small/source/i18n/upluralrules.cpp
+++ b/deps/icu-small/source/i18n/upluralrules.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
@@ -15,6 +15,8 @@
#include "unicode/plurrule.h"
#include "unicode/locid.h"
#include "unicode/unistr.h"
+#include "unicode/unum.h"
+#include "unicode/numfmt.h"
U_NAMESPACE_USE
@@ -54,5 +56,48 @@ uplrules_select(const UPluralRules *uplrules,
return result.extract(keyword, capacity, *status);
}
+U_CAPI int32_t U_EXPORT2
+uplrules_selectWithFormat(const UPluralRules *uplrules,
+ double number,
+ const UNumberFormat *fmt,
+ UChar *keyword, int32_t capacity,
+ UErrorCode *status)
+{
+ if (U_FAILURE(*status)) {
+ return 0;
+ }
+ const PluralRules* plrules = reinterpret_cast<const PluralRules*>(uplrules);
+ const NumberFormat* nf = reinterpret_cast<const NumberFormat*>(fmt);
+ if (plrules == NULL || nf == NULL || ((keyword == NULL)? capacity != 0 : capacity < 0)) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return 0;
+ }
+ Formattable obj(number);
+ UnicodeString result = plrules->select(obj, *nf, *status);
+ return result.extract(keyword, capacity, *status);
+}
+
+U_CAPI UEnumeration* U_EXPORT2
+uplrules_getKeywords(const UPluralRules *uplrules,
+ UErrorCode *status)
+{
+ if (U_FAILURE(*status)) {
+ return NULL;
+ }
+ const PluralRules* plrules = reinterpret_cast<const PluralRules*>(uplrules);
+ if (plrules == NULL) {
+ *status = U_ILLEGAL_ARGUMENT_ERROR;
+ return NULL;
+ }
+ StringEnumeration *senum = plrules->getKeywords(*status);
+ if (U_FAILURE(*status)) {
+ return NULL;
+ }
+ if (senum == NULL) {
+ *status = U_MEMORY_ALLOCATION_ERROR;
+ return NULL;
+ }
+ return uenum_openFromStringEnumeration(senum, status);
+}
#endif /* #if !UCONFIG_NO_FORMATTING */
diff --git a/deps/icu-small/source/i18n/uregex.cpp b/deps/icu-small/source/i18n/uregex.cpp
index 03e2586c5f..a5dee6241d 100644
--- a/deps/icu-small/source/i18n/uregex.cpp
+++ b/deps/icu-small/source/i18n/uregex.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/uregexc.cpp b/deps/icu-small/source/i18n/uregexc.cpp
index 6d0dc2062c..8674b4f17f 100644
--- a/deps/icu-small/source/i18n/uregexc.cpp
+++ b/deps/icu-small/source/i18n/uregexc.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/uregion.cpp b/deps/icu-small/source/i18n/uregion.cpp
index 8e079ec593..79a623730c 100644
--- a/deps/icu-small/source/i18n/uregion.cpp
+++ b/deps/icu-small/source/i18n/uregion.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*****************************************************************************************
diff --git a/deps/icu-small/source/i18n/usearch.cpp b/deps/icu-small/source/i18n/usearch.cpp
index 5e1617eb3e..e1e6c28e2b 100644
--- a/deps/icu-small/source/i18n/usearch.cpp
+++ b/deps/icu-small/source/i18n/usearch.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/uspoof.cpp b/deps/icu-small/source/i18n/uspoof.cpp
index d81b5b2149..1cb726e0b0 100644
--- a/deps/icu-small/source/i18n/uspoof.cpp
+++ b/deps/icu-small/source/i18n/uspoof.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
***************************************************************************
@@ -6,7 +6,7 @@
* and others. All Rights Reserved.
***************************************************************************
* file name: uspoof.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/uspoof_build.cpp b/deps/icu-small/source/i18n/uspoof_build.cpp
index d676fe9977..7d2440e5af 100644
--- a/deps/icu-small/source/i18n/uspoof_build.cpp
+++ b/deps/icu-small/source/i18n/uspoof_build.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
***************************************************************************
@@ -6,7 +6,7 @@
* and others. All Rights Reserved.
***************************************************************************
* file name: uspoof_build.cpp
- * encoding: US-ASCII
+ * encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/uspoof_conf.cpp b/deps/icu-small/source/i18n/uspoof_conf.cpp
index 6edd1fa3f3..e5d9bb6338 100644
--- a/deps/icu-small/source/i18n/uspoof_conf.cpp
+++ b/deps/icu-small/source/i18n/uspoof_conf.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -8,7 +8,7 @@
*
******************************************************************************
* file name: uspoof_conf.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/uspoof_conf.h b/deps/icu-small/source/i18n/uspoof_conf.h
index 72cd028104..ee8aa2678e 100644
--- a/deps/icu-small/source/i18n/uspoof_conf.h
+++ b/deps/icu-small/source/i18n/uspoof_conf.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************
@@ -8,7 +8,7 @@
*
******************************************************************************
* file name: uspoof_conf.h
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
diff --git a/deps/icu-small/source/i18n/uspoof_impl.cpp b/deps/icu-small/source/i18n/uspoof_impl.cpp
index fba742c3ff..0ca85c00a9 100644
--- a/deps/icu-small/source/i18n/uspoof_impl.cpp
+++ b/deps/icu-small/source/i18n/uspoof_impl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/uspoof_impl.h b/deps/icu-small/source/i18n/uspoof_impl.h
index 62480e39e8..1184b8d906 100644
--- a/deps/icu-small/source/i18n/uspoof_impl.h
+++ b/deps/icu-small/source/i18n/uspoof_impl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
***************************************************************************
diff --git a/deps/icu-small/source/i18n/usrchimp.h b/deps/icu-small/source/i18n/usrchimp.h
index e6693d16b7..5438417e7e 100644
--- a/deps/icu-small/source/i18n/usrchimp.h
+++ b/deps/icu-small/source/i18n/usrchimp.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
diff --git a/deps/icu-small/source/i18n/utf16collationiterator.cpp b/deps/icu-small/source/i18n/utf16collationiterator.cpp
index 733729fae7..7598b0ee52 100644
--- a/deps/icu-small/source/i18n/utf16collationiterator.cpp
+++ b/deps/icu-small/source/i18n/utf16collationiterator.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/utf16collationiterator.h b/deps/icu-small/source/i18n/utf16collationiterator.h
index 505ab810d3..fd3a05e9ef 100644
--- a/deps/icu-small/source/i18n/utf16collationiterator.h
+++ b/deps/icu-small/source/i18n/utf16collationiterator.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/utf8collationiterator.cpp b/deps/icu-small/source/i18n/utf8collationiterator.cpp
index 0a0205e7b3..85d4b76b08 100644
--- a/deps/icu-small/source/i18n/utf8collationiterator.cpp
+++ b/deps/icu-small/source/i18n/utf8collationiterator.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/utf8collationiterator.h b/deps/icu-small/source/i18n/utf8collationiterator.h
index 8deb5ea395..9a3ec45aeb 100644
--- a/deps/icu-small/source/i18n/utf8collationiterator.h
+++ b/deps/icu-small/source/i18n/utf8collationiterator.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/utmscale.c b/deps/icu-small/source/i18n/utmscale.cpp
index 6868b9db22..461985937a 100644
--- a/deps/icu-small/source/i18n/utmscale.c
+++ b/deps/icu-small/source/i18n/utmscale.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/utrans.cpp b/deps/icu-small/source/i18n/utrans.cpp
index aed817ce26..62fd630d9e 100644
--- a/deps/icu-small/source/i18n/utrans.cpp
+++ b/deps/icu-small/source/i18n/utrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/valueformatter.cpp b/deps/icu-small/source/i18n/valueformatter.cpp
index 45b08f60b6..e769f369d4 100644
--- a/deps/icu-small/source/i18n/valueformatter.cpp
+++ b/deps/icu-small/source/i18n/valueformatter.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/valueformatter.h b/deps/icu-small/source/i18n/valueformatter.h
index da2dd1b337..836a05b17c 100644
--- a/deps/icu-small/source/i18n/valueformatter.h
+++ b/deps/icu-small/source/i18n/valueformatter.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/visibledigits.cpp b/deps/icu-small/source/i18n/visibledigits.cpp
index 1fea3504df..03cfc68d25 100644
--- a/deps/icu-small/source/i18n/visibledigits.cpp
+++ b/deps/icu-small/source/i18n/visibledigits.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2016, International Business Machines
diff --git a/deps/icu-small/source/i18n/visibledigits.h b/deps/icu-small/source/i18n/visibledigits.h
index cd18239a56..03c8013e39 100644
--- a/deps/icu-small/source/i18n/visibledigits.h
+++ b/deps/icu-small/source/i18n/visibledigits.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
******************************************************************************* * Copyright (C) 2015, International Business Machines
diff --git a/deps/icu-small/source/i18n/vtzone.cpp b/deps/icu-small/source/i18n/vtzone.cpp
index ba5f3bc0d7..85b42b0e06 100644
--- a/deps/icu-small/source/i18n/vtzone.cpp
+++ b/deps/icu-small/source/i18n/vtzone.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -358,7 +358,7 @@ static void millisToOffset(int32_t millis, UnicodeString& str) {
/*
* Create a default TZNAME from TZID
*/
-static void getDefaultTZName(const UnicodeString tzid, UBool isDST, UnicodeString& zonename) {
+static void getDefaultTZName(const UnicodeString &tzid, UBool isDST, UnicodeString& zonename) {
zonename = tzid;
if (isDST) {
zonename += UNICODE_STRING_SIMPLE("(DST)");
diff --git a/deps/icu-small/source/i18n/vzone.cpp b/deps/icu-small/source/i18n/vzone.cpp
index 7ee95e4ede..6db3ba04c5 100644
--- a/deps/icu-small/source/i18n/vzone.cpp
+++ b/deps/icu-small/source/i18n/vzone.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/vzone.h b/deps/icu-small/source/i18n/vzone.h
index 22a41b4e37..700687e0cb 100644
--- a/deps/icu-small/source/i18n/vzone.h
+++ b/deps/icu-small/source/i18n/vzone.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/windtfmt.cpp b/deps/icu-small/source/i18n/windtfmt.cpp
index 20ce338bb4..70a9364a0c 100644
--- a/deps/icu-small/source/i18n/windtfmt.cpp
+++ b/deps/icu-small/source/i18n/windtfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -13,7 +13,7 @@
#include "unicode/utypes.h"
-#if U_PLATFORM_HAS_WIN32_API
+#if U_PLATFORM_USES_ONLY_WIN32_API
#if !UCONFIG_NO_FORMATTING
@@ -35,7 +35,9 @@
#include "windtfmt.h"
#include "wintzimpl.h"
+#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
+#endif
# define VC_EXTRALEAN
# define NOUSER
# define NOSERVICE
@@ -92,12 +94,83 @@ UnicodeString* Win32DateFormat::getTimeDateFormat(const Calendar *cal, const Loc
return result;
}
+// TODO: This is copied in both winnmfmt.cpp and windtfmt.cpp, but really should
+// be factored out into a common helper for both.
+static UErrorCode GetEquivalentWindowsLocaleName(const Locale& locale, UnicodeString** buffer)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {};
+
+ // Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk".
+ int32_t length = uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status);
+
+ if (U_SUCCESS(status))
+ {
+ // Need it to be UTF-16, not 8-bit
+ // TODO: This seems like a good thing for a helper
+ wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {};
+ int32_t i;
+ for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++)
+ {
+ if (asciiBCP47Tag[i] == '\0')
+ {
+ break;
+ }
+ else
+ {
+ // normally just copy the character
+ bcp47Tag[i] = static_cast<wchar_t>(asciiBCP47Tag[i]);
+ }
+ }
+
+ // Ensure it's null terminated
+ if (i < (UPRV_LENGTHOF(bcp47Tag) - 1))
+ {
+ bcp47Tag[i] = L'\0';
+ }
+ else
+ {
+ // Ran out of room.
+ bcp47Tag[UPRV_LENGTHOF(bcp47Tag) - 1] = L'\0';
+ }
+
+
+ wchar_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {};
+
+ // Note: On Windows versions below 10, there is no support for locale name aliases.
+ // This means that it will fail for locales where ICU has a completely different
+ // name (like ku vs ckb), and it will also not work for alternate sort locale
+ // names like "de-DE-u-co-phonebk".
+
+ // TODO: We could add some sort of exception table for cases like ku vs ckb.
+
+ int length = ResolveLocaleName(bcp47Tag, windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName));
+
+ if (length > 0)
+ {
+ *buffer = new UnicodeString(windowsLocaleName);
+ }
+ else
+ {
+ status = U_UNSUPPORTED_ERROR;
+ }
+ }
+ return status;
+}
+
// TODO: Range-check timeStyle, dateStyle
Win32DateFormat::Win32DateFormat(DateFormat::EStyle timeStyle, DateFormat::EStyle dateStyle, const Locale &locale, UErrorCode &status)
- : DateFormat(), fDateTimeMsg(NULL), fTimeStyle(timeStyle), fDateStyle(dateStyle), fLocale(locale), fZoneID()
+ : DateFormat(), fDateTimeMsg(NULL), fTimeStyle(timeStyle), fDateStyle(dateStyle), fLocale(locale), fZoneID(), fWindowsLocaleName(nullptr)
{
if (U_SUCCESS(status)) {
- fLCID = locale.getLCID();
+ GetEquivalentWindowsLocaleName(locale, &fWindowsLocaleName);
+ // Note: In the previous code, it would look up the LCID for the locale, and if
+ // the locale was not recognized then it would get an LCID of 0, which is a
+ // synonym for LOCALE_USER_DEFAULT on Windows.
+ // If the above method fails, then fWindowsLocaleName will remain as nullptr, and
+ // then we will pass nullptr to API GetLocaleInfoEx, which is the same as passing
+ // LOCALE_USER_DEFAULT.
+
fTZI = NEW_ARRAY(TIME_ZONE_INFORMATION, 1);
uprv_memset(fTZI, 0, sizeof(TIME_ZONE_INFORMATION));
adoptCalendar(Calendar::createInstance(locale, status));
@@ -115,6 +188,7 @@ Win32DateFormat::~Win32DateFormat()
// delete fCalendar;
uprv_free(fTZI);
delete fDateTimeMsg;
+ delete fWindowsLocaleName;
}
Win32DateFormat &Win32DateFormat::operator=(const Win32DateFormat &other)
@@ -128,13 +202,14 @@ Win32DateFormat &Win32DateFormat::operator=(const Win32DateFormat &other)
this->fTimeStyle = other.fTimeStyle;
this->fDateStyle = other.fDateStyle;
this->fLocale = other.fLocale;
- this->fLCID = other.fLCID;
// this->fCalendar = other.fCalendar->clone();
this->fZoneID = other.fZoneID;
this->fTZI = NEW_ARRAY(TIME_ZONE_INFORMATION, 1);
*this->fTZI = *other.fTZI;
+ this->fWindowsLocaleName = other.fWindowsLocaleName == NULL ? NULL : new UnicodeString(*other.fWindowsLocaleName);
+
return *this;
}
@@ -231,18 +306,25 @@ static const DWORD dfFlags[] = {DATE_LONGDATE, DATE_LONGDATE, DATE_SHORTDATE, DA
void Win32DateFormat::formatDate(const SYSTEMTIME *st, UnicodeString &appendTo) const
{
- int result;
+ int result=0;
wchar_t stackBuffer[STACK_BUFFER_SIZE];
wchar_t *buffer = stackBuffer;
+ const wchar_t *localeName = nullptr;
+
+ if (fWindowsLocaleName != nullptr)
+ {
+ localeName = reinterpret_cast<const wchar_t*>(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer()));
+ }
- result = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE);
+ result = GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, STACK_BUFFER_SIZE, NULL);
if (result == 0) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
- int newLength = GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0);
+ int newLength = GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, NULL, 0, NULL);
buffer = NEW_ARRAY(wchar_t, newLength);
- GetDateFormatW(fLCID, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength);
+
+ GetDateFormatEx(localeName, dfFlags[fDateStyle - kDateOffset], st, NULL, buffer, newLength, NULL);
}
}
@@ -260,15 +342,22 @@ void Win32DateFormat::formatTime(const SYSTEMTIME *st, UnicodeString &appendTo)
int result;
wchar_t stackBuffer[STACK_BUFFER_SIZE];
wchar_t *buffer = stackBuffer;
+ const wchar_t *localeName = nullptr;
- result = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE);
+ if (fWindowsLocaleName != nullptr)
+ {
+ localeName = reinterpret_cast<const wchar_t*>(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer()));
+ }
+
+ result = GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, buffer, STACK_BUFFER_SIZE);
if (result == 0) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
- int newLength = GetTimeFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, NULL, 0);
+ int newLength = GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, NULL, 0);
buffer = NEW_ARRAY(wchar_t, newLength);
- GetDateFormatW(fLCID, tfFlags[fTimeStyle], st, NULL, buffer, newLength);
+
+ GetTimeFormatEx(localeName, tfFlags[fTimeStyle], st, NULL, buffer, newLength);
}
}
@@ -314,4 +403,4 @@ U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // U_PLATFORM_HAS_WIN32_API
+#endif // U_PLATFORM_USES_ONLY_WIN32_API
diff --git a/deps/icu-small/source/i18n/windtfmt.h b/deps/icu-small/source/i18n/windtfmt.h
index a822194370..43b6fe6dba 100644
--- a/deps/icu-small/source/i18n/windtfmt.h
+++ b/deps/icu-small/source/i18n/windtfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -16,7 +16,7 @@
#include "unicode/utypes.h"
-#if U_PLATFORM_HAS_WIN32_API
+#if U_PLATFORM_USES_ONLY_WIN32_API
#if !UCONFIG_NO_FORMATTING
@@ -95,7 +95,7 @@ public:
* <pre>
* . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() ==
- * . erived::getStaticClassID()) ...
+ * . derived::getStaticClassID()) ...
* </pre>
* @return The class ID for all objects of this class.
*/
@@ -124,15 +124,16 @@ private:
DateFormat::EStyle fTimeStyle;
DateFormat::EStyle fDateStyle;
Locale fLocale;
- int32_t fLCID;
UnicodeString fZoneID;
TIME_ZONE_INFORMATION *fTZI;
+
+ UnicodeString* fWindowsLocaleName; // Stores the equivalent Windows locale name.
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
-#endif // U_PLATFORM_HAS_WIN32_API
+#endif // U_PLATFORM_USES_ONLY_WIN32_API
#endif // __WINDTFMT
diff --git a/deps/icu-small/source/i18n/winnmfmt.cpp b/deps/icu-small/source/i18n/winnmfmt.cpp
index d7e98723bb..40b4b64776 100644
--- a/deps/icu-small/source/i18n/winnmfmt.cpp
+++ b/deps/icu-small/source/i18n/winnmfmt.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -28,7 +28,9 @@
#include "uassert.h"
#include "locmap.h"
+#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
+#endif
# define VC_EXTRALEAN
# define NOUSER
# define NOSERVICE
@@ -58,43 +60,43 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Win32NumberFormat)
* end in ";0" then the return value should be multiplied by 10.
* (e.g. "3" => 30, "3;2" => 320)
*/
-static UINT getGrouping(const char *grouping)
+static UINT getGrouping(const wchar_t *grouping)
{
UINT g = 0;
- const char *s;
+ const wchar_t *s;
- for (s = grouping; *s != '\0'; s += 1) {
- if (*s > '0' && *s < '9') {
- g = g * 10 + (*s - '0');
- } else if (*s != ';') {
+ for (s = grouping; *s != L'\0'; s += 1) {
+ if (*s > L'0' && *s < L'9') {
+ g = g * 10 + (*s - L'0');
+ } else if (*s != L';') {
break;
}
}
- if (*s != '0') {
+ if (*s != L'0') {
g *= 10;
}
return g;
}
-static void getNumberFormat(NUMBERFMTW *fmt, int32_t lcid)
+static void getNumberFormat(NUMBERFMTW *fmt, const wchar_t *windowsLocaleName)
{
- char buf[10];
+ wchar_t buf[10];
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_IDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT));
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_IDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT));
- GetLocaleInfoA(lcid, LOCALE_SGROUPING, buf, 10);
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_SGROUPING, (LPWSTR)buf, 10);
fmt->Grouping = getGrouping(buf);
fmt->lpDecimalSep = NEW_ARRAY(wchar_t, 6);
- GetLocaleInfoW(lcid, LOCALE_SDECIMAL, fmt->lpDecimalSep, 6);
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_SDECIMAL, fmt->lpDecimalSep, 6);
fmt->lpThousandSep = NEW_ARRAY(wchar_t, 6);
- GetLocaleInfoW(lcid, LOCALE_STHOUSAND, fmt->lpThousandSep, 6);
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_STHOUSAND, fmt->lpThousandSep, 6);
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_INEGNUMBER, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_INEGNUMBER, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT));
}
static void freeNumberFormat(NUMBERFMTW *fmt)
@@ -105,27 +107,27 @@ static void freeNumberFormat(NUMBERFMTW *fmt)
}
}
-static void getCurrencyFormat(CURRENCYFMTW *fmt, int32_t lcid)
+static void getCurrencyFormat(CURRENCYFMTW *fmt, const wchar_t *windowsLocaleName)
{
- char buf[10];
+ wchar_t buf[10];
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ICURRDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT));
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ICURRDIGITS, (LPWSTR) &fmt->NumDigits, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ILZERO, (LPWSTR) &fmt->LeadingZero, sizeof(UINT));
- GetLocaleInfoA(lcid, LOCALE_SMONGROUPING, buf, sizeof(buf));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONGROUPING, (LPWSTR)buf, sizeof(buf));
fmt->Grouping = getGrouping(buf);
fmt->lpDecimalSep = NEW_ARRAY(wchar_t, 6);
- GetLocaleInfoW(lcid, LOCALE_SMONDECIMALSEP, fmt->lpDecimalSep, 6);
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONDECIMALSEP, fmt->lpDecimalSep, 6);
fmt->lpThousandSep = NEW_ARRAY(wchar_t, 6);
- GetLocaleInfoW(lcid, LOCALE_SMONTHOUSANDSEP, fmt->lpThousandSep, 6);
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_SMONTHOUSANDSEP, fmt->lpThousandSep, 6);
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_INEGCURR, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT));
- GetLocaleInfoW(lcid, LOCALE_RETURN_NUMBER|LOCALE_ICURRENCY, (LPWSTR) &fmt->PositiveOrder, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_INEGCURR, (LPWSTR) &fmt->NegativeOrder, sizeof(UINT));
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_RETURN_NUMBER|LOCALE_ICURRENCY, (LPWSTR) &fmt->PositiveOrder, sizeof(UINT));
fmt->lpCurrencySymbol = NEW_ARRAY(wchar_t, 8);
- GetLocaleInfoW(lcid, LOCALE_SCURRENCY, (LPWSTR) fmt->lpCurrencySymbol, 8);
+ GetLocaleInfoEx(windowsLocaleName, LOCALE_SCURRENCY, (LPWSTR) fmt->lpCurrencySymbol, 8);
}
static void freeCurrencyFormat(CURRENCYFMTW *fmt)
@@ -137,12 +139,84 @@ static void freeCurrencyFormat(CURRENCYFMTW *fmt)
}
}
+// TODO: This is copied in both winnmfmt.cpp and windtfmt.cpp, but really should
+// be factored out into a common helper for both.
+static UErrorCode GetEquivalentWindowsLocaleName(const Locale& locale, UnicodeString** buffer)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {};
+
+ // Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk".
+ int32_t length = uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status);
+
+ if (U_SUCCESS(status))
+ {
+ // Need it to be UTF-16, not 8-bit
+ // TODO: This seems like a good thing for a helper
+ wchar_t bcp47Tag[LOCALE_NAME_MAX_LENGTH] = {};
+ int32_t i;
+ for (i = 0; i < UPRV_LENGTHOF(bcp47Tag); i++)
+ {
+ if (asciiBCP47Tag[i] == '\0')
+ {
+ break;
+ }
+ else
+ {
+ // normally just copy the character
+ bcp47Tag[i] = static_cast<wchar_t>(asciiBCP47Tag[i]);
+ }
+ }
+
+ // Ensure it's null terminated
+ if (i < (UPRV_LENGTHOF(bcp47Tag) - 1))
+ {
+ bcp47Tag[i] = L'\0';
+ }
+ else
+ {
+ // Ran out of room.
+ bcp47Tag[UPRV_LENGTHOF(bcp47Tag) - 1] = L'\0';
+ }
+
+
+ wchar_t windowsLocaleName[LOCALE_NAME_MAX_LENGTH] = {};
+
+ // Note: On Windows versions below 10, there is no support for locale name aliases.
+ // This means that it will fail for locales where ICU has a completely different
+ // name (like ku vs ckb), and it will also not work for alternate sort locale
+ // names like "de-DE-u-co-phonebk".
+
+ // TODO: We could add some sort of exception table for cases like ku vs ckb.
+
+ int length = ResolveLocaleName(bcp47Tag, windowsLocaleName, UPRV_LENGTHOF(windowsLocaleName));
+
+ if (length > 0)
+ {
+ *buffer = new UnicodeString(windowsLocaleName);
+ }
+ else
+ {
+ status = U_UNSUPPORTED_ERROR;
+ }
+ }
+ return status;
+}
+
Win32NumberFormat::Win32NumberFormat(const Locale &locale, UBool currency, UErrorCode &status)
- : NumberFormat(), fCurrency(currency), fFormatInfo(NULL), fFractionDigitsSet(FALSE)
+ : NumberFormat(), fCurrency(currency), fFormatInfo(NULL), fFractionDigitsSet(FALSE), fWindowsLocaleName(nullptr)
{
if (!U_FAILURE(status)) {
fLCID = locale.getLCID();
+ GetEquivalentWindowsLocaleName(locale, &fWindowsLocaleName);
+ // Note: In the previous code, it would look up the LCID for the locale, and if
+ // the locale was not recognized then it would get an LCID of 0, which is a
+ // synonym for LOCALE_USER_DEFAULT on Windows.
+ // If the above method fails, then fWindowsLocaleName will remain as nullptr, and
+ // then we will pass nullptr to API GetLocaleInfoEx, which is the same as passing
+ // LOCALE_USER_DEFAULT.
+
// Resolve actual locale to be used later
UErrorCode tmpsts = U_ZERO_ERROR;
char tmpLocID[ULOC_FULLNAME_CAPACITY];
@@ -152,12 +226,19 @@ Win32NumberFormat::Win32NumberFormat(const Locale &locale, UBool currency, UErro
fLocale = Locale((const char*)tmpLocID);
}
+ const wchar_t *localeName = nullptr;
+
+ if (fWindowsLocaleName != nullptr)
+ {
+ localeName = reinterpret_cast<const wchar_t*>(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer()));
+ }
+
fFormatInfo = (FormatInfo*)uprv_malloc(sizeof(FormatInfo));
if (fCurrency) {
- getCurrencyFormat(&fFormatInfo->currency, fLCID);
+ getCurrencyFormat(&fFormatInfo->currency, localeName);
} else {
- getNumberFormat(&fFormatInfo->number, fLCID);
+ getNumberFormat(&fFormatInfo->number, localeName);
}
}
}
@@ -182,6 +263,7 @@ Win32NumberFormat::~Win32NumberFormat()
uprv_free(fFormatInfo);
}
+ delete fWindowsLocaleName;
}
Win32NumberFormat &Win32NumberFormat::operator=(const Win32NumberFormat &other)
@@ -192,13 +274,21 @@ Win32NumberFormat &Win32NumberFormat::operator=(const Win32NumberFormat &other)
this->fLocale = other.fLocale;
this->fLCID = other.fLCID;
this->fFractionDigitsSet = other.fFractionDigitsSet;
+ this->fWindowsLocaleName = other.fWindowsLocaleName == NULL ? NULL : new UnicodeString(*other.fWindowsLocaleName);
+
+ const wchar_t *localeName = nullptr;
+
+ if (fWindowsLocaleName != nullptr)
+ {
+ localeName = reinterpret_cast<const wchar_t*>(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer()));
+ }
if (fCurrency) {
freeCurrencyFormat(&fFormatInfo->currency);
- getCurrencyFormat(&fFormatInfo->currency, fLCID);
+ getCurrencyFormat(&fFormatInfo->currency, localeName);
} else {
freeNumberFormat(&fFormatInfo->number);
- getNumberFormat(&fFormatInfo->number, fLCID);
+ getNumberFormat(&fFormatInfo->number, localeName);
}
return *this;
@@ -299,6 +389,13 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen
formatInfo = *fFormatInfo;
buffer[0] = 0x0000;
+ const wchar_t *localeName = nullptr;
+
+ if (fWindowsLocaleName != nullptr)
+ {
+ localeName = reinterpret_cast<const wchar_t*>(toOldUCharPtr(fWindowsLocaleName->getTerminatedBuffer()));
+ }
+
if (fCurrency) {
if (fFractionDigitsSet) {
formatInfo.currency.NumDigits = (UINT) numDigits;
@@ -308,17 +405,17 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen
formatInfo.currency.Grouping = 0;
}
- result = GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, buffer, STACK_BUFFER_SIZE);
+ result = GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, buffer, STACK_BUFFER_SIZE);
if (result == 0) {
DWORD lastError = GetLastError();
if (lastError == ERROR_INSUFFICIENT_BUFFER) {
- int newLength = GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, NULL, 0);
+ int newLength = GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, NULL, 0);
buffer = NEW_ARRAY(wchar_t, newLength);
buffer[0] = 0x0000;
- GetCurrencyFormatW(fLCID, 0, nBuffer, &formatInfo.currency, buffer, newLength);
+ GetCurrencyFormatEx(localeName, 0, nBuffer, &formatInfo.currency, buffer, newLength);
}
}
} else {
@@ -330,15 +427,15 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen
formatInfo.number.Grouping = 0;
}
- result = GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, buffer, STACK_BUFFER_SIZE);
+ result = GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, buffer, STACK_BUFFER_SIZE);
if (result == 0) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
- int newLength = GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, NULL, 0);
+ int newLength = GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, NULL, 0);
buffer = NEW_ARRAY(wchar_t, newLength);
buffer[0] = 0x0000;
- GetNumberFormatW(fLCID, 0, nBuffer, &formatInfo.number, buffer, newLength);
+ GetNumberFormatEx(localeName, 0, nBuffer, &formatInfo.number, buffer, newLength);
}
}
}
diff --git a/deps/icu-small/source/i18n/winnmfmt.h b/deps/icu-small/source/i18n/winnmfmt.h
index 3b0df915e1..7ea5da9170 100644
--- a/deps/icu-small/source/i18n/winnmfmt.h
+++ b/deps/icu-small/source/i18n/winnmfmt.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -128,7 +128,7 @@ public:
* <pre>
* . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() ==
- * . erived::getStaticClassID()) ...
+ * . derived::getStaticClassID()) ...
* </pre>
* @return The class ID for all objects of this class.
*/
@@ -155,6 +155,7 @@ private:
FormatInfo *fFormatInfo;
UBool fFractionDigitsSet;
+ UnicodeString* fWindowsLocaleName; // Stores the equivalent Windows locale name.
};
U_NAMESPACE_END
diff --git a/deps/icu-small/source/i18n/wintzimpl.cpp b/deps/icu-small/source/i18n/wintzimpl.cpp
index 4c042d5421..07aad21787 100644
--- a/deps/icu-small/source/i18n/wintzimpl.cpp
+++ b/deps/icu-small/source/i18n/wintzimpl.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -13,7 +13,7 @@
#include "unicode/utypes.h"
-#if U_PLATFORM_HAS_WIN32_API && !UCONFIG_NO_FORMATTING
+#if U_PLATFORM_USES_ONLY_WIN32_API && !UCONFIG_NO_FORMATTING
#include "wintzimpl.h"
@@ -24,7 +24,9 @@
#include "uassert.h"
#include "cmemory.h"
+#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
+#endif
# define VC_EXTRALEAN
# define NOUSER
# define NOSERVICE
diff --git a/deps/icu-small/source/i18n/wintzimpl.h b/deps/icu-small/source/i18n/wintzimpl.h
index 8149fc1417..c36f2ad5f5 100644
--- a/deps/icu-small/source/i18n/wintzimpl.h
+++ b/deps/icu-small/source/i18n/wintzimpl.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
@@ -16,7 +16,7 @@
#include "unicode/utypes.h"
-#if U_PLATFORM_HAS_WIN32_API
+#if U_PLATFORM_USES_ONLY_WIN32_API
/**
* \file
* \brief C API: Utilities for dealing w/ Windows time zones.
@@ -34,6 +34,6 @@ U_CAPI UBool U_EXPORT2
uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length);
-#endif /* U_PLATFORM_HAS_WIN32_API */
+#endif /* U_PLATFORM_USES_ONLY_WIN32_API */
#endif /* __WINTZIMPL */
diff --git a/deps/icu-small/source/i18n/zonemeta.cpp b/deps/icu-small/source/i18n/zonemeta.cpp
index fdf333c371..84a9657802 100644
--- a/deps/icu-small/source/i18n/zonemeta.cpp
+++ b/deps/icu-small/source/i18n/zonemeta.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -17,7 +17,7 @@
#include "unicode/ustring.h"
#include "unicode/putil.h"
#include "unicode/simpletz.h"
-
+#include "unicode/strenum.h"
#include "umutex.h"
#include "uvector.h"
#include "cmemory.h"
@@ -28,6 +28,7 @@
#include "uresimp.h"
#include "uhash.h"
#include "olsontz.h"
+#include "uinvchar.h"
static UMutex gZoneMetaLock = U_MUTEX_INITIALIZER;
@@ -255,6 +256,12 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
tzid.extract(utzid, ZID_KEY_MAX + 1, tmpStatus);
U_ASSERT(tmpStatus == U_ZERO_ERROR); // we checked the length of tzid already
+ if (!uprv_isInvariantUString(utzid, -1)) {
+ // All of known tz IDs are only containing ASCII invariant characters.
+ status = U_ILLEGAL_ARGUMENT_ERROR;
+ return NULL;
+ }
+
// Check if it was already cached
umtx_lock(&gZoneMetaLock);
{
diff --git a/deps/icu-small/source/i18n/zonemeta.h b/deps/icu-small/source/i18n/zonemeta.h
index 84be5553ea..9dbcc878a2 100644
--- a/deps/icu-small/source/i18n/zonemeta.h
+++ b/deps/icu-small/source/i18n/zonemeta.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@@ -41,7 +41,11 @@ public:
/**
* Return the canonical id for this tzid defined by CLDR, which might be the id itself.
* This overload method returns a persistent const UChar*, which is guranteed to persist
- * (a pointer to a resource).
+ * (a pointer to a resource). If the given system tzid is not known, U_ILLEGAL_ARGUMENT_ERROR
+ * is set in the status.
+ * @param tzid Zone ID
+ * @param status Receives the status
+ * @return The canonical ID for the input time zone ID
*/
static const UChar* U_EXPORT2 getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status);
diff --git a/deps/icu-small/source/i18n/zrule.cpp b/deps/icu-small/source/i18n/zrule.cpp
index ad64ab6e16..c13411fc8e 100644
--- a/deps/icu-small/source/i18n/zrule.cpp
+++ b/deps/icu-small/source/i18n/zrule.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/zrule.h b/deps/icu-small/source/i18n/zrule.h
index b9827bf520..272f954f06 100644
--- a/deps/icu-small/source/i18n/zrule.h
+++ b/deps/icu-small/source/i18n/zrule.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/ztrans.cpp b/deps/icu-small/source/i18n/ztrans.cpp
index 956b563a2a..d2d93da133 100644
--- a/deps/icu-small/source/i18n/ztrans.cpp
+++ b/deps/icu-small/source/i18n/ztrans.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
diff --git a/deps/icu-small/source/i18n/ztrans.h b/deps/icu-small/source/i18n/ztrans.h
index 0101dc06e3..8b63eb47e8 100644
--- a/deps/icu-small/source/i18n/ztrans.h
+++ b/deps/icu-small/source/i18n/ztrans.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************