]> granicus.if.org Git - icu/commitdiff
ICU-21833 Replace UChar with char16_t in all C++ code.
authorFredrik Roubert <roubert@google.com>
Tue, 27 Dec 2022 07:54:24 +0000 (16:54 +0900)
committerFredrik Roubert <fredrik@roubert.name>
Mon, 6 Feb 2023 18:27:44 +0000 (19:27 +0100)
543 files changed:
icu4c/source/common/appendable.cpp
icu4c/source/common/bmpset.cpp
icu4c/source/common/bmpset.h
icu4c/source/common/brkeng.cpp
icu4c/source/common/brkiter.cpp
icu4c/source/common/bytestriebuilder.cpp
icu4c/source/common/caniter.cpp
icu4c/source/common/characterproperties.cpp
icu4c/source/common/chariter.cpp
icu4c/source/common/charstr.cpp
icu4c/source/common/charstr.h
icu4c/source/common/cpputils.h
icu4c/source/common/emojiprops.cpp
icu4c/source/common/emojiprops.h
icu4c/source/common/filteredbrk.cpp
icu4c/source/common/locdispnames.cpp
icu4c/source/common/locdspnm.cpp
icu4c/source/common/loclikely.cpp
icu4c/source/common/locresdata.cpp
icu4c/source/common/locutil.cpp
icu4c/source/common/lstmbe.cpp
icu4c/source/common/messagepattern.cpp
icu4c/source/common/norm2allmodes.h
icu4c/source/common/normalizer2.cpp
icu4c/source/common/normalizer2impl.cpp
icu4c/source/common/patternprops.cpp
icu4c/source/common/patternprops.h
icu4c/source/common/punycode.cpp
icu4c/source/common/putil.cpp
icu4c/source/common/rbbidata.h
icu4c/source/common/rbbiscan.cpp
icu4c/source/common/rbbistbl.cpp
icu4c/source/common/resbund.cpp
icu4c/source/common/resbund_cnv.cpp
icu4c/source/common/resource.h
icu4c/source/common/ruleiter.cpp
icu4c/source/common/serv.cpp
icu4c/source/common/serv.h
icu4c/source/common/servlk.cpp
icu4c/source/common/servlkf.cpp
icu4c/source/common/servls.cpp
icu4c/source/common/servrbf.cpp
icu4c/source/common/servslkf.cpp
icu4c/source/common/simpleformatter.cpp
icu4c/source/common/stringtriebuilder.cpp
icu4c/source/common/ubidi.cpp
icu4c/source/common/ubidiln.cpp
icu4c/source/common/ubiditransform.cpp
icu4c/source/common/ubidiwrt.cpp
icu4c/source/common/ubrk.cpp
icu4c/source/common/ucase.cpp
icu4c/source/common/ucase.h
icu4c/source/common/ucasemap.cpp
icu4c/source/common/ucasemap_imp.h
icu4c/source/common/ucat.cpp
icu4c/source/common/ucharstrie.cpp
icu4c/source/common/ucharstriebuilder.cpp
icu4c/source/common/ucharstrieiterator.cpp
icu4c/source/common/uchriter.cpp
icu4c/source/common/ucnv.cpp
icu4c/source/common/ucnv2022.cpp
icu4c/source/common/ucnv_cb.cpp
icu4c/source/common/ucnv_cnv.cpp
icu4c/source/common/ucnv_ct.cpp
icu4c/source/common/ucnv_err.cpp
icu4c/source/common/ucnv_ext.cpp
icu4c/source/common/ucnv_lmb.cpp
icu4c/source/common/ucnv_u16.cpp
icu4c/source/common/ucnv_u32.cpp
icu4c/source/common/ucnv_u7.cpp
icu4c/source/common/ucnv_u8.cpp
icu4c/source/common/ucnvbocu.cpp
icu4c/source/common/ucnvdisp.cpp
icu4c/source/common/ucnvhz.cpp
icu4c/source/common/ucnvisci.cpp
icu4c/source/common/ucnvlat1.cpp
icu4c/source/common/ucnvmbcs.cpp
icu4c/source/common/ucnvscsu.cpp
icu4c/source/common/ucnvsel.cpp
icu4c/source/common/ucol_data.h
icu4c/source/common/ucol_swp.cpp
icu4c/source/common/ucurr.cpp
icu4c/source/common/uenum.cpp
icu4c/source/common/uhash.cpp
icu4c/source/common/uidna.cpp
icu4c/source/common/uinvchar.cpp
icu4c/source/common/uiter.cpp
icu4c/source/common/uloc_keytype.cpp
icu4c/source/common/umapfile.cpp
icu4c/source/common/unames.cpp
icu4c/source/common/unicode/ures.h
icu4c/source/common/uniset.cpp
icu4c/source/common/uniset_closure.cpp
icu4c/source/common/uniset_props.cpp
icu4c/source/common/unisetspan.cpp
icu4c/source/common/unisetspan.h
icu4c/source/common/unistr.cpp
icu4c/source/common/unistr_case.cpp
icu4c/source/common/unistr_cnv.cpp
icu4c/source/common/unistr_props.cpp
icu4c/source/common/unistrappender.h
icu4c/source/common/unorm.cpp
icu4c/source/common/unormcmp.cpp
icu4c/source/common/unormimp.h
icu4c/source/common/uprops.cpp
icu4c/source/common/ures_cnv.cpp
icu4c/source/common/uresbund.cpp
icu4c/source/common/uresdata.cpp
icu4c/source/common/uresdata.h
icu4c/source/common/usc_impl.cpp
icu4c/source/common/uscript_props.cpp
icu4c/source/common/uset.cpp
icu4c/source/common/uset_props.cpp
icu4c/source/common/ushape.cpp
icu4c/source/common/usprep.cpp
icu4c/source/common/ustr_cnv.cpp
icu4c/source/common/ustr_titlecase_brkiter.cpp
icu4c/source/common/ustr_wcs.cpp
icu4c/source/common/ustrcase.cpp
icu4c/source/common/ustrcase_locale.cpp
icu4c/source/common/ustrenum.cpp
icu4c/source/common/ustrfmt.cpp
icu4c/source/common/ustring.cpp
icu4c/source/common/ustrtrns.cpp
icu4c/source/common/utext.cpp
icu4c/source/common/util.cpp
icu4c/source/common/util.h
icu4c/source/common/util_props.cpp
icu4c/source/common/utrace.cpp
icu4c/source/common/utrie2.h
icu4c/source/common/utrie2_builder.cpp
icu4c/source/common/uts46.cpp
icu4c/source/common/wintz.cpp
icu4c/source/extra/scrptrun/scrptrun.cpp
icu4c/source/extra/scrptrun/scrptrun.h
icu4c/source/extra/scrptrun/srtest.cpp
icu4c/source/extra/uconv/uconv.cpp
icu4c/source/i18n/alphaindex.cpp
icu4c/source/i18n/anytrans.cpp
icu4c/source/i18n/bocsu.cpp
icu4c/source/i18n/brktrans.cpp
icu4c/source/i18n/calendar.cpp
icu4c/source/i18n/casetrn.cpp
icu4c/source/i18n/choicfmt.cpp
icu4c/source/i18n/coleitr.cpp
icu4c/source/i18n/coll.cpp
icu4c/source/i18n/collationbuilder.cpp
icu4c/source/i18n/collationdata.h
icu4c/source/i18n/collationdatabuilder.cpp
icu4c/source/i18n/collationdatareader.cpp
icu4c/source/i18n/collationdatareader.h
icu4c/source/i18n/collationdatawriter.cpp
icu4c/source/i18n/collationfastlatin.cpp
icu4c/source/i18n/collationfastlatin.h
icu4c/source/i18n/collationfastlatinbuilder.cpp
icu4c/source/i18n/collationiterator.cpp
icu4c/source/i18n/collationiterator.h
icu4c/source/i18n/collationruleparser.cpp
icu4c/source/i18n/collationruleparser.h
icu4c/source/i18n/collationsets.cpp
icu4c/source/i18n/collationsets.h
icu4c/source/i18n/cpdtrans.cpp
icu4c/source/i18n/cpdtrans.h
icu4c/source/i18n/csmatch.cpp
icu4c/source/i18n/csmatch.h
icu4c/source/i18n/csrucode.cpp
icu4c/source/i18n/currpinf.cpp
icu4c/source/i18n/currunit.cpp
icu4c/source/i18n/dcfmtsym.cpp
icu4c/source/i18n/dt_impl.h
icu4c/source/i18n/dtfmtsym.cpp
icu4c/source/i18n/dtitv_impl.h
icu4c/source/i18n/dtitvfmt.cpp
icu4c/source/i18n/dtitvinf.cpp
icu4c/source/i18n/dtptngen.cpp
icu4c/source/i18n/dtptngen_impl.h
icu4c/source/i18n/erarules.cpp
icu4c/source/i18n/esctrn.cpp
icu4c/source/i18n/fmtable.cpp
icu4c/source/i18n/formattedvalue.cpp
icu4c/source/i18n/funcrepl.cpp
icu4c/source/i18n/gender.cpp
icu4c/source/i18n/japancal.cpp
icu4c/source/i18n/listformatter.cpp
icu4c/source/i18n/measfmt.cpp
icu4c/source/i18n/measunit_extra.cpp
icu4c/source/i18n/msgfmt.cpp
icu4c/source/i18n/name2uni.cpp
icu4c/source/i18n/nfrs.cpp
icu4c/source/i18n/nfrs.h
icu4c/source/i18n/nfrule.cpp
icu4c/source/i18n/nfrule.h
icu4c/source/i18n/nfsubs.cpp
icu4c/source/i18n/nfsubs.h
icu4c/source/i18n/number_capi.cpp
icu4c/source/i18n/number_compact.cpp
icu4c/source/i18n/number_compact.h
icu4c/source/i18n/number_longnames.cpp
icu4c/source/i18n/number_patternstring.cpp
icu4c/source/i18n/number_rounding.cpp
icu4c/source/i18n/number_skeletons.cpp
icu4c/source/i18n/numfmt.cpp
icu4c/source/i18n/numparse_affixes.h
icu4c/source/i18n/numparse_currency.h
icu4c/source/i18n/numparse_types.h
icu4c/source/i18n/numparse_utils.h
icu4c/source/i18n/numrange_capi.cpp
icu4c/source/i18n/numsys.cpp
icu4c/source/i18n/olsontz.cpp
icu4c/source/i18n/olsontz.h
icu4c/source/i18n/pluralranges.cpp
icu4c/source/i18n/plurfmt.cpp
icu4c/source/i18n/plurrule.cpp
icu4c/source/i18n/plurrule_impl.h
icu4c/source/i18n/quant.cpp
icu4c/source/i18n/rbnf.cpp
icu4c/source/i18n/rbt_data.h
icu4c/source/i18n/rbt_pars.cpp
icu4c/source/i18n/rbt_pars.h
icu4c/source/i18n/rbt_rule.cpp
icu4c/source/i18n/rbt_set.cpp
icu4c/source/i18n/regexcmp.cpp
icu4c/source/i18n/regeximp.cpp
icu4c/source/i18n/regeximp.h
icu4c/source/i18n/regextxt.cpp
icu4c/source/i18n/region.cpp
icu4c/source/i18n/reldatefmt.cpp
icu4c/source/i18n/reldtfmt.cpp
icu4c/source/i18n/reldtfmt.h
icu4c/source/i18n/rematch.cpp
icu4c/source/i18n/remtrans.cpp
icu4c/source/i18n/repattrn.cpp
icu4c/source/i18n/rulebasedcollator.cpp
icu4c/source/i18n/scientificnumberformatter.cpp
icu4c/source/i18n/scriptset.cpp
icu4c/source/i18n/search.cpp
icu4c/source/i18n/selfmt.cpp
icu4c/source/i18n/selfmtimpl.h
icu4c/source/i18n/simpletz.cpp
icu4c/source/i18n/smpdtfmt.cpp
icu4c/source/i18n/standardplural.cpp
icu4c/source/i18n/strmatch.cpp
icu4c/source/i18n/strrepl.cpp
icu4c/source/i18n/timezone.cpp
icu4c/source/i18n/titletrn.cpp
icu4c/source/i18n/tmutfmt.cpp
icu4c/source/i18n/translit.cpp
icu4c/source/i18n/transreg.cpp
icu4c/source/i18n/tridpars.cpp
icu4c/source/i18n/tzfmt.cpp
icu4c/source/i18n/tzgnames.cpp
icu4c/source/i18n/tznames.cpp
icu4c/source/i18n/tznames_impl.cpp
icu4c/source/i18n/tznames_impl.h
icu4c/source/i18n/ucal.cpp
icu4c/source/i18n/ucol.cpp
icu4c/source/i18n/ucol_res.cpp
icu4c/source/i18n/ucol_sit.cpp
icu4c/source/i18n/ucoleitr.cpp
icu4c/source/i18n/ucsdet.cpp
icu4c/source/i18n/udat.cpp
icu4c/source/i18n/udateintervalformat.cpp
icu4c/source/i18n/udatpg.cpp
icu4c/source/i18n/uitercollationiterator.cpp
icu4c/source/i18n/uitercollationiterator.h
icu4c/source/i18n/ulistformatter.cpp
icu4c/source/i18n/ulocdata.cpp
icu4c/source/i18n/umsg.cpp
icu4c/source/i18n/umsg_imp.h
icu4c/source/i18n/unesctrn.cpp
icu4c/source/i18n/unesctrn.h
icu4c/source/i18n/uni2name.cpp
icu4c/source/i18n/unicode/dcfmtsym.h
icu4c/source/i18n/units_data.cpp
icu4c/source/i18n/unum.cpp
icu4c/source/i18n/unumsys.cpp
icu4c/source/i18n/upluralrules.cpp
icu4c/source/i18n/uregex.cpp
icu4c/source/i18n/usearch.cpp
icu4c/source/i18n/uspoof.cpp
icu4c/source/i18n/uspoof_conf.cpp
icu4c/source/i18n/uspoof_conf.h
icu4c/source/i18n/uspoof_impl.cpp
icu4c/source/i18n/uspoof_impl.h
icu4c/source/i18n/utf16collationiterator.cpp
icu4c/source/i18n/utf16collationiterator.h
icu4c/source/i18n/utf8collationiterator.cpp
icu4c/source/i18n/utf8collationiterator.h
icu4c/source/i18n/utrans.cpp
icu4c/source/i18n/vtzone.cpp
icu4c/source/i18n/vzone.cpp
icu4c/source/i18n/windtfmt.cpp
icu4c/source/i18n/winnmfmt.cpp
icu4c/source/i18n/wintzimpl.cpp
icu4c/source/i18n/zonemeta.cpp
icu4c/source/i18n/zonemeta.h
icu4c/source/i18n/zrule.cpp
icu4c/source/io/sprintf.cpp
icu4c/source/io/sscanf.cpp
icu4c/source/io/ufile.cpp
icu4c/source/io/ufmt_cmn.cpp
icu4c/source/io/uprintf.cpp
icu4c/source/io/uprntf_p.cpp
icu4c/source/io/uscanf.cpp
icu4c/source/io/uscanf_p.cpp
icu4c/source/io/ustdio.cpp
icu4c/source/io/ustream.cpp
icu4c/source/samples/case/case.cpp
icu4c/source/samples/citer/citer.cpp
icu4c/source/samples/coll/coll.cpp
icu4c/source/samples/datefmt/util.cpp
icu4c/source/samples/layout/UnicodeReader.cpp
icu4c/source/samples/layout/UnicodeReader.h
icu4c/source/samples/layout/paragraph.cpp
icu4c/source/samples/layout/ucreader.cpp
icu4c/source/samples/layout/ucreader.h
icu4c/source/samples/legacy/legacy.cpp
icu4c/source/samples/legacy/newcol.cpp
icu4c/source/samples/legacy/oldcol.cpp
icu4c/source/samples/msgfmt/util.cpp
icu4c/source/samples/numfmt/main.cpp
icu4c/source/samples/numfmt/util.cpp
icu4c/source/samples/strsrch/strsrch.cpp
icu4c/source/samples/translit/answers/unaccent.cpp
icu4c/source/samples/translit/answers/unaccent.h
icu4c/source/samples/translit/unaccent.cpp
icu4c/source/samples/translit/unaccent.h
icu4c/source/samples/translit/util.cpp
icu4c/source/samples/ucnv/convsamp.cpp
icu4c/source/samples/ugrep/ugrep.cpp
icu4c/source/samples/ustring/ustring.cpp
icu4c/source/stubdata/stubdata.cpp
icu4c/source/test/fuzzer/uregex_open_fuzzer.cpp
icu4c/source/test/intltest/alphaindextst.cpp
icu4c/source/test/intltest/apicoll.cpp
icu4c/source/test/intltest/bidiconf.cpp
icu4c/source/test/intltest/calcasts.cpp
icu4c/source/test/intltest/calregts.cpp
icu4c/source/test/intltest/caltest.cpp
icu4c/source/test/intltest/citrtest.cpp
icu4c/source/test/intltest/collationtest.cpp
icu4c/source/test/intltest/colldata.cpp
icu4c/source/test/intltest/colldata.h
icu4c/source/test/intltest/compactdecimalformattest.cpp
icu4c/source/test/intltest/convtest.cpp
icu4c/source/test/intltest/convtest.h
icu4c/source/test/intltest/cpdtrtst.cpp
icu4c/source/test/intltest/cpdtrtst.h
icu4c/source/test/intltest/csdetest.cpp
icu4c/source/test/intltest/currcoll.cpp
icu4c/source/test/intltest/dadrcal.cpp
icu4c/source/test/intltest/dadrfmt.cpp
icu4c/source/test/intltest/datadrivennumberformattestsuite.cpp
icu4c/source/test/intltest/datadrivennumberformattestsuite.h
icu4c/source/test/intltest/dcfmtest.cpp
icu4c/source/test/intltest/decoll.cpp
icu4c/source/test/intltest/decoll.h
icu4c/source/test/intltest/dtfmttst.cpp
icu4c/source/test/intltest/dtifmtts.cpp
icu4c/source/test/intltest/dtptngts.cpp
icu4c/source/test/intltest/encoll.cpp
icu4c/source/test/intltest/escoll.cpp
icu4c/source/test/intltest/escoll.h
icu4c/source/test/intltest/ficoll.cpp
icu4c/source/test/intltest/ficoll.h
icu4c/source/test/intltest/fldset.cpp
icu4c/source/test/intltest/frcoll.cpp
icu4c/source/test/intltest/frcoll.h
icu4c/source/test/intltest/g7coll.cpp
icu4c/source/test/intltest/idnaconf.cpp
icu4c/source/test/intltest/idnaconf.h
icu4c/source/test/intltest/idnaref.cpp
icu4c/source/test/intltest/incaltst.cpp
icu4c/source/test/intltest/intltest.cpp
icu4c/source/test/intltest/intltest.h
icu4c/source/test/intltest/itercoll.cpp
icu4c/source/test/intltest/itercoll.h
icu4c/source/test/intltest/itrbnf.cpp
icu4c/source/test/intltest/itrbnfp.cpp
icu4c/source/test/intltest/itspoof.cpp
icu4c/source/test/intltest/itutil.cpp
icu4c/source/test/intltest/jacoll.cpp
icu4c/source/test/intltest/jacoll.h
icu4c/source/test/intltest/jamotest.cpp
icu4c/source/test/intltest/lcukocol.cpp
icu4c/source/test/intltest/lcukocol.h
icu4c/source/test/intltest/localematchertest.cpp
icu4c/source/test/intltest/locnmtst.cpp
icu4c/source/test/intltest/loctest.cpp
icu4c/source/test/intltest/lstmbetst.cpp
icu4c/source/test/intltest/measfmttest.cpp
icu4c/source/test/intltest/miscdtfm.cpp
icu4c/source/test/intltest/mnkytst.cpp
icu4c/source/test/intltest/msfmrgts.cpp
icu4c/source/test/intltest/nmfmapts.cpp
icu4c/source/test/intltest/nptrans.cpp
icu4c/source/test/intltest/nptrans.h
icu4c/source/test/intltest/numberformattesttuple.cpp
icu4c/source/test/intltest/numbertest.h
icu4c/source/test/intltest/numbertest_api.cpp
icu4c/source/test/intltest/numbertest_permutation.cpp
icu4c/source/test/intltest/numfmtdatadriventest.cpp
icu4c/source/test/intltest/numfmtspectest.cpp
icu4c/source/test/intltest/numfmtst.cpp
icu4c/source/test/intltest/numfmtst.h
icu4c/source/test/intltest/numrgts.cpp
icu4c/source/test/intltest/plurfmts.cpp
icu4c/source/test/intltest/rbbiapts.cpp
icu4c/source/test/intltest/rbbimonkeytest.cpp
icu4c/source/test/intltest/rbbitst.cpp
icu4c/source/test/intltest/regcoll.cpp
icu4c/source/test/intltest/regcoll.h
icu4c/source/test/intltest/regextst.cpp
icu4c/source/test/intltest/reptest.cpp
icu4c/source/test/intltest/restest.cpp
icu4c/source/test/intltest/restsnew.cpp
icu4c/source/test/intltest/sfwdchit.cpp
icu4c/source/test/intltest/sfwdchit.h
icu4c/source/test/intltest/srchtest.cpp
icu4c/source/test/intltest/ssearch.cpp
icu4c/source/test/intltest/strcase.cpp
icu4c/source/test/intltest/strtest.cpp
icu4c/source/test/intltest/svccoll.cpp
icu4c/source/test/intltest/testidn.cpp
icu4c/source/test/intltest/testidna.cpp
icu4c/source/test/intltest/testidna.h
icu4c/source/test/intltest/testutil.cpp
icu4c/source/test/intltest/testutil.h
icu4c/source/test/intltest/thcoll.cpp
icu4c/source/test/intltest/tmsgfmt.cpp
icu4c/source/test/intltest/tokiter.cpp
icu4c/source/test/intltest/transapi.cpp
icu4c/source/test/intltest/transrt.cpp
icu4c/source/test/intltest/transtst.cpp
icu4c/source/test/intltest/trcoll.cpp
icu4c/source/test/intltest/trcoll.h
icu4c/source/test/intltest/tscoll.cpp
icu4c/source/test/intltest/tscoll.h
icu4c/source/test/intltest/tsdcfmsy.cpp
icu4c/source/test/intltest/tsmthred.cpp
icu4c/source/test/intltest/tstnorm.cpp
icu4c/source/test/intltest/tstnorm.h
icu4c/source/test/intltest/tstnrapi.cpp
icu4c/source/test/intltest/tufmtts.cpp
icu4c/source/test/intltest/tzfmttst.cpp
icu4c/source/test/intltest/tzrulets.cpp
icu4c/source/test/intltest/tztest.cpp
icu4c/source/test/intltest/ucaconf.cpp
icu4c/source/test/intltest/ucdtest.cpp
icu4c/source/test/intltest/ucharstrietest.cpp
icu4c/source/test/intltest/uobjtest.cpp
icu4c/source/test/intltest/usettest.cpp
icu4c/source/test/intltest/usettest.h
icu4c/source/test/intltest/ustrtest.cpp
icu4c/source/test/intltest/uts46test.cpp
icu4c/source/test/intltest/utxttest.cpp
icu4c/source/test/intltest/windttst.cpp
icu4c/source/test/intltest/winnmtst.cpp
icu4c/source/test/iotest/iotest.cpp
icu4c/source/test/iotest/stream.cpp
icu4c/source/test/perf/DateFmtPerf/DateFmtPerf.h
icu4c/source/test/perf/collationperf/collperf.cpp
icu4c/source/test/perf/collperf/collperf.cpp
icu4c/source/test/perf/collperf2/collperf2.cpp
icu4c/source/test/perf/convperf/convperf.cpp
icu4c/source/test/perf/convperf/convperf.h
icu4c/source/test/perf/dicttrieperf/dicttrieperf.cpp
icu4c/source/test/perf/howExpensiveIs/howExpensiveIs.cpp
icu4c/source/test/perf/normperf/dtfmtrtperf.h
icu4c/source/test/perf/normperf/normperf.cpp
icu4c/source/test/perf/normperf/normperf.h
icu4c/source/test/perf/normperf/simplenormperf.cpp
icu4c/source/test/perf/strsrchperf/strsrchperf.cpp
icu4c/source/test/perf/strsrchperf/strsrchperf.h
icu4c/source/test/perf/ubrkperf/ubrkperf.h
icu4c/source/test/perf/ubrkperf/ubrkperfold.cpp
icu4c/source/test/perf/unisetperf/draft/unicont.h
icu4c/source/test/perf/unisetperf/unisetperf.cpp
icu4c/source/test/perf/ustrperf/stringperf.cpp
icu4c/source/test/perf/ustrperf/stringperf.h
icu4c/source/test/perf/utfperf/utfperf.cpp
icu4c/source/test/perf/utrie2perf/utrie2perf.cpp
icu4c/source/test/thaitest/thaitest.cpp
icu4c/source/tools/ctestfw/datamap.cpp
icu4c/source/tools/ctestfw/unicode/uperf.h
icu4c/source/tools/ctestfw/unicode/utimer.h
icu4c/source/tools/ctestfw/uperf.cpp
icu4c/source/tools/escapesrc/tblgen.cpp
icu4c/source/tools/genbrk/genbrk.cpp
icu4c/source/tools/gencolusb/extract_unsafe_backwards.cpp
icu4c/source/tools/gendict/gendict.cpp
icu4c/source/tools/gennorm2/extradata.cpp
icu4c/source/tools/gennorm2/gennorm2.cpp
icu4c/source/tools/gennorm2/n2builder.cpp
icu4c/source/tools/gennorm2/norms.cpp
icu4c/source/tools/genrb/derb.cpp
icu4c/source/tools/genrb/genrb.cpp
icu4c/source/tools/genrb/parse.cpp
icu4c/source/tools/genrb/prscmnts.cpp
icu4c/source/tools/genrb/reslist.cpp
icu4c/source/tools/genrb/reslist.h
icu4c/source/tools/genrb/wrtjava.cpp
icu4c/source/tools/genrb/wrtxml.cpp
icu4c/source/tools/makeconv/makeconv.cpp
icu4c/source/tools/toolutil/dbgutil.cpp
icu4c/source/tools/toolutil/package.cpp
icu4c/source/tools/toolutil/pkg_gencmn.cpp
icu4c/source/tools/toolutil/pkgitems.cpp
icu4c/source/tools/toolutil/ppucd.cpp
icu4c/source/tools/toolutil/swapimpl.cpp
icu4c/source/tools/toolutil/ucbuf.cpp
icu4c/source/tools/toolutil/udbgutil.cpp
icu4c/source/tools/toolutil/unewdata.cpp
icu4c/source/tools/toolutil/uparse.cpp
icu4c/source/tools/toolutil/writesrc.cpp
icu4c/source/tools/toolutil/xmlparser.cpp
tools/colprobe/colprobe.cpp
tools/colprobe/colprobe.h
tools/colprobe/colprobeNew.cpp
tools/colprobe/line.cpp
tools/colprobe/line.h
tools/colprobe/longname.cpp
tools/colprobe/sortedlines.cpp
tools/colprobe/strengthprobe.cpp
tools/colprobe/strengthprobe.h
tools/colprobe/uprinter.cpp
tools/colprobe/uprinter.h
tools/multi/proj/chello/uprint.cpp
tools/multi/proj/icu4cscan/testxml.cpp
tools/multi/proj/provider/colldiff.cpp
tools/multi/proj/provider/datediff.cpp
tools/multi/proj/provider/glue/cal_fe.cpp
tools/multi/proj/provider/glue/coll_fe.cpp
tools/multi/proj/provider/glue/date_fe.cpp
tools/unicode/c/genprops/casepropsbuilder.cpp
tools/unicode/c/genprops/corepropsbuilder.cpp
tools/unicode/c/genprops/emojipropsbuilder.cpp
tools/unicode/c/genprops/namespropsbuilder.cpp
tools/unicode/c/genprops/pnamesbuilder.cpp
tools/unicode/c/genregexcasing/genregexcasing.cpp
tools/unicode/c/genuca/collationbasedatabuilder.cpp
tools/unicode/c/genuca/genuca.cpp
tools/unicode/c/genuts46/genuts46.cpp

index 8a14c1e9d9a93c1034b495fdb3ba1c1829f661c2..c0fbcc6530ad4a567135fb726cbd80745dddf1c3 100644 (file)
@@ -25,23 +25,23 @@ Appendable::~Appendable() {}
 UBool
 Appendable::appendCodePoint(UChar32 c) {
     if(c<=0xffff) {
-        return appendCodeUnit((UChar)c);
+        return appendCodeUnit((char16_t)c);
     } else {
         return appendCodeUnit(U16_LEAD(c)) && appendCodeUnit(U16_TRAIL(c));
     }
 }
 
 UBool
-Appendable::appendString(const UChar *s, int32_t length) {
+Appendable::appendString(const char16_t *s, int32_t length) {
     if(length<0) {
-        UChar c;
+        char16_t c;
         while((c=*s++)!=0) {
             if(!appendCodeUnit(c)) {
                 return false;
             }
         }
     } else if(length>0) {
-        const UChar *limit=s+length;
+        const char16_t *limit=s+length;
         do {
             if(!appendCodeUnit(*s++)) {
                 return false;
@@ -56,10 +56,10 @@ Appendable::reserveAppendCapacity(int32_t /*appendCapacity*/) {
     return true;
 }
 
-UChar *
+char16_t *
 Appendable::getAppendBuffer(int32_t minCapacity,
                             int32_t /*desiredCapacityHint*/,
-                            UChar *scratch, int32_t scratchCapacity,
+                            char16_t *scratch, int32_t scratchCapacity,
                             int32_t *resultCapacity) {
     if(minCapacity<1 || scratchCapacity<minCapacity) {
         *resultCapacity=0;
index 14ab8942678f00177bbb8d18c1ccf84cded4cc2c..641c675c6706b643bf3338a396be20bb8f42c4f7 100644 (file)
@@ -319,9 +319,9 @@ BMPSet::contains(UChar32 c) const {
  * Check for sufficient length for trail unit for each surrogate pair.
  * Handle single surrogates as surrogate code points as usual in ICU.
  */
-const UChar *
-BMPSet::span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const {
-    UChar c, c2;
+const char16_t *
+BMPSet::span(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const {
+    char16_t c, c2;
 
     if(spanCondition) {
         // span
@@ -408,9 +408,9 @@ BMPSet::span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition
 }
 
 /* Symmetrical with span(). */
-const UChar *
-BMPSet::spanBack(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const {
-    UChar c, c2;
+const char16_t *
+BMPSet::spanBack(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const {
+    char16_t c, c2;
 
     if(spanCondition) {
         // span
index e1982ac669db859b4ec5dc90aa9659b49395be21..fad0310038ac81aead1c8335ff5971be0868edaf 100644 (file)
@@ -48,14 +48,14 @@ public:
      * It must be s<limit and spanCondition==0 or 1.
      * @return The string pointer which limits the span.
      */
-    const UChar *span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const;
+    const char16_t *span(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const;
 
     /*
      * Span the trailing substring for which each character c has spanCondition==contains(c).
      * It must be s<limit and spanCondition==0 or 1.
      * @return The string pointer which starts the span.
      */
-    const UChar *spanBack(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const;
+    const char16_t *spanBack(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const;
 
     /*
      * Span the initial substring for which each character c has spanCondition==contains(c).
index 968a6f63116c7d710054b72a1fc034ee22e03cd6..ce3d09cf23b86b5a5f96350080739d18ec4bc9a7 100644 (file)
@@ -250,7 +250,7 @@ ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
     UResourceBundle *b = ures_open(U_ICUDATA_BRKITR, "", &status);
     b = ures_getByKeyWithFallback(b, "dictionaries", b, &status);
     int32_t dictnlength = 0;
-    const UChar *dictfname =
+    const char16_t *dictfname =
         ures_getStringByKeyWithFallback(b, uscript_getShortName(script), &dictnlength, &status);
     if (U_FAILURE(status)) {
         ures_close(b);
@@ -258,7 +258,7 @@ ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
     }
     CharString dictnbuf;
     CharString ext;
-    const UChar *extStart = u_memrchr(dictfname, 0x002e, dictnlength);  // last dot
+    const char16_t *extStart = u_memrchr(dictfname, 0x002e, dictnlength);  // last dot
     if (extStart != nullptr) {
         int32_t len = (int32_t)(extStart - dictfname);
         ext.appendInvariantChars(UnicodeString(false, extStart + 1, dictnlength - len - 1), status);
@@ -281,7 +281,7 @@ ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
             m = new BytesDictionaryMatcher(characters, transform, file);
         }
         else if (trieType == DictionaryData::TRIE_TYPE_UCHARS) {
-            const UChar *characters = (const UChar *)(data + offset);
+            const char16_t *characters = (const char16_t *)(data + offset);
             m = new UCharsDictionaryMatcher(characters, file);
         }
         if (m == nullptr) {
index f61f24e50bac3cab712fd55ba2fc5e6b45dd1393..478e7676fb0557e2a530910fd0818e3c526cc902 100644 (file)
@@ -60,7 +60,7 @@ BreakIterator::buildInstance(const Locale& loc, const char *type, UErrorCode &st
     char ext[4]={'\0'};
     CharString actualLocale;
     int32_t size;
-    const UChar* brkfname = nullptr;
+    const char16_t* brkfname = nullptr;
     UResourceBundle brkRulesStack;
     UResourceBundle brkNameStack;
     UResourceBundle *brkRules = &brkRulesStack;
@@ -95,7 +95,7 @@ BreakIterator::buildInstance(const Locale& loc, const char *type, UErrorCode &st
         if (U_SUCCESS(status) && brkfname) {
             actualLocale.append(ures_getLocaleInternal(brkName, &status), -1, status);
 
-            UChar* extStart=u_strchr(brkfname, 0x002e);
+            char16_t* extStart=u_strchr(brkfname, 0x002e);
             int len = 0;
             if (extStart != nullptr){
                 len = (int)(extStart-brkfname);
index a61cccf8486cc4415ebe8798e195d98abe69c854..0582f1aa11a9531ccc1f1bc781bf9f792e36e90c 100644 (file)
@@ -282,7 +282,7 @@ BytesTrieBuilder::getElementStringLength(int32_t i) const {
     return elements[i].getStringLength(*strings);
 }
 
-UChar
+char16_t
 BytesTrieBuilder::getElementUnit(int32_t i, int32_t byteIndex) const {
     return (uint8_t)elements[i].charAt(byteIndex, *strings);
 }
@@ -329,7 +329,7 @@ BytesTrieBuilder::skipElementsBySomeUnits(int32_t i, int32_t byteIndex, int32_t
 }
 
 int32_t
-BytesTrieBuilder::indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, UChar byte) const {
+BytesTrieBuilder::indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, char16_t byte) const {
     char b=(char)byte;
     while(b==elements[i].charAt(byteIndex, *strings)) {
         ++i;
index 4a733f9d816c84a0976b00d8171b218770a01692..64a3c65d29a0f719cfdaf18861c50a3d7e259fdb 100644 (file)
@@ -352,7 +352,7 @@ UnicodeString* CanonicalIterator::getEquivalents(const UnicodeString &segment, i
     permutations.setValueDeleter(uprv_deleteUObject);
     basic.setValueDeleter(uprv_deleteUObject);
 
-    UChar USeg[256];
+    char16_t USeg[256];
     int32_t segLen = segment.extract(USeg, 256, status);
     getEquivalents2(&basic, USeg, segLen, status);
 
@@ -429,7 +429,7 @@ UnicodeString* CanonicalIterator::getEquivalents(const UnicodeString &segment, i
     return finalResult;
 }
 
-Hashtable *CanonicalIterator::getEquivalents2(Hashtable *fillinResult, const UChar *segment, int32_t segLen, UErrorCode &status) {
+Hashtable *CanonicalIterator::getEquivalents2(Hashtable *fillinResult, const char16_t *segment, int32_t segLen, UErrorCode &status) {
 
     if (U_FAILURE(status)) {
         return nullptr;
@@ -497,7 +497,7 @@ Hashtable *CanonicalIterator::getEquivalents2(Hashtable *fillinResult, const UCh
  * (with canonical rearrangement!)
  * If so, take the remainder, and return the equivalents 
  */
-Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) {
+Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, const char16_t *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) {
 //Hashtable *CanonicalIterator::extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) {
     //if (PROGRESS) printf(" extract: %s, ", UToS(Tr(UnicodeString(comp))));
     //if (PROGRESS) printf("%s, %i\n", UToS(Tr(segment)), segmentPos);
@@ -517,7 +517,7 @@ Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, con
         status = U_MEMORY_ALLOCATION_ERROR;
         return nullptr;
     }
-    const UChar *decomp=decompString.getBuffer();
+    const char16_t *decomp=decompString.getBuffer();
     int32_t decompLen=decompString.length();
 
     // See if it matches the start of segment (at segmentPos)
index 2316a391a38cbf9d96fcd56f99983e90a9bb9211..470e050479fe5e924445c14fa869a4a2d91c0b00 100644 (file)
@@ -67,7 +67,7 @@ _set_addRange(USet *set, UChar32 start, UChar32 end) {
 }
 
 void U_CALLCONV
-_set_addString(USet *set, const UChar *str, int32_t length) {
+_set_addString(USet *set, const char16_t *str, int32_t length) {
     ((UnicodeSet *)set)->add(icu::UnicodeString((UBool)(length<0), str, length));
 }
 
index 887119a0ebaa155d88506053fa828b861578bd4a..4733a297a824f5f980a6efebb8fadeaaed7d5380 100644 (file)
@@ -85,7 +85,7 @@ CharacterIterator::operator=(const CharacterIterator &that) {
 
 // implementing first[32]PostInc() directly in a subclass should be faster
 // but these implementations make subclassing a little easier
-UChar
+char16_t
 CharacterIterator::firstPostInc(void) {
     setToStart();
     return nextPostInc();
index e6dab6317163f10f32a227402c49b112206bf896..5c4cda3fd33f64a4eb82d6468334a86783e6dd2c 100644 (file)
@@ -200,7 +200,7 @@ CharString &CharString::appendInvariantChars(const UnicodeString &s, UErrorCode
     return appendInvariantChars(s.getBuffer(), s.length(), errorCode);
 }
 
-CharString &CharString::appendInvariantChars(const UChar* uchars, int32_t ucharsLen, UErrorCode &errorCode) {
+CharString &CharString::appendInvariantChars(const char16_t* uchars, int32_t ucharsLen, UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) {
         return *this;
     }
index 92a75d3d2f91d7c19b2ebc09d415f06455ba4bc9..bf62667f9c80d8fbd95166d4f54e7f8d0b1790df 100644 (file)
@@ -156,7 +156,7 @@ public:
                           UErrorCode &errorCode);
 
     CharString &appendInvariantChars(const UnicodeString &s, UErrorCode &errorCode);
-    CharString &appendInvariantChars(const UChar* uchars, int32_t ucharsLen, UErrorCode& errorCode);
+    CharString &appendInvariantChars(const char16_t* uchars, int32_t ucharsLen, UErrorCode& errorCode);
 
     /**
      * Appends a filename/path part, e.g., a directory name.
index 307e570486439f8aa13292f0d7ba326d1ed1270c..2eda999a65715d10d9e63ac806a8d54abf3116fb 100644 (file)
@@ -62,8 +62,8 @@ inline void uprv_arrayCopy(const int32_t* src, int32_t srcStart,
 
 static
 inline void
-uprv_arrayCopy(const UChar *src, int32_t srcStart,
-        UChar *dst, int32_t dstStart, int32_t count)
+uprv_arrayCopy(const char16_t *src, int32_t srcStart,
+        char16_t *dst, int32_t dstStart, int32_t count)
 { uprv_memcpy(dst+dstStart, src+srcStart, (size_t)count * sizeof(*src)); }
 
 /**
index d07e07c6ccc79ad36f5c3fab1d54d078d451d943..f2b3f4762f339f4cd68e95efa1897ecd2b77bc44 100644 (file)
@@ -46,7 +46,7 @@ void U_CALLCONV initSingleton(UErrorCode &errorCode) {
 // TODO: turn this into a shared helper function
 // Requires the major version to match, and then requires at least the minor version.
 UBool udata_isAcceptableMajorMinor(
-        const UDataInfo &info, const UChar *dataFormat, uint8_t major, uint8_t minor) {
+        const UDataInfo &info, const char16_t *dataFormat, uint8_t major, uint8_t minor) {
     return
         info.size >= 20 &&
         info.isBigEndian == U_IS_BIG_ENDIAN &&
@@ -104,7 +104,7 @@ EmojiProps::load(UErrorCode &errorCode) {
         offset = inIndexes[i];
         nextOffset = inIndexes[i + 1];
         // Set/leave nullptr if there is no UCharsTrie.
-        const UChar *p = nextOffset > offset ? (const UChar *)(inBytes + offset) : nullptr;
+        const char16_t *p = nextOffset > offset ? (const char16_t *)(inBytes + offset) : nullptr;
         stringTries[getStringTrieIndex(i)] = p;
     }
 }
@@ -160,14 +160,14 @@ EmojiProps::hasBinaryPropertyImpl(UChar32 c, UProperty which) const {
 }
 
 UBool
-EmojiProps::hasBinaryProperty(const UChar *s, int32_t length, UProperty which) {
+EmojiProps::hasBinaryProperty(const char16_t *s, int32_t length, UProperty which) {
     UErrorCode errorCode = U_ZERO_ERROR;
     const EmojiProps *ep = getSingleton(errorCode);
     return U_SUCCESS(errorCode) && ep->hasBinaryPropertyImpl(s, length, which);
 }
 
 UBool
-EmojiProps::hasBinaryPropertyImpl(const UChar *s, int32_t length, UProperty which) const {
+EmojiProps::hasBinaryPropertyImpl(const char16_t *s, int32_t length, UProperty which) const {
     if (s == nullptr && length != 0) { return false; }
     if (length <= 0 && (length == 0 || *s == 0)) { return false; }  // empty string
     // The caller should have delegated single code points to hasBinaryProperty(c, which).
@@ -181,7 +181,7 @@ EmojiProps::hasBinaryPropertyImpl(const UChar *s, int32_t length, UProperty whic
         lastProp = UCHAR_RGI_EMOJI_ZWJ_SEQUENCE;
     }
     for (int32_t prop = firstProp; prop <= lastProp; ++prop) {
-        const UChar *trieUChars = stringTries[prop - UCHAR_BASIC_EMOJI];
+        const char16_t *trieUChars = stringTries[prop - UCHAR_BASIC_EMOJI];
         if (trieUChars != nullptr) {
             UCharsTrie trie(trieUChars);
             UStringTrieResult result = trie.next(s, length);
@@ -206,7 +206,7 @@ EmojiProps::addStrings(const USetAdder *sa, UProperty which, UErrorCode &errorCo
         lastProp = UCHAR_RGI_EMOJI_ZWJ_SEQUENCE;
     }
     for (int32_t prop = firstProp; prop <= lastProp; ++prop) {
-        const UChar *trieUChars = stringTries[prop - UCHAR_BASIC_EMOJI];
+        const char16_t *trieUChars = stringTries[prop - UCHAR_BASIC_EMOJI];
         if (trieUChars != nullptr) {
             UCharsTrie::Iterator iter(trieUChars, 0, errorCode);
             while (iter.next(errorCode)) {
index 457847c303ab1a8efd7f5992983bca799600c582..777b7b11a83ee9f89da70c0abdaa03f9bd06d8f8 100644 (file)
@@ -23,7 +23,7 @@ public:
 
     static const EmojiProps *getSingleton(UErrorCode &errorCode);
     static UBool hasBinaryProperty(UChar32 c, UProperty which);
-    static UBool hasBinaryProperty(const UChar *s, int32_t length, UProperty which);
+    static UBool hasBinaryProperty(const char16_t *s, int32_t length, UProperty which);
 
     void addPropertyStarts(const USetAdder *sa, UErrorCode &errorCode) const;
     void addStrings(const USetAdder *sa, UProperty which, UErrorCode &errorCode) const;
@@ -78,11 +78,11 @@ private:
 
     void load(UErrorCode &errorCode);
     UBool hasBinaryPropertyImpl(UChar32 c, UProperty which) const;
-    UBool hasBinaryPropertyImpl(const UChar *s, int32_t length, UProperty which) const;
+    UBool hasBinaryPropertyImpl(const char16_t *s, int32_t length, UProperty which) const;
 
     UDataMemory *memory = nullptr;
     UCPTrie *cpTrie = nullptr;
-    const UChar *stringTries[6] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
+    const char16_t *stringTries[6] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
 };
 
 U_NAMESPACE_END
index 7647320099f8b5ef40e7601b73830f6518b67059..9e7358c667da2de062dddeb3ad155ce45113b39b 100644 (file)
@@ -130,7 +130,7 @@ static const int32_t kPARTIAL = (1<<0); //< partial - need to run through forwar
 static const int32_t kMATCH   = (1<<1); //< exact match - skip this one.
 static const int32_t kSuppressInReverse = (1<<0);
 static const int32_t kAddToForward = (1<<1);
-static const UChar   kFULLSTOP = 0x002E; // '.'
+static const char16_t kFULLSTOP = 0x002E; // '.'
 
 /**
  * Shared data for SimpleFilteredSentenceBreakIterator
@@ -289,11 +289,11 @@ SimpleFilteredSentenceBreakIterator::breakExceptionAt(int32_t n) {
     // Assume a space is following the '.'  (so we handle the case:  "Mr. /Brown")
     if(utext_previous32(fText.getAlias())==u' ') {  // TODO: skip a class of chars here??
       // TODO only do this the 1st time?
-      //if(debug2) u_printf("skipping prev: |%C| \n", (UChar)uch);
+      //if(debug2) u_printf("skipping prev: |%C| \n", (char16_t)uch);
     } else {
-      //if(debug2) u_printf("not skipping prev: |%C| \n", (UChar)uch);
+      //if(debug2) u_printf("not skipping prev: |%C| \n", (char16_t)uch);
       utext_next32(fText.getAlias());
-      //if(debug2) u_printf(" -> : |%C| \n", (UChar)uch);
+      //if(debug2) u_printf(" -> : |%C| \n", (char16_t)uch);
     }
 
     {
@@ -309,20 +309,20 @@ SimpleFilteredSentenceBreakIterator::breakExceptionAt(int32_t n) {
             if(!USTRINGTRIE_HAS_NEXT(r)) {
                 break;
             }
-            //if(debug2) u_printf("rev< /%C/ cont?%d @%d\n", (UChar)uch, r, utext_getNativeIndex(fText.getAlias()));
+            //if(debug2) u_printf("rev< /%C/ cont?%d @%d\n", (char16_t)uch, r, utext_getNativeIndex(fText.getAlias()));
         }
     }
 
     //if(bestValue >= 0) {
-        //if(debug2) u_printf("rev<+/%C/+end of seq.. r=%d, bestPosn=%d, bestValue=%d\n", (UChar)uch, r, bestPosn, bestValue);
+        //if(debug2) u_printf("rev<+/%C/+end of seq.. r=%d, bestPosn=%d, bestValue=%d\n", (char16_t)uch, r, bestPosn, bestValue);
     //}
 
     if(bestPosn>=0) {
-      //if(debug2) u_printf("rev< /%C/ end of seq.. r=%d, bestPosn=%d, bestValue=%d\n", (UChar)uch, r, bestPosn, bestValue);
+      //if(debug2) u_printf("rev< /%C/ end of seq.. r=%d, bestPosn=%d, bestValue=%d\n", (char16_t)uch, r, bestPosn, bestValue);
 
       //if(USTRINGTRIE_MATCHES(r)) {  // matched - so, now what?
       //int32_t bestValue = iter.getValue();
-      ////if(debug2) u_printf("rev< /%C/ matched, skip..%d  bestValue=%d\n", (UChar)uch, r, bestValue);
+      ////if(debug2) u_printf("rev< /%C/ matched, skip..%d  bestValue=%d\n", (char16_t)uch, r, bestValue);
 
       if(bestValue == kMATCH) { // exact match!
         //if(debug2) u_printf(" exact backward match\n");
@@ -340,15 +340,15 @@ SimpleFilteredSentenceBreakIterator::breakExceptionAt(int32_t n) {
         UChar32 uch;
         while((uch=utext_next32(fText.getAlias()))!=U_SENTINEL &&
               USTRINGTRIE_HAS_NEXT(rfwd=iter.nextForCodePoint(uch))) {
-          //if(debug2) u_printf("fwd> /%C/ cont?%d @%d\n", (UChar)uch, rfwd, utext_getNativeIndex(fText.getAlias()));
+          //if(debug2) u_printf("fwd> /%C/ cont?%d @%d\n", (char16_t)uch, rfwd, utext_getNativeIndex(fText.getAlias()));
         }
         if(USTRINGTRIE_MATCHES(rfwd)) {
-          //if(debug2) u_printf("fwd> /%C/ == forward match!\n", (UChar)uch);
+          //if(debug2) u_printf("fwd> /%C/ == forward match!\n", (char16_t)uch);
           // only full matches here, nothing to check
           // skip the next:
             return kExceptionHere;
         } else {
-          //if(debug2) u_printf("fwd> /%C/ no match.\n", (UChar)uch);
+          //if(debug2) u_printf("fwd> /%C/ no match.\n", (char16_t)uch);
           // no match (no exception) -return the 'underlying' break
           return kNoExceptionHere;
         }
@@ -356,7 +356,7 @@ SimpleFilteredSentenceBreakIterator::breakExceptionAt(int32_t n) {
         return kNoExceptionHere; // internal error and/or no forwards trie
       }
     } else {
-      //if(debug2) u_printf("rev< /%C/ .. no match..%d\n", (UChar)uch, r);  // no best match
+      //if(debug2) u_printf("rev< /%C/ .. no match..%d\n", (char16_t)uch, r);  // no best match
       return kNoExceptionHere; // No match - so exit. Not an exception.
     }
 }
index 38ca475e997b685c6a624630046933b56b738d87..3ec1b81c8127ab90a83bee38d49619122c647060 100644 (file)
@@ -55,7 +55,7 @@ Locale::getDisplayLanguage(UnicodeString& dispLang) const
 UnicodeString&
 Locale::getDisplayLanguage(const Locale &displayLocale,
                            UnicodeString &result) const {
-    UChar *buffer;
+    char16_t *buffer;
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length;
 
@@ -95,7 +95,7 @@ Locale::getDisplayScript(UnicodeString& dispScript) const
 UnicodeString&
 Locale::getDisplayScript(const Locale &displayLocale,
                           UnicodeString &result) const {
-    UChar *buffer;
+    char16_t *buffer;
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length;
 
@@ -135,7 +135,7 @@ Locale::getDisplayCountry(UnicodeString& dispCntry) const
 UnicodeString&
 Locale::getDisplayCountry(const Locale &displayLocale,
                           UnicodeString &result) const {
-    UChar *buffer;
+    char16_t *buffer;
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length;
 
@@ -175,7 +175,7 @@ Locale::getDisplayVariant(UnicodeString& dispVar) const
 UnicodeString&
 Locale::getDisplayVariant(const Locale &displayLocale,
                           UnicodeString &result) const {
-    UChar *buffer;
+    char16_t *buffer;
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length;
 
@@ -215,7 +215,7 @@ Locale::getDisplayName( UnicodeString& name ) const
 UnicodeString&
 Locale::getDisplayName(const Locale &displayLocale,
                        UnicodeString &result) const {
-    UChar *buffer;
+    char16_t *buffer;
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length;
 
@@ -302,9 +302,9 @@ _getStringOrCopyKey(const char *path, const char *locale,
                     const char* subTableKey,
                     const char *itemKey,
                     const char *substitute,
-                    UChar *dest, int32_t destCapacity,
+                    char16_t *dest, int32_t destCapacity,
                     UErrorCode *pErrorCode) {
-    const UChar *s = nullptr;
+    const char16_t *s = nullptr;
     int32_t length = 0;
 
     if(itemKey==nullptr) {
@@ -362,7 +362,7 @@ typedef  int32_t U_CALLCONV UDisplayNameGetter(const char *, char *, int32_t, UE
 static int32_t
 _getDisplayNameForComponent(const char *locale,
                             const char *displayLocale,
-                            UChar *dest, int32_t destCapacity,
+                            char16_t *dest, int32_t destCapacity,
                             UDisplayNameGetter *getter,
                             const char *tag,
                             UErrorCode *pErrorCode) {
@@ -408,7 +408,7 @@ _getDisplayNameForComponent(const char *locale,
 U_CAPI int32_t U_EXPORT2
 uloc_getDisplayLanguage(const char *locale,
                         const char *displayLocale,
-                        UChar *dest, int32_t destCapacity,
+                        char16_t *dest, int32_t destCapacity,
                         UErrorCode *pErrorCode) {
     return _getDisplayNameForComponent(locale, displayLocale, dest, destCapacity,
                 uloc_getLanguage, _kLanguages, pErrorCode);
@@ -417,7 +417,7 @@ uloc_getDisplayLanguage(const char *locale,
 U_CAPI int32_t U_EXPORT2
 uloc_getDisplayScript(const char* locale,
                       const char* displayLocale,
-                      UChar *dest, int32_t destCapacity,
+                      char16_t *dest, int32_t destCapacity,
                       UErrorCode *pErrorCode)
 {
     UErrorCode err = U_ZERO_ERROR;
@@ -442,7 +442,7 @@ uloc_getDisplayScript(const char* locale,
 static int32_t
 uloc_getDisplayScriptInContext(const char* locale,
                       const char* displayLocale,
-                      UChar *dest, int32_t destCapacity,
+                      char16_t *dest, int32_t destCapacity,
                       UErrorCode *pErrorCode)
 {
     return _getDisplayNameForComponent(locale, displayLocale, dest, destCapacity,
@@ -452,7 +452,7 @@ uloc_getDisplayScriptInContext(const char* locale,
 U_CAPI int32_t U_EXPORT2
 uloc_getDisplayCountry(const char *locale,
                        const char *displayLocale,
-                       UChar *dest, int32_t destCapacity,
+                       char16_t *dest, int32_t destCapacity,
                        UErrorCode *pErrorCode) {
     return _getDisplayNameForComponent(locale, displayLocale, dest, destCapacity,
                 uloc_getCountry, _kCountries, pErrorCode);
@@ -466,7 +466,7 @@ uloc_getDisplayCountry(const char *locale,
 U_CAPI int32_t U_EXPORT2
 uloc_getDisplayVariant(const char *locale,
                        const char *displayLocale,
-                       UChar *dest, int32_t destCapacity,
+                       char16_t *dest, int32_t destCapacity,
                        UErrorCode *pErrorCode) {
     return _getDisplayNameForComponent(locale, displayLocale, dest, destCapacity,
                 uloc_getVariant, _kVariants, pErrorCode);
@@ -487,14 +487,14 @@ uloc_getDisplayVariant(const char *locale,
 U_CAPI int32_t U_EXPORT2
 uloc_getDisplayName(const char *locale,
                     const char *displayLocale,
-                    UChar *dest, int32_t destCapacity,
+                    char16_t *dest, int32_t destCapacity,
                     UErrorCode *pErrorCode)
 {
-    static const UChar defaultSeparator[9] = { 0x007b, 0x0030, 0x007d, 0x002c, 0x0020, 0x007b, 0x0031, 0x007d, 0x0000 }; /* "{0}, {1}" */
-    static const UChar sub0[4] = { 0x007b, 0x0030, 0x007d , 0x0000 } ; /* {0} */
-    static const UChar sub1[4] = { 0x007b, 0x0031, 0x007d , 0x0000 } ; /* {1} */
+    static const char16_t defaultSeparator[9] = { 0x007b, 0x0030, 0x007d, 0x002c, 0x0020, 0x007b, 0x0031, 0x007d, 0x0000 }; /* "{0}, {1}" */
+    static const char16_t sub0[4] = { 0x007b, 0x0030, 0x007d , 0x0000 } ; /* {0} */
+    static const char16_t sub1[4] = { 0x007b, 0x0031, 0x007d , 0x0000 } ; /* {1} */
     static const int32_t subLen = 3;
-    static const UChar defaultPattern[10] = {
+    static const char16_t defaultPattern[10] = {
         0x007b, 0x0030, 0x007d, 0x0020, 0x0028, 0x007b, 0x0031, 0x007d, 0x0029, 0x0000
     }; /* {0} ({1}) */
     static const int32_t defaultPatLen = 9;
@@ -503,16 +503,16 @@ uloc_getDisplayName(const char *locale,
 
     int32_t length; /* of formatted result */
 
-    const UChar *separator;
+    const char16_t *separator;
     int32_t sepLen = 0;
-    const UChar *pattern;
+    const char16_t *pattern;
     int32_t patLen = 0;
     int32_t sub0Pos, sub1Pos;
     
-    UChar formatOpenParen         = 0x0028; // (
-    UChar formatReplaceOpenParen  = 0x005B; // [
-    UChar formatCloseParen        = 0x0029; // )
-    UChar formatReplaceCloseParen = 0x005D; // ]
+    char16_t formatOpenParen         = 0x0028; // (
+    char16_t formatReplaceOpenParen  = 0x005B; // [
+    char16_t formatCloseParen        = 0x0029; // )
+    char16_t formatReplaceCloseParen = 0x005D; // ]
 
     UBool haveLang = true; /* assume true, set false if we find we don't have
                               a lang component in the locale */
@@ -557,13 +557,13 @@ uloc_getDisplayName(const char *locale,
      * This is similar to how pattern is handled below.
      */
     {
-        UChar *p0=u_strstr(separator, sub0);
-        UChar *p1=u_strstr(separator, sub1);
+        char16_t *p0=u_strstr(separator, sub0);
+        char16_t *p1=u_strstr(separator, sub1);
         if (p0==nullptr || p1==nullptr || p1<p0) {
             *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return 0;
         }
-        separator = (const UChar *)p0 + subLen;
+        separator = (const char16_t *)p0 + subLen;
         sepLen = static_cast<int32_t>(p1 - separator);
     }
 
@@ -574,8 +574,8 @@ uloc_getDisplayName(const char *locale,
         sub1Pos=defaultSub1Pos;
         // use default formatOpenParen etc. set above
     } else { /* non-default pattern */
-        UChar *p0=u_strstr(pattern, sub0);
-        UChar *p1=u_strstr(pattern, sub1);
+        char16_t *p0=u_strstr(pattern, sub0);
+        char16_t *p1=u_strstr(pattern, sub1);
         if (p0==nullptr || p1==nullptr) {
             *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return 0;
@@ -602,7 +602,7 @@ uloc_getDisplayName(const char *locale,
      * adjust the parameters so padding is not added, and repeat.
      */
     do {
-        UChar* p=dest;
+        char16_t* p=dest;
         int32_t patPos=0; /* position in the pattern, used for non-substitution portions */
         int32_t langLen=0; /* length of language substitution */
         int32_t langPos=0; /* position in output of language substitution */
@@ -712,7 +712,7 @@ uloc_getDisplayName(const char *locale,
                     if (len>0) {
                         /* we added a component, so add separator and write it if there's room. */
                         if(len+sepLen<=cap) {
-                            const UChar * plimit = p + len;
+                            const char16_t * plimit = p + len;
                             for (; p < plimit; p++) {
                                 if (*p == formatOpenParen) {
                                     *p = formatReplaceOpenParen;
@@ -788,7 +788,7 @@ uloc_getDisplayName(const char *locale,
 U_CAPI int32_t U_EXPORT2
 uloc_getDisplayKeyword(const char* keyword,
                        const char* displayLocale,
-                       UChar* dest,
+                       char16_t* dest,
                        int32_t destCapacity,
                        UErrorCode* status){
 
@@ -820,7 +820,7 @@ U_CAPI int32_t U_EXPORT2
 uloc_getDisplayKeywordValue(   const char* locale,
                                const char* keyword,
                                const char* displayLocale,
-                               UChar* dest,
+                               char16_t* dest,
                                int32_t destCapacity,
                                UErrorCode* status){
 
@@ -849,7 +849,7 @@ uloc_getDisplayKeywordValue(   const char* locale,
     if(uprv_stricmp(keyword, _kCurrency)==0){
 
         int32_t dispNameLen = 0;
-        const UChar *dispName = nullptr;
+        const char16_t *dispName = nullptr;
 
         icu::LocalUResourceBundlePointer bundle(
                 ures_open(U_ICUDATA_CURR, displayLocale, status));
index 87aa19b16b8a2473bca5057a4cffcb9352979544..3ba54111196c6797676702c157590ca5a409fe70 100644 (file)
@@ -125,7 +125,7 @@ ICUDataTable::get(const char* tableKey, const char* subTableKey, const char* ite
   UErrorCode status = U_ZERO_ERROR;
   int32_t len = 0;
 
-  const UChar *s = uloc_getTableStringWithFallback(path, locale.getName(),
+  const char16_t *s = uloc_getTableStringWithFallback(path, locale.getName(),
                                                    tableKey, subTableKey, itemKey,
                                                    &len, &status);
   if (U_SUCCESS(status) && len > 0) {
@@ -140,7 +140,7 @@ ICUDataTable::getNoFallback(const char* tableKey, const char* subTableKey, const
   UErrorCode status = U_ZERO_ERROR;
   int32_t len = 0;
 
-  const UChar *s = uloc_getTableStringWithFallback(path, locale.getName(),
+  const char16_t *s = uloc_getTableStringWithFallback(path, locale.getName(),
                                                    tableKey, subTableKey, itemKey,
                                                    &len, &status);
   if (U_SUCCESS(status)) {
@@ -467,16 +467,16 @@ LocaleDisplayNamesImpl::initialize(void) {
         pattern = UnicodeString("{0} ({1})", -1, US_INV);
     }
     format.applyPatternMinMaxArguments(pattern, 2, 2, status);
-    if (pattern.indexOf((UChar)0xFF08) >= 0) {
-        formatOpenParen.setTo((UChar)0xFF08);         // fullwidth (
-        formatReplaceOpenParen.setTo((UChar)0xFF3B);  // fullwidth [
-        formatCloseParen.setTo((UChar)0xFF09);        // fullwidth )
-        formatReplaceCloseParen.setTo((UChar)0xFF3D); // fullwidth ]
+    if (pattern.indexOf((char16_t)0xFF08) >= 0) {
+        formatOpenParen.setTo((char16_t)0xFF08);         // fullwidth (
+        formatReplaceOpenParen.setTo((char16_t)0xFF3B);  // fullwidth [
+        formatCloseParen.setTo((char16_t)0xFF09);        // fullwidth )
+        formatReplaceCloseParen.setTo((char16_t)0xFF3D); // fullwidth ]
     } else {
-        formatOpenParen.setTo((UChar)0x0028);         // (
-        formatReplaceOpenParen.setTo((UChar)0x005B);  // [
-        formatCloseParen.setTo((UChar)0x0029);        // )
-        formatReplaceCloseParen.setTo((UChar)0x005D); // ]
+        formatOpenParen.setTo((char16_t)0x0028);         // (
+        formatReplaceOpenParen.setTo((char16_t)0x005B);  // [
+        formatCloseParen.setTo((char16_t)0x0029);        // )
+        formatReplaceCloseParen.setTo((char16_t)0x005D); // ]
     }
 
     UnicodeString ktPattern;
@@ -680,7 +680,7 @@ LocaleDisplayNamesImpl::localeDisplayName(const Locale& loc,
         appendWithSep(resultRemainder, temp3);
       } else {
         appendWithSep(resultRemainder, temp)
-          .append((UChar)0x3d /* = */)
+          .append((char16_t)0x3d /* = */)
           .append(temp2);
       }
     }
@@ -879,7 +879,7 @@ LocaleDisplayNamesImpl::keyValueDisplayName(const char* key,
         UErrorCode sts = U_ZERO_ERROR;
         UnicodeString ustrValue(value, -1, US_INV);
         int32_t len;
-        const UChar *currencyName = ucurr_getName(ustrValue.getTerminatedBuffer(),
+        const char16_t *currencyName = ucurr_getName(ustrValue.getTerminatedBuffer(),
             locale.getBaseName(), UCURR_LONG_NAME, nullptr /* isChoiceFormat */, &len, &sts);
         if (U_FAILURE(sts)) {
             // Return the value as is on failure
@@ -995,7 +995,7 @@ uldn_getContext(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_localeDisplayName(const ULocaleDisplayNames *ldn,
                        const char *locale,
-                       UChar *result,
+                       char16_t *result,
                        int32_t maxResultSize,
                        UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
@@ -1017,7 +1017,7 @@ uldn_localeDisplayName(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_languageDisplayName(const ULocaleDisplayNames *ldn,
                          const char *lang,
-                         UChar *result,
+                         char16_t *result,
                          int32_t maxResultSize,
                          UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
@@ -1035,7 +1035,7 @@ uldn_languageDisplayName(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_scriptDisplayName(const ULocaleDisplayNames *ldn,
                        const char *script,
-                       UChar *result,
+                       char16_t *result,
                        int32_t maxResultSize,
                        UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
@@ -1053,7 +1053,7 @@ uldn_scriptDisplayName(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_scriptCodeDisplayName(const ULocaleDisplayNames *ldn,
                            UScriptCode scriptCode,
-                           UChar *result,
+                           char16_t *result,
                            int32_t maxResultSize,
                            UErrorCode *pErrorCode) {
   return uldn_scriptDisplayName(ldn, uscript_getName(scriptCode), result, maxResultSize, pErrorCode);
@@ -1062,7 +1062,7 @@ uldn_scriptCodeDisplayName(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_regionDisplayName(const ULocaleDisplayNames *ldn,
                        const char *region,
-                       UChar *result,
+                       char16_t *result,
                        int32_t maxResultSize,
                        UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
@@ -1080,7 +1080,7 @@ uldn_regionDisplayName(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_variantDisplayName(const ULocaleDisplayNames *ldn,
                         const char *variant,
-                        UChar *result,
+                        char16_t *result,
                         int32_t maxResultSize,
                         UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
@@ -1098,7 +1098,7 @@ uldn_variantDisplayName(const ULocaleDisplayNames *ldn,
 U_CAPI int32_t U_EXPORT2
 uldn_keyDisplayName(const ULocaleDisplayNames *ldn,
                     const char *key,
-                    UChar *result,
+                    char16_t *result,
                     int32_t maxResultSize,
                     UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
@@ -1117,7 +1117,7 @@ U_CAPI int32_t U_EXPORT2
 uldn_keyValueDisplayName(const ULocaleDisplayNames *ldn,
                          const char *key,
                          const char *value,
-                         UChar *result,
+                         char16_t *result,
                          int32_t maxResultSize,
                          UErrorCode *pErrorCode) {
   if (U_FAILURE(*pErrorCode)) {
index 7806952af76558bc2965625bdce4f2b6a102e5ac..d2a05c6364407098b8fffcd98f7da5bc86d0af82 100644 (file)
@@ -58,7 +58,7 @@ findLikelySubtags(const char* localeID,
 
     if (!U_FAILURE(*err)) {
         int32_t resLen = 0;
-        const UChar* s = nullptr;
+        const char16_t* s = nullptr;
         UErrorCode tmpErr = U_ZERO_ERROR;
         icu::LocalUResourceBundlePointer subtags(ures_openDirect(nullptr, "likelySubtags", &tmpErr));
         if (U_SUCCESS(tmpErr)) {
index 018c7000404e34394efeff215ee2d1402f03f8a5..7a0969dff583323c4f15499fd32ae255e70527c5 100644 (file)
@@ -41,7 +41,7 @@
  * default locale because that would result in a mix of languages that is
  * unpredictable to the programmer and most likely useless.
  */
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 uloc_getTableStringWithFallback(const char *path, const char *locale,
                               const char *tableKey, const char *subTableKey,
                               const char *itemKey,
@@ -49,7 +49,7 @@ uloc_getTableStringWithFallback(const char *path, const char *locale,
                               UErrorCode *pErrorCode)
 {
 /*    char localeBuffer[ULOC_FULLNAME_CAPACITY*4];*/
-    const UChar *item=nullptr;
+    const char16_t *item=nullptr;
     UErrorCode errorCode;
     char explicitFallbackName[ULOC_FULLNAME_CAPACITY] = {0};
 
@@ -117,7 +117,7 @@ uloc_getTableStringWithFallback(const char *path, const char *locale,
 
             /* still can't figure out ?.. try the fallback mechanism */
             int32_t len = 0;
-            const UChar* fallbackLocale =  nullptr;
+            const char16_t* fallbackLocale =  nullptr;
             *pErrorCode = errorCode;
             errorCode = U_ZERO_ERROR;
 
@@ -162,7 +162,7 @@ _uloc_getOrientationHelper(const char* localeId,
         uloc_canonicalize(localeId, localeBuffer, sizeof(localeBuffer), status);
 
         if (!U_FAILURE(*status)) {
-            const UChar* const value =
+            const char16_t* const value =
                 uloc_getTableStringWithFallback(
                     nullptr,
                     localeBuffer,
index 690221a003b5bae18a9e1dc19cab164a73a86571..9b9db8ac1d54e691f8fb94324e396af82316d7f7 100644 (file)
@@ -24,9 +24,9 @@
 static icu::UInitOnce   LocaleUtilityInitOnce {};
 static icu::Hashtable * LocaleUtility_cache = nullptr;
 
-#define UNDERSCORE_CHAR ((UChar)0x005f)
-#define AT_SIGN_CHAR    ((UChar)64)
-#define PERIOD_CHAR     ((UChar)46)
+#define UNDERSCORE_CHAR ((char16_t)0x005f)
+#define AT_SIGN_CHAR    ((char16_t)64)
+#define PERIOD_CHAR     ((char16_t)46)
 
 /*
  ******************************************************************
@@ -94,14 +94,14 @@ LocaleUtility::canonicalLocaleString(const UnicodeString* id, UnicodeString& res
       n = end;
     }
     for (; i < n; ++i) {
-      UChar c = result.charAt(i);
+      char16_t c = result.charAt(i);
       if (c >= 0x0041 && c <= 0x005a) {
         c += 0x20;
         result.setCharAt(i, c);
       }
     }
     for (n = end; i < n; ++i) {
-      UChar c = result.charAt(i);
+      char16_t c = result.charAt(i);
       if (c >= 0x0061 && c <= 0x007a) {
         c -= 0x20;
         result.setCharAt(i, c);
@@ -112,7 +112,7 @@ LocaleUtility::canonicalLocaleString(const UnicodeString* id, UnicodeString& res
 
 #if 0
     // This code does a proper full level 2 canonicalization of id.
-    // It's nasty to go from UChar to char to char to UChar -- but
+    // It's nasty to go from char16_t to char to char to char16_t -- but
     // that's what you have to do to use the uloc_canonicalize
     // function on UnicodeStrings.
 
@@ -172,7 +172,7 @@ LocaleUtility::initLocaleFromName(const UnicodeString& id, Locale& result)
         int32_t prev, i;
         prev = 0;
         for(;;) {
-            i = id.indexOf((UChar)0x40, prev);
+            i = id.indexOf((char16_t)0x40, prev);
             if(i < 0) {
                 // no @ between prev and the rest of the string
                 id.extract(prev, INT32_MAX, buffer + prev, BUFLEN - prev, US_INV);
@@ -232,7 +232,7 @@ LocaleUtility::getAvailableLocaleNames(const UnicodeString& bundleID)
             const char* path = cbundleID.isEmpty() ? nullptr : cbundleID.data();
             icu::LocalUEnumerationPointer uenum(ures_openAvailableLocales(path, &status));
             for (;;) {
-                const UChar* id = uenum_unext(uenum.getAlias(), nullptr, &status);
+                const char16_t* id = uenum_unext(uenum.getAlias(), nullptr, &status);
                 if (id == nullptr) {
                     break;
                 }
index f6114cdfe25e19b6c201f99c7395c20e9551cc13..fb8eb01761cd09bed7cbf7ec499049599b52ce79 100644 (file)
@@ -361,7 +361,7 @@ struct LSTMData : public UMemory {
     ~LSTMData();
     UHashtable* fDict;
     EmbeddingType fType;
-    const UChar* fName;
+    const char16_t* fName;
     ConstArray2D fEmbedding;
     ConstArray2D fForwardW;
     ConstArray2D fForwardU;
@@ -394,7 +394,7 @@ LSTMData::LSTMData(UResourceBundle* rb, UErrorCode &status)
         ures_getByKey(rb, "hunits", nullptr, &status));
     if (U_FAILURE(status)) return;
     int32_t hunits = ures_getInt(hunits_res.getAlias(), &status);
-    const UChar* type = ures_getStringByKey(rb, "type", nullptr, &status);
+    const char16_t* type = ures_getStringByKey(rb, "type", nullptr, &status);
     if (U_FAILURE(status)) return;
     if (u_strCompare(type, -1, u"codepoints", -1, false) == 0) {
         fType = CODE_POINTS;
@@ -419,7 +419,7 @@ LSTMData::LSTMData(UResourceBundle* rb, UErrorCode &status)
     int32_t stringLength;
     for (int32_t idx = 0; idx < num_index; idx++) {
         stringArray.getValue(idx, value);
-        const UChar* str = value.getString(stringLength, status);
+        const char16_t* str = value.getString(stringLength, status);
         uhash_putiAllowZero(fDict, (void*)str, idx, &status);
         if (U_FAILURE(status)) return;
 #ifdef LSTM_VECTORIZER_DEBUG
@@ -477,7 +477,7 @@ public:
                            UVector32 &offsets, UVector32 &indices,
                            UErrorCode &status) const = 0;
 protected:
-    int32_t stringToIndex(const UChar* str) const {
+    int32_t stringToIndex(const char16_t* str) const {
         UBool found = false;
         int32_t ret = uhash_getiAndFound(fDict, (const void*)str, &found);
         if (!found) {
@@ -524,13 +524,13 @@ void CodePointsVectorizer::vectorize(
         if (U_FAILURE(status)) return;
         utext_setNativeIndex(text, startPos);
         int32_t current;
-        UChar str[2] = {0, 0};
+        char16_t str[2] = {0, 0};
         while (U_SUCCESS(status) &&
                (current = (int32_t)utext_getNativeIndex(text)) < endPos) {
             // Since the LSTMBreakEngine is currently only accept chars in BMP,
             // we can ignore the possibility of hitting supplementary code
             // point.
-            str[0] = (UChar) utext_next32(text);
+            str[0] = (char16_t) utext_next32(text);
             U_ASSERT(!U_IS_SURROGATE(str[0]));
             offsets.addElement(current, status);
             indices.addElement(stringToIndex(str), status);
@@ -576,7 +576,7 @@ void GraphemeClusterVectorizer::vectorize(
     }
     int32_t last = startPos;
     int32_t current = startPos;
-    UChar str[MAX_GRAPHEME_CLSTER_LENGTH];
+    char16_t str[MAX_GRAPHEME_CLSTER_LENGTH];
     while ((current = graphemeIter->next()) != BreakIterator::DONE) {
         if (current >= endPos) {
             break;
@@ -777,7 +777,7 @@ LSTMBreakEngine::~LSTMBreakEngine() {
     delete fVectorizer;
 }
 
-const UChar* LSTMBreakEngine::name() const {
+const char16_t* LSTMBreakEngine::name() const {
     return fData->fName;
 }
 
@@ -846,7 +846,7 @@ U_CAPI void U_EXPORT2 DeleteLSTMData(const LSTMData* data)
     delete data;
 }
 
-U_CAPI const UChar* U_EXPORT2 LSTMDataName(const LSTMData* data)
+U_CAPI const char16_t* U_EXPORT2 LSTMDataName(const LSTMData* data)
 {
     return data->fName;
 }
index dd4f5f8ccc97ede57d0c8400ebabdb700c602d52..82cb638e4ed7ef99d9937c3300bdbaa133f6c321 100644 (file)
@@ -32,56 +32,56 @@ U_NAMESPACE_BEGIN
 
 // Unicode character/code point constants ---------------------------------- ***
 
-static const UChar u_pound=0x23;
-static const UChar u_apos=0x27;
-static const UChar u_plus=0x2B;
-static const UChar u_comma=0x2C;
-static const UChar u_minus=0x2D;
-static const UChar u_dot=0x2E;
-static const UChar u_colon=0x3A;
-static const UChar u_lessThan=0x3C;
-static const UChar u_equal=0x3D;
-static const UChar u_A=0x41;
-static const UChar u_C=0x43;
-static const UChar u_D=0x44;
-static const UChar u_E=0x45;
-static const UChar u_H=0x48;
-static const UChar u_I=0x49;
-static const UChar u_L=0x4C;
-static const UChar u_N=0x4E;
-static const UChar u_O=0x4F;
-static const UChar u_P=0x50;
-static const UChar u_R=0x52;
-static const UChar u_S=0x53;
-static const UChar u_T=0x54;
-static const UChar u_U=0x55;
-static const UChar u_Z=0x5A;
-static const UChar u_a=0x61;
-static const UChar u_c=0x63;
-static const UChar u_d=0x64;
-static const UChar u_e=0x65;
-static const UChar u_f=0x66;
-static const UChar u_h=0x68;
-static const UChar u_i=0x69;
-static const UChar u_l=0x6C;
-static const UChar u_n=0x6E;
-static const UChar u_o=0x6F;
-static const UChar u_p=0x70;
-static const UChar u_r=0x72;
-static const UChar u_s=0x73;
-static const UChar u_t=0x74;
-static const UChar u_u=0x75;
-static const UChar u_z=0x7A;
-static const UChar u_leftCurlyBrace=0x7B;
-static const UChar u_pipe=0x7C;
-static const UChar u_rightCurlyBrace=0x7D;
-static const UChar u_lessOrEqual=0x2264;  // U+2264 is <=
-
-static const UChar kOffsetColon[]={  // "offset:"
+static const char16_t u_pound=0x23;
+static const char16_t u_apos=0x27;
+static const char16_t u_plus=0x2B;
+static const char16_t u_comma=0x2C;
+static const char16_t u_minus=0x2D;
+static const char16_t u_dot=0x2E;
+static const char16_t u_colon=0x3A;
+static const char16_t u_lessThan=0x3C;
+static const char16_t u_equal=0x3D;
+static const char16_t u_A=0x41;
+static const char16_t u_C=0x43;
+static const char16_t u_D=0x44;
+static const char16_t u_E=0x45;
+static const char16_t u_H=0x48;
+static const char16_t u_I=0x49;
+static const char16_t u_L=0x4C;
+static const char16_t u_N=0x4E;
+static const char16_t u_O=0x4F;
+static const char16_t u_P=0x50;
+static const char16_t u_R=0x52;
+static const char16_t u_S=0x53;
+static const char16_t u_T=0x54;
+static const char16_t u_U=0x55;
+static const char16_t u_Z=0x5A;
+static const char16_t u_a=0x61;
+static const char16_t u_c=0x63;
+static const char16_t u_d=0x64;
+static const char16_t u_e=0x65;
+static const char16_t u_f=0x66;
+static const char16_t u_h=0x68;
+static const char16_t u_i=0x69;
+static const char16_t u_l=0x6C;
+static const char16_t u_n=0x6E;
+static const char16_t u_o=0x6F;
+static const char16_t u_p=0x70;
+static const char16_t u_r=0x72;
+static const char16_t u_s=0x73;
+static const char16_t u_t=0x74;
+static const char16_t u_u=0x75;
+static const char16_t u_z=0x7A;
+static const char16_t u_leftCurlyBrace=0x7B;
+static const char16_t u_pipe=0x7C;
+static const char16_t u_rightCurlyBrace=0x7D;
+static const char16_t u_lessOrEqual=0x2264;  // U+2264 is <=
+
+static const char16_t kOffsetColon[]={  // "offset:"
     u_o, u_f, u_f, u_s, u_e, u_t, u_colon
 };
 
-static const UChar kOther[]={  // "other"
+static const char16_t kOther[]={  // "other"
     u_o, u_t, u_h, u_e, u_r
 };
 
@@ -351,7 +351,7 @@ MessagePattern::autoQuoteApostropheDeep() const {
     for(int32_t i=count; i>0;) {
         const Part &part=getPart(--i);
         if(part.getType()==UMSGPAT_PART_TYPE_INSERT_CHAR) {
-           modified.insert(part.index, (UChar)part.value);
+           modified.insert(part.index, (char16_t)part.value);
         }
     }
     return modified;
@@ -451,7 +451,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength,
         if(index>=msg.length()) {
             break;
         }
-        UChar c=msg.charAt(index++);
+        char16_t c=msg.charAt(index++);
         if(c==u_apos) {
             if(index==msg.length()) {
                 // The apostrophe is the last character in the pattern. 
@@ -582,7 +582,7 @@ MessagePattern::parseArg(int32_t index, int32_t argStartLength, int32_t nestingL
         errorCode=U_UNMATCHED_BRACES;
         return 0;
     }
-    UChar c=msg.charAt(index);
+    char16_t c=msg.charAt(index);
     if(c==u_rightCurlyBrace) {
         // all done
     } else if(c!=u_comma) {
@@ -663,7 +663,7 @@ MessagePattern::parseSimpleStyle(int32_t index, UParseError *parseError, UErrorC
     int32_t start=index;
     int32_t nestedBraces=0;
     while(index<msg.length()) {
-        UChar c=msg.charAt(index++);
+        char16_t c=msg.charAt(index++);
         if(c==u_apos) {
             // Treat apostrophe as quoting but include it in the style part.
             // Find the end of the quoted literal text.
@@ -738,7 +738,7 @@ MessagePattern::parseChoiceStyle(int32_t index, int32_t nestingLevel,
             errorCode=U_PATTERN_SYNTAX_ERROR;
             return 0;
         }
-        UChar c=msg.charAt(index);
+        char16_t c=msg.charAt(index);
         if(!(c==u_pound || c==u_lessThan || c==u_lessOrEqual)) {  // U+2264 is <=
             setParseError(parseError, start);  // Expected choice separator (#<\u2264) instead of c.
             errorCode=U_PATTERN_SYNTAX_ERROR;
@@ -895,7 +895,7 @@ MessagePattern::parseArgNumber(const UnicodeString &s, int32_t start, int32_t li
     int32_t number;
     // Defer numeric errors until we know there are only digits.
     UBool badNumber;
-    UChar c=s.charAt(start++);
+    char16_t c=s.charAt(start++);
     if(c==0x30) {
         if(start==limit) {
             return 0;
@@ -941,7 +941,7 @@ MessagePattern::parseDouble(int32_t start, int32_t limit, UBool allowInfinity,
         int32_t value=0;
         int32_t isNegative=0;  // not boolean so that we can easily add it to value
         int32_t index=start;
-        UChar c=msg.charAt(index++);
+        char16_t c=msg.charAt(index++);
         if(c==u_minus) {
             isNegative=1;
             if(index==limit) {
@@ -1004,17 +1004,17 @@ MessagePattern::parseDouble(int32_t start, int32_t limit, UBool allowInfinity,
 
 int32_t
 MessagePattern::skipWhiteSpace(int32_t index) {
-    const UChar *s=msg.getBuffer();
+    const char16_t *s=msg.getBuffer();
     int32_t msgLength=msg.length();
-    const UChar *t=PatternProps::skipWhiteSpace(s+index, msgLength-index);
+    const char16_t *t=PatternProps::skipWhiteSpace(s+index, msgLength-index);
     return (int32_t)(t-s);
 }
 
 int32_t
 MessagePattern::skipIdentifier(int32_t index) {
-    const UChar *s=msg.getBuffer();
+    const char16_t *s=msg.getBuffer();
     int32_t msgLength=msg.length();
-    const UChar *t=PatternProps::skipIdentifier(s+index, msgLength-index);
+    const char16_t *t=PatternProps::skipIdentifier(s+index, msgLength-index);
     return (int32_t)(t-s);
 }
 
@@ -1022,7 +1022,7 @@ int32_t
 MessagePattern::skipDouble(int32_t index) {
     int32_t msgLength=msg.length();
     while(index<msgLength) {
-        UChar c=msg.charAt(index);
+        char16_t c=msg.charAt(index);
         // U+221E: Allow the infinity symbol, for ChoiceFormat patterns.
         if((c<0x30 && c!=u_plus && c!=u_minus && c!=u_dot) || (c>0x39 && c!=u_e && c!=u_E && c!=0x221e)) {
             break;
@@ -1039,7 +1039,7 @@ MessagePattern::isArgTypeChar(UChar32 c) {
 
 UBool
 MessagePattern::isChoice(int32_t index) {
-    UChar c;
+    char16_t c;
     return
         ((c=msg.charAt(index++))==u_c || c==u_C) &&
         ((c=msg.charAt(index++))==u_h || c==u_H) &&
@@ -1051,7 +1051,7 @@ MessagePattern::isChoice(int32_t index) {
 
 UBool
 MessagePattern::isPlural(int32_t index) {
-    UChar c;
+    char16_t c;
     return
         ((c=msg.charAt(index++))==u_p || c==u_P) &&
         ((c=msg.charAt(index++))==u_l || c==u_L) &&
@@ -1063,7 +1063,7 @@ MessagePattern::isPlural(int32_t index) {
 
 UBool
 MessagePattern::isSelect(int32_t index) {
-    UChar c;
+    char16_t c;
     return
         ((c=msg.charAt(index++))==u_s || c==u_S) &&
         ((c=msg.charAt(index++))==u_e || c==u_E) &&
@@ -1075,7 +1075,7 @@ MessagePattern::isSelect(int32_t index) {
 
 UBool
 MessagePattern::isOrdinal(int32_t index) {
-    UChar c;
+    char16_t c;
     return
         ((c=msg.charAt(index++))==u_o || c==u_O) &&
         ((c=msg.charAt(index++))==u_r || c==u_R) &&
index c07f6b71ae9aa41b60741e8ad8f8e5cf082497e4..4374f718365cc7b44404700eaf5e48244aee6345 100644 (file)
@@ -43,7 +43,7 @@ public:
             dest.setToBogus();
             return dest;
         }
-        const UChar *sArray=src.getBuffer();
+        const char16_t *sArray=src.getBuffer();
         if(&dest==&src || sArray==nullptr) {
             errorCode=U_ILLEGAL_ARGUMENT_ERROR;
             dest.setToBogus();
@@ -57,7 +57,7 @@ public:
         return dest;
     }
     virtual void
-    normalize(const UChar *src, const UChar *limit,
+    normalize(const char16_t *src, const char16_t *limit,
               ReorderingBuffer &buffer, UErrorCode &errorCode) const = 0;
 
     // normalize and append
@@ -82,7 +82,7 @@ public:
         if(U_FAILURE(errorCode)) {
             return first;
         }
-        const UChar *secondArray=second.getBuffer();
+        const char16_t *secondArray=second.getBuffer();
         if(&first==&second || secondArray==nullptr) {
             errorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return first;
@@ -103,14 +103,14 @@ public:
         return first;
     }
     virtual void
-    normalizeAndAppend(const UChar *src, const UChar *limit, UBool doNormalize,
+    normalizeAndAppend(const char16_t *src, const char16_t *limit, UBool doNormalize,
                        UnicodeString &safeMiddle,
                        ReorderingBuffer &buffer, UErrorCode &errorCode) const = 0;
     virtual UBool
     getDecomposition(UChar32 c, UnicodeString &decomposition) const U_OVERRIDE {
-        UChar buffer[4];
+        char16_t buffer[4];
         int32_t length;
-        const UChar *d=impl.getDecomposition(c, buffer, length);
+        const char16_t *d=impl.getDecomposition(c, buffer, length);
         if(d==nullptr) {
             return false;
         }
@@ -123,9 +123,9 @@ public:
     }
     virtual UBool
     getRawDecomposition(UChar32 c, UnicodeString &decomposition) const U_OVERRIDE {
-        UChar buffer[30];
+        char16_t buffer[30];
         int32_t length;
-        const UChar *d=impl.getRawDecomposition(c, buffer, length);
+        const char16_t *d=impl.getRawDecomposition(c, buffer, length);
         if(d==nullptr) {
             return false;
         }
@@ -152,12 +152,12 @@ public:
         if(U_FAILURE(errorCode)) {
             return false;
         }
-        const UChar *sArray=s.getBuffer();
+        const char16_t *sArray=s.getBuffer();
         if(sArray==nullptr) {
             errorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return false;
         }
-        const UChar *sLimit=sArray+s.length();
+        const char16_t *sLimit=sArray+s.length();
         return sLimit==spanQuickCheckYes(sArray, sLimit, errorCode);
     }
     virtual UNormalizationCheckResult
@@ -169,15 +169,15 @@ public:
         if(U_FAILURE(errorCode)) {
             return 0;
         }
-        const UChar *sArray=s.getBuffer();
+        const char16_t *sArray=s.getBuffer();
         if(sArray==nullptr) {
             errorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return 0;
         }
         return (int32_t)(spanQuickCheckYes(sArray, sArray+s.length(), errorCode)-sArray);
     }
-    virtual const UChar *
-    spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &errorCode) const = 0;
+    virtual const char16_t *
+    spanQuickCheckYes(const char16_t *src, const char16_t *limit, UErrorCode &errorCode) const = 0;
 
     virtual UNormalizationCheckResult getQuickCheck(UChar32) const {
         return UNORM_YES;
@@ -193,13 +193,13 @@ public:
 
 private:
     virtual void
-    normalize(const UChar *src, const UChar *limit,
+    normalize(const char16_t *src, const char16_t *limit,
               ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
         impl.decompose(src, limit, &buffer, errorCode);
     }
     using Normalizer2WithImpl::normalize;  // Avoid warning about hiding base class function.
     virtual void
-    normalizeAndAppend(const UChar *src, const UChar *limit, UBool doNormalize,
+    normalizeAndAppend(const char16_t *src, const char16_t *limit, UBool doNormalize,
                        UnicodeString &safeMiddle,
                        ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
         impl.decomposeAndAppend(src, limit, doNormalize, safeMiddle, buffer, errorCode);
@@ -228,8 +228,8 @@ private:
         return sLimit == impl.decomposeUTF8(0, s, sLimit, nullptr, nullptr, errorCode);
     }
 
-    virtual const UChar *
-    spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &errorCode) const U_OVERRIDE {
+    virtual const char16_t *
+    spanQuickCheckYes(const char16_t *src, const char16_t *limit, UErrorCode &errorCode) const U_OVERRIDE {
         return impl.decompose(src, limit, nullptr, errorCode);
     }
     using Normalizer2WithImpl::spanQuickCheckYes;  // Avoid warning about hiding base class function.
@@ -255,7 +255,7 @@ public:
 
 private:
     virtual void
-    normalize(const UChar *src, const UChar *limit,
+    normalize(const char16_t *src, const char16_t *limit,
               ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
         impl.compose(src, limit, onlyContiguous, true, buffer, errorCode);
     }
@@ -277,7 +277,7 @@ private:
     }
 
     virtual void
-    normalizeAndAppend(const UChar *src, const UChar *limit, UBool doNormalize,
+    normalizeAndAppend(const char16_t *src, const char16_t *limit, UBool doNormalize,
                        UnicodeString &safeMiddle,
                        ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
         impl.composeAndAppend(src, limit, doNormalize, onlyContiguous, safeMiddle, buffer, errorCode);
@@ -288,7 +288,7 @@ private:
         if(U_FAILURE(errorCode)) {
             return false;
         }
-        const UChar *sArray=s.getBuffer();
+        const char16_t *sArray=s.getBuffer();
         if(sArray==nullptr) {
             errorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return false;
@@ -313,7 +313,7 @@ private:
         if(U_FAILURE(errorCode)) {
             return UNORM_MAYBE;
         }
-        const UChar *sArray=s.getBuffer();
+        const char16_t *sArray=s.getBuffer();
         if(sArray==nullptr) {
             errorCode=U_ILLEGAL_ARGUMENT_ERROR;
             return UNORM_MAYBE;
@@ -322,8 +322,8 @@ private:
         impl.composeQuickCheck(sArray, sArray+s.length(), onlyContiguous, &qcResult);
         return qcResult;
     }
-    virtual const UChar *
-    spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &) const U_OVERRIDE {
+    virtual const char16_t *
+    spanQuickCheckYes(const char16_t *src, const char16_t *limit, UErrorCode &) const U_OVERRIDE {
         return impl.composeQuickCheck(src, limit, onlyContiguous, nullptr);
     }
     using Normalizer2WithImpl::spanQuickCheckYes;  // Avoid warning about hiding base class function.
@@ -350,19 +350,19 @@ public:
 
 private:
     virtual void
-    normalize(const UChar *src, const UChar *limit,
+    normalize(const char16_t *src, const char16_t *limit,
               ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
         impl.makeFCD(src, limit, &buffer, errorCode);
     }
     using Normalizer2WithImpl::normalize;  // Avoid warning about hiding base class function.
     virtual void
-    normalizeAndAppend(const UChar *src, const UChar *limit, UBool doNormalize,
+    normalizeAndAppend(const char16_t *src, const char16_t *limit, UBool doNormalize,
                        UnicodeString &safeMiddle,
                        ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
         impl.makeFCDAndAppend(src, limit, doNormalize, safeMiddle, buffer, errorCode);
     }
-    virtual const UChar *
-    spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &errorCode) const U_OVERRIDE {
+    virtual const char16_t *
+    spanQuickCheckYes(const char16_t *src, const char16_t *limit, UErrorCode &errorCode) const U_OVERRIDE {
         return impl.makeFCD(src, limit, nullptr, errorCode);
     }
     using Normalizer2WithImpl::spanQuickCheckYes;  // Avoid warning about hiding base class function.
index 22e1ed6711b92cb7a8d200b475b2126eba184df9..e12edba486bcbd38baca58bd9fffad1d7a4a4abc 100644 (file)
@@ -327,8 +327,8 @@ unorm2_close(UNormalizer2 *norm2) {
 
 U_CAPI int32_t U_EXPORT2
 unorm2_normalize(const UNormalizer2 *norm2,
-                 const UChar *src, int32_t length,
-                 UChar *dest, int32_t capacity,
+                 const char16_t *src, int32_t length,
+                 char16_t *dest, int32_t capacity,
                  UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -361,8 +361,8 @@ unorm2_normalize(const UNormalizer2 *norm2,
 
 static int32_t
 normalizeSecondAndAppend(const UNormalizer2 *norm2,
-                         UChar *first, int32_t firstLength, int32_t firstCapacity,
-                         const UChar *second, int32_t secondLength,
+                         char16_t *first, int32_t firstLength, int32_t firstCapacity,
+                         const char16_t *second, int32_t secondLength,
                          UBool doNormalize,
                          UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
@@ -417,8 +417,8 @@ normalizeSecondAndAppend(const UNormalizer2 *norm2,
 
 U_CAPI int32_t U_EXPORT2
 unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
-                                UChar *first, int32_t firstLength, int32_t firstCapacity,
-                                const UChar *second, int32_t secondLength,
+                                char16_t *first, int32_t firstLength, int32_t firstCapacity,
+                                const char16_t *second, int32_t secondLength,
                                 UErrorCode *pErrorCode) {
     return normalizeSecondAndAppend(norm2,
                                     first, firstLength, firstCapacity,
@@ -428,8 +428,8 @@ unorm2_normalizeSecondAndAppend(const UNormalizer2 *norm2,
 
 U_CAPI int32_t U_EXPORT2
 unorm2_append(const UNormalizer2 *norm2,
-              UChar *first, int32_t firstLength, int32_t firstCapacity,
-              const UChar *second, int32_t secondLength,
+              char16_t *first, int32_t firstLength, int32_t firstCapacity,
+              const char16_t *second, int32_t secondLength,
               UErrorCode *pErrorCode) {
     return normalizeSecondAndAppend(norm2,
                                     first, firstLength, firstCapacity,
@@ -439,7 +439,7 @@ unorm2_append(const UNormalizer2 *norm2,
 
 U_CAPI int32_t U_EXPORT2
 unorm2_getDecomposition(const UNormalizer2 *norm2,
-                        UChar32 c, UChar *decomposition, int32_t capacity,
+                        UChar32 c, char16_t *decomposition, int32_t capacity,
                         UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -458,7 +458,7 @@ unorm2_getDecomposition(const UNormalizer2 *norm2,
 
 U_CAPI int32_t U_EXPORT2
 unorm2_getRawDecomposition(const UNormalizer2 *norm2,
-                           UChar32 c, UChar *decomposition, int32_t capacity,
+                           UChar32 c, char16_t *decomposition, int32_t capacity,
                            UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -487,7 +487,7 @@ unorm2_getCombiningClass(const UNormalizer2 *norm2, UChar32 c) {
 
 U_CAPI UBool U_EXPORT2
 unorm2_isNormalized(const UNormalizer2 *norm2,
-                    const UChar *s, int32_t length,
+                    const char16_t *s, int32_t length,
                     UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -502,7 +502,7 @@ unorm2_isNormalized(const UNormalizer2 *norm2,
 
 U_CAPI UNormalizationCheckResult U_EXPORT2
 unorm2_quickCheck(const UNormalizer2 *norm2,
-                  const UChar *s, int32_t length,
+                  const char16_t *s, int32_t length,
                   UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return UNORM_NO;
@@ -517,7 +517,7 @@ unorm2_quickCheck(const UNormalizer2 *norm2,
 
 U_CAPI int32_t U_EXPORT2
 unorm2_spanQuickCheckYes(const UNormalizer2 *norm2,
-                         const UChar *s, int32_t length,
+                         const char16_t *s, int32_t length,
                          UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
index f3346e85a4cdc222af4fe516ff3e215fd18e6f3a..ae66fb695f2bbb74d9ebdd3dd2fbe8de306f39ca 100644 (file)
@@ -81,8 +81,8 @@ UChar32 codePointFromValidUTF8(const uint8_t *cpStart, const uint8_t *cpLimit) {
     case 2:
         return ((c&0x1f)<<6) | (cpStart[1]&0x3f);
     case 3:
-        // no need for (c&0xf) because the upper bits are truncated after <<12 in the cast to (UChar)
-        return (UChar)((c<<12) | ((cpStart[1]&0x3f)<<6) | (cpStart[2]&0x3f));
+        // no need for (c&0xf) because the upper bits are truncated after <<12 in the cast to (char16_t)
+        return (char16_t)((c<<12) | ((cpStart[1]&0x3f)<<6) | (cpStart[2]&0x3f));
     case 4:
         return ((c&7)<<18) | ((cpStart[1]&0x3f)<<12) | ((cpStart[2]&0x3f)<<6) | (cpStart[3]&0x3f);
     default:
@@ -204,7 +204,7 @@ UBool ReorderingBuffer::init(int32_t destCapacity, UErrorCode &errorCode) {
     return true;
 }
 
-UBool ReorderingBuffer::equals(const UChar *otherStart, const UChar *otherLimit) const {
+UBool ReorderingBuffer::equals(const char16_t *otherStart, const char16_t *otherLimit) const {
     int32_t length=(int32_t)(limit-start);
     return
         length==(int32_t)(otherLimit-otherStart) &&
@@ -256,7 +256,7 @@ UBool ReorderingBuffer::appendSupplementary(UChar32 c, uint8_t cc, UErrorCode &e
     return true;
 }
 
-UBool ReorderingBuffer::append(const UChar *s, int32_t length, UBool isNFD,
+UBool ReorderingBuffer::append(const char16_t *s, int32_t length, UBool isNFD,
                                uint8_t leadCC, uint8_t trailCC,
                                UErrorCode &errorCode) {
     if(length==0) {
@@ -272,7 +272,7 @@ UBool ReorderingBuffer::append(const UChar *s, int32_t length, UBool isNFD,
         } else if(leadCC<=1) {
             reorderStart=limit+1;  // Ok if not a code point boundary.
         }
-        const UChar *sLimit=s+length;
+        const char16_t *sLimit=s+length;
         do { *limit++=*s++; } while(s!=sLimit);
         lastCC=trailCC;
     } else {
@@ -304,7 +304,7 @@ UBool ReorderingBuffer::appendZeroCC(UChar32 c, UErrorCode &errorCode) {
     }
     remainingCapacity-=cpLength;
     if(cpLength==1) {
-        *limit++=(UChar)c;
+        *limit++=(char16_t)c;
     } else {
         limit[0]=U16_LEAD(c);
         limit[1]=U16_TRAIL(c);
@@ -315,7 +315,7 @@ UBool ReorderingBuffer::appendZeroCC(UChar32 c, UErrorCode &errorCode) {
     return true;
 }
 
-UBool ReorderingBuffer::appendZeroCC(const UChar *s, const UChar *sLimit, UErrorCode &errorCode) {
+UBool ReorderingBuffer::appendZeroCC(const char16_t *s, const char16_t *sLimit, UErrorCode &errorCode) {
     if(s==sLimit) {
         return true;
     }
@@ -375,7 +375,7 @@ UBool ReorderingBuffer::resize(int32_t appendLength, UErrorCode &errorCode) {
 
 void ReorderingBuffer::skipPrevious() {
     codePointLimit=codePointStart;
-    UChar c=*--codePointStart;
+    char16_t c=*--codePointStart;
     if(U16_IS_TRAIL(c) && start<codePointStart && U16_IS_LEAD(*(codePointStart-1))) {
         --codePointStart;
     }
@@ -387,7 +387,7 @@ uint8_t ReorderingBuffer::previousCC() {
         return 0;
     }
     UChar32 c=*--codePointStart;
-    UChar c2;
+    char16_t c2;
     if(U16_IS_TRAIL(c) && start<codePointStart && U16_IS_LEAD(c2=*(codePointStart-1))) {
         --codePointStart;
         c=U16_GET_SUPPLEMENTARY(c2, c);
@@ -400,8 +400,8 @@ uint8_t ReorderingBuffer::previousCC() {
 void ReorderingBuffer::insert(UChar32 c, uint8_t cc) {
     for(setIterator(), skipPrevious(); previousCC()>cc;) {}
     // insert c at codePointLimit, after the character with prevCC<=cc
-    UChar *q=limit;
-    UChar *r=limit+=U16_LENGTH(c);
+    char16_t *q=limit;
+    char16_t *r=limit+=U16_LENGTH(c);
     do {
         *--r=*--q;
     } while(codePointLimit!=q);
@@ -429,9 +429,9 @@ Normalizer2Impl::~Normalizer2Impl() {
 void
 Normalizer2Impl::init(const int32_t *inIndexes, const UCPTrie *inTrie,
                       const uint16_t *inExtraData, const uint8_t *inSmallFCD) {
-    minDecompNoCP = static_cast<UChar>(inIndexes[IX_MIN_DECOMP_NO_CP]);
-    minCompNoMaybeCP = static_cast<UChar>(inIndexes[IX_MIN_COMP_NO_MAYBE_CP]);
-    minLcccCP = static_cast<UChar>(inIndexes[IX_MIN_LCCC_CP]);
+    minDecompNoCP = static_cast<char16_t>(inIndexes[IX_MIN_DECOMP_NO_CP]);
+    minCompNoMaybeCP = static_cast<char16_t>(inIndexes[IX_MIN_COMP_NO_MAYBE_CP]);
+    minLcccCP = static_cast<char16_t>(inIndexes[IX_MIN_LCCC_CP]);
 
     minYesNo = static_cast<uint16_t>(inIndexes[IX_MIN_YES_NO]);
     minYesNoMappingsOnly = static_cast<uint16_t>(inIndexes[IX_MIN_YES_NO_MAPPINGS_ONLY]);
@@ -503,7 +503,7 @@ Normalizer2Impl::addPropertyStarts(const USetAdder *sa, UErrorCode & /*errorCode
     }
 
     /* add Hangul LV syllables and LV+1 because of skippables */
-    for(UChar c=Hangul::HANGUL_BASE; c<Hangul::HANGUL_LIMIT; c+=Hangul::JAMO_T_COUNT) {
+    for(char16_t c=Hangul::HANGUL_BASE; c<Hangul::HANGUL_LIMIT; c+=Hangul::JAMO_T_COUNT) {
         sa->add(sa->set, c);
         sa->add(sa->set, c+1);
     }
@@ -524,8 +524,8 @@ Normalizer2Impl::addCanonIterPropertyStarts(const USetAdder *sa, UErrorCode &err
     }
 }
 
-const UChar *
-Normalizer2Impl::copyLowPrefixFromNulTerminated(const UChar *src,
+const char16_t *
+Normalizer2Impl::copyLowPrefixFromNulTerminated(const char16_t *src,
                                                 UChar32 minNeedDataCP,
                                                 ReorderingBuffer *buffer,
                                                 UErrorCode &errorCode) const {
@@ -534,8 +534,8 @@ Normalizer2Impl::copyLowPrefixFromNulTerminated(const UChar *src,
     // data and check the first part of the string.
     // After this prefix, determine the string length to simplify the rest
     // of the code.
-    const UChar *prevSrc=src;
-    UChar c;
+    const char16_t *prevSrc=src;
+    char16_t c;
     while((c=*src++)<minNeedDataCP && c!=0) {}
     // Back out the last character for full processing.
     // Copy this prefix.
@@ -554,7 +554,7 @@ Normalizer2Impl::decompose(const UnicodeString &src, UnicodeString &dest,
         dest.setToBogus();
         return dest;
     }
-    const UChar *sArray=src.getBuffer();
+    const char16_t *sArray=src.getBuffer();
     if(&dest==&src || sArray==nullptr) {
         errorCode=U_ILLEGAL_ARGUMENT_ERROR;
         dest.setToBogus();
@@ -565,7 +565,7 @@ Normalizer2Impl::decompose(const UnicodeString &src, UnicodeString &dest,
 }
 
 void
-Normalizer2Impl::decompose(const UChar *src, const UChar *limit,
+Normalizer2Impl::decompose(const char16_t *src, const char16_t *limit,
                            UnicodeString &dest,
                            int32_t destLengthEstimate,
                            UErrorCode &errorCode) const {
@@ -582,8 +582,8 @@ Normalizer2Impl::decompose(const UChar *src, const UChar *limit,
 // Dual functionality:
 // buffer!=nullptr: normalize
 // buffer==nullptr: isNormalized/spanQuickCheckYes
-const UChar *
-Normalizer2Impl::decompose(const UChar *src, const UChar *limit,
+const char16_t *
+Normalizer2Impl::decompose(const char16_t *src, const char16_t *limit,
                            ReorderingBuffer *buffer,
                            UErrorCode &errorCode) const {
     UChar32 minNoCP=minDecompNoCP;
@@ -595,12 +595,12 @@ Normalizer2Impl::decompose(const UChar *src, const UChar *limit,
         limit=u_strchr(src, 0);
     }
 
-    const UChar *prevSrc;
+    const char16_t *prevSrc;
     UChar32 c=0;
     uint16_t norm16=0;
 
     // only for quick check
-    const UChar *prevBoundary=src;
+    const char16_t *prevBoundary=src;
     uint8_t prevCC=0;
 
     for(;;) {
@@ -613,7 +613,7 @@ Normalizer2Impl::decompose(const UChar *src, const UChar *limit,
             } else if(!U16_IS_LEAD(c)) {
                 break;
             } else {
-                UChar c2;
+                char16_t c2;
                 if((src+1)!=limit && U16_IS_TRAIL(c2=src[1])) {
                     c=U16_GET_SUPPLEMENTARY(c, c2);
                     norm16=UCPTRIE_FAST_SUPP_GET(normTrie, UCPTRIE_16, c);
@@ -669,8 +669,8 @@ Normalizer2Impl::decompose(const UChar *src, const UChar *limit,
 // fail the quick check loop and/or where the quick check loop's overhead
 // is unlikely to be amortized.
 // Called by the compose() and makeFCD() implementations.
-const UChar *
-Normalizer2Impl::decomposeShort(const UChar *src, const UChar *limit,
+const char16_t *
+Normalizer2Impl::decomposeShort(const char16_t *src, const char16_t *limit,
                                 UBool stopAtCompBoundary, UBool onlyContiguous,
                                 ReorderingBuffer &buffer, UErrorCode &errorCode) const {
     if (U_FAILURE(errorCode)) {
@@ -680,7 +680,7 @@ Normalizer2Impl::decomposeShort(const UChar *src, const UChar *limit,
         if (stopAtCompBoundary && *src < minCompNoMaybeCP) {
             return src;
         }
-        const UChar *prevSrc = src;
+        const char16_t *prevSrc = src;
         UChar32 c;
         uint16_t norm16;
         UCPTRIE_FAST_U16_NEXT(normTrie, UCPTRIE_16, src, limit, c, norm16);
@@ -714,7 +714,7 @@ UBool Normalizer2Impl::decompose(UChar32 c, uint16_t norm16,
         return buffer.append(c, 0, errorCode);
     } else if(isHangulLV(norm16) || isHangulLVT(norm16)) {
         // Hangul syllable: decompose algorithmically
-        UChar jamos[3];
+        char16_t jamos[3];
         return buffer.appendZeroCC(jamos, jamos+Hangul::decompose(c, jamos), errorCode);
     }
     // c decomposes, get everything from the variable-length extra data
@@ -728,7 +728,7 @@ UBool Normalizer2Impl::decompose(UChar32 c, uint16_t norm16,
     } else {
         leadCC=0;
     }
-    return buffer.append((const UChar *)mapping+1, length, true, leadCC, trailCC, errorCode);
+    return buffer.append((const char16_t *)mapping+1, length, true, leadCC, trailCC, errorCode);
 }
 
 // Dual functionality:
@@ -943,14 +943,14 @@ Normalizer2Impl::decomposeShort(const uint8_t *src, const uint8_t *limit,
     return src;
 }
 
-const UChar *
-Normalizer2Impl::getDecomposition(UChar32 c, UChar buffer[4], int32_t &length) const {
+const char16_t *
+Normalizer2Impl::getDecomposition(UChar32 c, char16_t buffer[4], int32_t &length) const {
     uint16_t norm16;
     if(c<minDecompNoCP || isMaybeOrNonZeroCC(norm16=getNorm16(c))) {
         // c does not decompose
         return nullptr;
     }
-    const UChar *decomp = nullptr;
+    const char16_t *decomp = nullptr;
     if(isDecompNoAlgorithmic(norm16)) {
         // Maps to an isCompYesAndZeroCC.
         c=mapAlgorithmic(c, norm16);
@@ -970,15 +970,15 @@ Normalizer2Impl::getDecomposition(UChar32 c, UChar buffer[4], int32_t &length) c
     // c decomposes, get everything from the variable-length extra data
     const uint16_t *mapping=getMapping(norm16);
     length=*mapping&MAPPING_LENGTH_MASK;
-    return (const UChar *)mapping+1;
+    return (const char16_t *)mapping+1;
 }
 
 // The capacity of the buffer must be 30=MAPPING_LENGTH_MASK-1
 // so that a raw mapping fits that consists of one unit ("rm0")
 // plus all but the first two code units of the normal mapping.
 // The maximum length of a normal mapping is 31=MAPPING_LENGTH_MASK.
-const UChar *
-Normalizer2Impl::getRawDecomposition(UChar32 c, UChar buffer[30], int32_t &length) const {
+const char16_t *
+Normalizer2Impl::getRawDecomposition(UChar32 c, char16_t buffer[30], int32_t &length) const {
     uint16_t norm16;
     if(c<minDecompNoCP || isDecompYes(norm16=getNorm16(c))) {
         // c does not decompose
@@ -1005,21 +1005,21 @@ Normalizer2Impl::getRawDecomposition(UChar32 c, UChar buffer[30], int32_t &lengt
         uint16_t rm0=*rawMapping;
         if(rm0<=MAPPING_LENGTH_MASK) {
             length=rm0;
-            return (const UChar *)rawMapping-rm0;
+            return (const char16_t *)rawMapping-rm0;
         } else {
             // Copy the normal mapping and replace its first two code units with rm0.
-            buffer[0]=(UChar)rm0;
-            u_memcpy(buffer+1, (const UChar *)mapping+1+2, mLength-2);
+            buffer[0]=(char16_t)rm0;
+            u_memcpy(buffer+1, (const char16_t *)mapping+1+2, mLength-2);
             length=mLength-1;
             return buffer;
         }
     } else {
         length=mLength;
-        return (const UChar *)mapping+1;
+        return (const char16_t *)mapping+1;
     }
 }
 
-void Normalizer2Impl::decomposeAndAppend(const UChar *src, const UChar *limit,
+void Normalizer2Impl::decomposeAndAppend(const char16_t *src, const char16_t *limit,
                                          UBool doDecompose,
                                          UnicodeString &safeMiddle,
                                          ReorderingBuffer &buffer,
@@ -1032,9 +1032,9 @@ void Normalizer2Impl::decomposeAndAppend(const UChar *src, const UChar *limit,
     // Just merge the strings at the boundary.
     bool isFirst = true;
     uint8_t firstCC = 0, prevCC = 0, cc;
-    const UChar *p = src;
+    const char16_t *p = src;
     while (p != limit) {
-        const UChar *codePointStart = p;
+        const char16_t *codePointStart = p;
         UChar32 c;
         uint16_t norm16;
         UCPTRIE_FAST_U16_NEXT(normTrie, UCPTRIE_16, p, limit, c, norm16);
@@ -1218,13 +1218,13 @@ void Normalizer2Impl::addComposites(const uint16_t *list, UnicodeSet &set) const
  */
 void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStartIndex,
                                 UBool onlyContiguous) const {
-    UChar *p=buffer.getStart()+recomposeStartIndex;
-    UChar *limit=buffer.getLimit();
+    char16_t *p=buffer.getStart()+recomposeStartIndex;
+    char16_t *limit=buffer.getLimit();
     if(p==limit) {
         return;
     }
 
-    UChar *starter, *pRemove, *q, *r;
+    char16_t *starter, *pRemove, *q, *r;
     const uint16_t *compositionsList;
     UChar32 c, compositeAndFwd;
     uint16_t norm16;
@@ -1252,15 +1252,15 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
                 // c is a Jamo V/T, see if we can compose it with the previous character.
                 if(c<Hangul::JAMO_T_BASE) {
                     // c is a Jamo Vowel, compose with previous Jamo L and following Jamo T.
-                    UChar prev=(UChar)(*starter-Hangul::JAMO_L_BASE);
+                    char16_t prev=(char16_t)(*starter-Hangul::JAMO_L_BASE);
                     if(prev<Hangul::JAMO_L_COUNT) {
                         pRemove=p-1;
-                        UChar syllable=(UChar)
+                        char16_t syllable=(char16_t)
                             (Hangul::HANGUL_BASE+
                              (prev*Hangul::JAMO_V_COUNT+(c-Hangul::JAMO_V_BASE))*
                              Hangul::JAMO_T_COUNT);
-                        UChar t;
-                        if(p!=limit && (t=(UChar)(*p-Hangul::JAMO_T_BASE))<Hangul::JAMO_T_COUNT) {
+                        char16_t t;
+                        if(p!=limit && (t=(char16_t)(*p-Hangul::JAMO_T_BASE))<Hangul::JAMO_T_COUNT) {
                             ++p;
                             syllable+=t;  // The next character was a Jamo T.
                         }
@@ -1298,7 +1298,7 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
                         starter[0]=U16_LEAD(composite);
                         starter[1]=U16_TRAIL(composite);
                     } else {
-                        *starter=(UChar)composite;
+                        *starter=(char16_t)composite;
                         // The composite is shorter than the starter,
                         // move the intermediate characters forward one.
                         starterIsSupplementary=false;
@@ -1323,7 +1323,7 @@ void Normalizer2Impl::recompose(ReorderingBuffer &buffer, int32_t recomposeStart
                     *--starter=U16_LEAD(composite);  // undo the temporary increment
                 } else {
                     // both are on the BMP
-                    *starter=(UChar)composite;
+                    *starter=(char16_t)composite;
                 }
 
                 /* remove the combining mark by moving the following text over it */
@@ -1435,12 +1435,12 @@ Normalizer2Impl::composePair(UChar32 a, UChar32 b) const {
 // doCompose: normalize
 // !doCompose: isNormalized (buffer must be empty and initialized)
 UBool
-Normalizer2Impl::compose(const UChar *src, const UChar *limit,
+Normalizer2Impl::compose(const char16_t *src, const char16_t *limit,
                          UBool onlyContiguous,
                          UBool doCompose,
                          ReorderingBuffer &buffer,
                          UErrorCode &errorCode) const {
-    const UChar *prevBoundary=src;
+    const char16_t *prevBoundary=src;
     UChar32 minNoMaybeCP=minCompNoMaybeCP;
     if(limit==nullptr) {
         src=copyLowPrefixFromNulTerminated(src, minNoMaybeCP,
@@ -1463,7 +1463,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
     for (;;) {
         // Fast path: Scan over a sequence of characters below the minimum "no or maybe" code point,
         // or with (compYes && ccc==0) properties.
-        const UChar *prevSrc;
+        const char16_t *prevSrc;
         UChar32 c = 0;
         uint16_t norm16 = 0;
         for (;;) {
@@ -1482,7 +1482,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
                 if(!U16_IS_LEAD(c)) {
                     break;
                 } else {
-                    UChar c2;
+                    char16_t c2;
                     if(src!=limit && U16_IS_TRAIL(c2=*src)) {
                         ++src;
                         c=U16_GET_SUPPLEMENTARY(c, c2);
@@ -1528,7 +1528,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
                     if (prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) {
                         break;
                     }
-                    const UChar *mapping = reinterpret_cast<const UChar *>(getMapping(norm16));
+                    const char16_t *mapping = reinterpret_cast<const char16_t *>(getMapping(norm16));
                     int32_t length = *mapping++ & MAPPING_LENGTH_MASK;
                     if(!buffer.appendZeroCC(mapping, mapping + length, errorCode)) {
                         break;
@@ -1552,11 +1552,11 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
             // Other "noNo" type, or need to examine more text around this character:
             // Fall through to the slow path.
         } else if (isJamoVT(norm16) && prevBoundary != prevSrc) {
-            UChar prev=*(prevSrc-1);
+            char16_t prev=*(prevSrc-1);
             if(c<Hangul::JAMO_T_BASE) {
                 // The current character is a Jamo Vowel,
                 // compose with previous Jamo L and following Jamo T.
-                UChar l = (UChar)(prev-Hangul::JAMO_L_BASE);
+                char16_t l = (char16_t)(prev-Hangul::JAMO_L_BASE);
                 if(l<Hangul::JAMO_L_COUNT) {
                     if (!doCompose) {
                         return false;
@@ -1581,7 +1581,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
                         if (prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) {
                             break;
                         }
-                        if(!buffer.appendBMP((UChar)syllable, 0, errorCode)) {
+                        if(!buffer.appendBMP((char16_t)syllable, 0, errorCode)) {
                             break;
                         }
                         prevBoundary = src;
@@ -1606,7 +1606,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
                 if (prevBoundary != prevSrc && !buffer.appendZeroCC(prevBoundary, prevSrc, errorCode)) {
                     break;
                 }
-                if(!buffer.appendBMP((UChar)syllable, 0, errorCode)) {
+                if(!buffer.appendBMP((char16_t)syllable, 0, errorCode)) {
                     break;
                 }
                 prevBoundary = src;
@@ -1627,7 +1627,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
             } else {
                 // If !onlyContiguous (not FCC), then we ignore the tccc of
                 // the previous character which passed the quick check "yes && ccc==0" test.
-                const UChar *nextSrc;
+                const char16_t *nextSrc;
                 uint16_t n16;
                 for (;;) {
                     if (src == limit) {
@@ -1667,7 +1667,7 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
         // Slow path: Find the nearest boundaries around the current character,
         // decompose and recompose.
         if (prevBoundary != prevSrc && !norm16HasCompBoundaryBefore(norm16)) {
-            const UChar *p = prevSrc;
+            const char16_t *p = prevSrc;
             UCPTRIE_FAST_U16_PREV(normTrie, UCPTRIE_16, prevBoundary, p, c, norm16);
             if (!norm16HasCompBoundaryAfter(norm16, onlyContiguous)) {
                 prevSrc = p;
@@ -1705,11 +1705,11 @@ Normalizer2Impl::compose(const UChar *src, const UChar *limit,
 // Very similar to compose(): Make the same changes in both places if relevant.
 // pQCResult==nullptr: spanQuickCheckYes
 // pQCResult!=nullptr: quickCheck (*pQCResult must be UNORM_YES)
-const UChar *
-Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit,
+const char16_t *
+Normalizer2Impl::composeQuickCheck(const char16_t *src, const char16_t *limit,
                                    UBool onlyContiguous,
                                    UNormalizationCheckResult *pQCResult) const {
-    const UChar *prevBoundary=src;
+    const char16_t *prevBoundary=src;
     UChar32 minNoMaybeCP=minCompNoMaybeCP;
     if(limit==nullptr) {
         UErrorCode errorCode=U_ZERO_ERROR;
@@ -1727,7 +1727,7 @@ Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit,
     for(;;) {
         // Fast path: Scan over a sequence of characters below the minimum "no or maybe" code point,
         // or with (compYes && ccc==0) properties.
-        const UChar *prevSrc;
+        const char16_t *prevSrc;
         UChar32 c = 0;
         uint16_t norm16 = 0;
         for (;;) {
@@ -1743,7 +1743,7 @@ Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit,
                 if(!U16_IS_LEAD(c)) {
                     break;
                 } else {
-                    UChar c2;
+                    char16_t c2;
                     if(src!=limit && U16_IS_TRAIL(c2=*src)) {
                         ++src;
                         c=U16_GET_SUPPLEMENTARY(c, c2);
@@ -1766,7 +1766,7 @@ Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit,
             if (norm16HasCompBoundaryBefore(norm16)) {
                 prevBoundary = prevSrc;
             } else {
-                const UChar *p = prevSrc;
+                const char16_t *p = prevSrc;
                 uint16_t n16;
                 UCPTRIE_FAST_U16_PREV(normTrie, UCPTRIE_16, prevBoundary, p, c, n16);
                 if (norm16HasCompBoundaryAfter(n16, onlyContiguous)) {
@@ -1788,7 +1788,7 @@ Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit,
             } else {
                 // If !onlyContiguous (not FCC), then we ignore the tccc of
                 // the previous character which passed the quick check "yes && ccc==0" test.
-                const UChar *nextSrc;
+                const char16_t *nextSrc;
                 for (;;) {
                     if (norm16 < MIN_YES_YES_WITH_CC) {
                         if (pQCResult != nullptr) {
@@ -1828,23 +1828,23 @@ Normalizer2Impl::composeQuickCheck(const UChar *src, const UChar *limit,
     }
 }
 
-void Normalizer2Impl::composeAndAppend(const UChar *src, const UChar *limit,
+void Normalizer2Impl::composeAndAppend(const char16_t *src, const char16_t *limit,
                                        UBool doCompose,
                                        UBool onlyContiguous,
                                        UnicodeString &safeMiddle,
                                        ReorderingBuffer &buffer,
                                        UErrorCode &errorCode) const {
     if(!buffer.isEmpty()) {
-        const UChar *firstStarterInSrc=findNextCompBoundary(src, limit, onlyContiguous);
+        const char16_t *firstStarterInSrc=findNextCompBoundary(src, limit, onlyContiguous);
         if(src!=firstStarterInSrc) {
-            const UChar *lastStarterInDest=findPreviousCompBoundary(buffer.getStart(),
+            const char16_t *lastStarterInDest=findPreviousCompBoundary(buffer.getStart(),
                                                                     buffer.getLimit(), onlyContiguous);
             int32_t destSuffixLength=(int32_t)(buffer.getLimit()-lastStarterInDest);
             UnicodeString middle(lastStarterInDest, destSuffixLength);
             buffer.removeSuffix(destSuffixLength);
             safeMiddle=middle;
             middle.append(src, (int32_t)(firstStarterInSrc-src));
-            const UChar *middleStart=middle.getBuffer();
+            const char16_t *middleStart=middle.getBuffer();
             compose(middleStart, middleStart+middle.length(), onlyContiguous,
                     true, buffer, errorCode);
             if(U_FAILURE(errorCode)) {
@@ -1933,7 +1933,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
                     }
                     const uint16_t *mapping = getMapping(norm16);
                     int32_t length = *mapping++ & MAPPING_LENGTH_MASK;
-                    if (!ByteSinkUtil::appendChange(prevSrc, src, (const UChar *)mapping, length,
+                    if (!ByteSinkUtil::appendChange(prevSrc, src, (const char16_t *)mapping, length,
                                                     *sink, edits, errorCode)) {
                         break;
                     }
@@ -2120,7 +2120,7 @@ Normalizer2Impl::composeUTF8(uint32_t options, UBool onlyContiguous,
     return true;
 }
 
-UBool Normalizer2Impl::hasCompBoundaryBefore(const UChar *src, const UChar *limit) const {
+UBool Normalizer2Impl::hasCompBoundaryBefore(const char16_t *src, const char16_t *limit) const {
     if (src == limit || *src < minCompNoMaybeCP) {
         return true;
     }
@@ -2139,7 +2139,7 @@ UBool Normalizer2Impl::hasCompBoundaryBefore(const uint8_t *src, const uint8_t *
     return norm16HasCompBoundaryBefore(norm16);
 }
 
-UBool Normalizer2Impl::hasCompBoundaryAfter(const UChar *start, const UChar *p,
+UBool Normalizer2Impl::hasCompBoundaryAfter(const char16_t *start, const char16_t *p,
                                             UBool onlyContiguous) const {
     if (start == p) {
         return true;
@@ -2160,10 +2160,10 @@ UBool Normalizer2Impl::hasCompBoundaryAfter(const uint8_t *start, const uint8_t
     return norm16HasCompBoundaryAfter(norm16, onlyContiguous);
 }
 
-const UChar *Normalizer2Impl::findPreviousCompBoundary(const UChar *start, const UChar *p,
+const char16_t *Normalizer2Impl::findPreviousCompBoundary(const char16_t *start, const char16_t *p,
                                                        UBool onlyContiguous) const {
     while (p != start) {
-        const UChar *codePointLimit = p;
+        const char16_t *codePointLimit = p;
         UChar32 c;
         uint16_t norm16;
         UCPTRIE_FAST_U16_PREV(normTrie, UCPTRIE_16, start, p, c, norm16);
@@ -2177,10 +2177,10 @@ const UChar *Normalizer2Impl::findPreviousCompBoundary(const UChar *start, const
     return p;
 }
 
-const UChar *Normalizer2Impl::findNextCompBoundary(const UChar *p, const UChar *limit,
+const char16_t *Normalizer2Impl::findNextCompBoundary(const char16_t *p, const char16_t *limit,
                                                    UBool onlyContiguous) const {
     while (p != limit) {
-        const UChar *codePointStart = p;
+        const char16_t *codePointStart = p;
         UChar32 c;
         uint16_t norm16;
         UCPTRIE_FAST_U16_NEXT(normTrie, UCPTRIE_16, p, limit, c, norm16);
@@ -2194,7 +2194,7 @@ const UChar *Normalizer2Impl::findNextCompBoundary(const UChar *p, const UChar *
     return p;
 }
 
-uint8_t Normalizer2Impl::getPreviousTrailCC(const UChar *start, const UChar *p) const {
+uint8_t Normalizer2Impl::getPreviousTrailCC(const char16_t *start, const char16_t *p) const {
     if (start == p) {
         return 0;
     }
@@ -2269,13 +2269,13 @@ uint16_t Normalizer2Impl::getFCD16FromNormData(UChar32 c) const {
 // Dual functionality:
 // buffer!=nullptr: normalize
 // buffer==nullptr: isNormalized/quickCheck/spanQuickCheckYes
-const UChar *
-Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit,
+const char16_t *
+Normalizer2Impl::makeFCD(const char16_t *src, const char16_t *limit,
                          ReorderingBuffer *buffer,
                          UErrorCode &errorCode) const {
     // Tracks the last FCD-safe boundary, before lccc=0 or after properly-ordered tccc<=1.
     // Similar to the prevBoundary in the compose() implementation.
-    const UChar *prevBoundary=src;
+    const char16_t *prevBoundary=src;
     int32_t prevFCD16=0;
     if(limit==nullptr) {
         src=copyLowPrefixFromNulTerminated(src, minLcccCP, buffer, errorCode);
@@ -2300,7 +2300,7 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit,
     // The exception is the call to decomposeShort() which uses the buffer
     // in the normal way.
 
-    const UChar *prevSrc;
+    const char16_t *prevSrc;
     UChar32 c=0;
     uint16_t fcd16=0;
 
@@ -2315,7 +2315,7 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit,
                 ++src;
             } else {
                 if(U16_IS_LEAD(c)) {
-                    UChar c2;
+                    char16_t c2;
                     if((src+1)!=limit && U16_IS_TRAIL(c2=src[1])) {
                         c=U16_GET_SUPPLEMENTARY(c, c2);
                     }
@@ -2350,7 +2350,7 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit,
                     }
                 }
             } else {
-                const UChar *p=src-1;
+                const char16_t *p=src-1;
                 if(U16_IS_TRAIL(*p) && prevSrc<p && U16_IS_LEAD(*(p-1))) {
                     --p;
                     // Need to fetch the previous character's FCD value because
@@ -2410,22 +2410,22 @@ Normalizer2Impl::makeFCD(const UChar *src, const UChar *limit,
     return src;
 }
 
-void Normalizer2Impl::makeFCDAndAppend(const UChar *src, const UChar *limit,
+void Normalizer2Impl::makeFCDAndAppend(const char16_t *src, const char16_t *limit,
                                        UBool doMakeFCD,
                                        UnicodeString &safeMiddle,
                                        ReorderingBuffer &buffer,
                                        UErrorCode &errorCode) const {
     if(!buffer.isEmpty()) {
-        const UChar *firstBoundaryInSrc=findNextFCDBoundary(src, limit);
+        const char16_t *firstBoundaryInSrc=findNextFCDBoundary(src, limit);
         if(src!=firstBoundaryInSrc) {
-            const UChar *lastBoundaryInDest=findPreviousFCDBoundary(buffer.getStart(),
+            const char16_t *lastBoundaryInDest=findPreviousFCDBoundary(buffer.getStart(),
                                                                     buffer.getLimit());
             int32_t destSuffixLength=(int32_t)(buffer.getLimit()-lastBoundaryInDest);
             UnicodeString middle(lastBoundaryInDest, destSuffixLength);
             buffer.removeSuffix(destSuffixLength);
             safeMiddle=middle;
             middle.append(src, (int32_t)(firstBoundaryInSrc-src));
-            const UChar *middleStart=middle.getBuffer();
+            const char16_t *middleStart=middle.getBuffer();
             makeFCD(middleStart, middleStart+middle.length(), &buffer, errorCode);
             if(U_FAILURE(errorCode)) {
                 return;
@@ -2443,9 +2443,9 @@ void Normalizer2Impl::makeFCDAndAppend(const UChar *src, const UChar *limit,
     }
 }
 
-const UChar *Normalizer2Impl::findPreviousFCDBoundary(const UChar *start, const UChar *p) const {
+const char16_t *Normalizer2Impl::findPreviousFCDBoundary(const char16_t *start, const char16_t *p) const {
     while(start<p) {
-        const UChar *codePointLimit = p;
+        const char16_t *codePointLimit = p;
         UChar32 c;
         uint16_t norm16;
         UCPTRIE_FAST_U16_PREV(normTrie, UCPTRIE_16, start, p, c, norm16);
@@ -2459,9 +2459,9 @@ const UChar *Normalizer2Impl::findPreviousFCDBoundary(const UChar *start, const
     return p;
 }
 
-const UChar *Normalizer2Impl::findNextFCDBoundary(const UChar *p, const UChar *limit) const {
+const char16_t *Normalizer2Impl::findNextFCDBoundary(const char16_t *p, const char16_t *limit) const {
     while(p<limit) {
-        const UChar *codePointStart=p;
+        const char16_t *codePointStart=p;
         UChar32 c;
         uint16_t norm16;
         UCPTRIE_FAST_U16_NEXT(normTrie, UCPTRIE_16, p, limit, c, norm16);
index da3243d301064d902f569cc95a16024c9b1c1a88..9922683cda57a67df2ba015d36b452a2bc4ca7b0 100644 (file)
@@ -164,8 +164,8 @@ PatternProps::isWhiteSpace(UChar32 c) {
     }
 }
 
-const UChar *
-PatternProps::skipWhiteSpace(const UChar *s, int32_t length) {
+const char16_t *
+PatternProps::skipWhiteSpace(const char16_t *s, int32_t length) {
     while(length>0 && isWhiteSpace(*s)) {
         ++s;
         --length;
@@ -183,8 +183,8 @@ PatternProps::skipWhiteSpace(const UnicodeString& s, int32_t start) {
     return i;
 }
 
-const UChar *
-PatternProps::trimWhiteSpace(const UChar *s, int32_t &length) {
+const char16_t *
+PatternProps::trimWhiteSpace(const char16_t *s, int32_t &length) {
     if(length<=0 || (!isWhiteSpace(s[0]) && !isWhiteSpace(s[length-1]))) {
         return s;
     }
@@ -205,11 +205,11 @@ PatternProps::trimWhiteSpace(const UChar *s, int32_t &length) {
 }
 
 UBool
-PatternProps::isIdentifier(const UChar *s, int32_t length) {
+PatternProps::isIdentifier(const char16_t *s, int32_t length) {
     if(length<=0) {
         return false;
     }
-    const UChar *limit=s+length;
+    const char16_t *limit=s+length;
     do {
         if(isSyntaxOrWhiteSpace(*s++)) {
             return false;
@@ -218,8 +218,8 @@ PatternProps::isIdentifier(const UChar *s, int32_t length) {
     return true;
 }
 
-const UChar *
-PatternProps::skipIdentifier(const UChar *s, int32_t length) {
+const char16_t *
+PatternProps::skipIdentifier(const char16_t *s, int32_t length) {
     while(length>0 && !isSyntaxOrWhiteSpace(*s)) {
         ++s;
         --length;
index 4ead56e1cdb3648dc08cb7120b7a7c561838faa7..23a88333f4ee6c5b8b02f70e0acb3a37e688a4c5 100644 (file)
@@ -62,7 +62,7 @@ public:
      * Skips over Pattern_White_Space starting at s.
      * @return The smallest pointer at or after s with a non-white space character.
      */
-    static const UChar *skipWhiteSpace(const UChar *s, int32_t length);
+    static const char16_t *skipWhiteSpace(const char16_t *s, int32_t length);
 
     /**
      * Skips over Pattern_White_Space starting at index start in s.
@@ -73,21 +73,21 @@ public:
     /**
      * @return s except with leading and trailing Pattern_White_Space removed and length adjusted.
      */
-    static const UChar *trimWhiteSpace(const UChar *s, int32_t &length);
+    static const char16_t *trimWhiteSpace(const char16_t *s, int32_t &length);
 
     /**
      * Tests whether the string contains a "pattern identifier", that is,
      * whether it contains only non-Pattern_White_Space, non-Pattern_Syntax characters.
      * @return true if there are no Pattern_White_Space or Pattern_Syntax characters in s.
      */
-    static UBool isIdentifier(const UChar *s, int32_t length);
+    static UBool isIdentifier(const char16_t *s, int32_t length);
 
     /**
      * Skips over a "pattern identifier" starting at index s.
      * @return The smallest pointer at or after s with
      *         a Pattern_White_Space or Pattern_Syntax character.
      */
-    static const UChar *skipIdentifier(const UChar *s, int32_t length);
+    static const char16_t *skipIdentifier(const char16_t *s, int32_t length);
 
 private:
     PatternProps() = delete;  // no constructor: all static methods
index 7e2a870200d69b44c88761a4554be75b877b21bf..7ebdebc1888a6e6b5f80468eb4c32a0ac6927741 100644 (file)
@@ -179,14 +179,14 @@ constexpr int32_t DECODE_MAX_CHARS=2000;
 
 // encode
 U_CAPI int32_t
-u_strToPunycode(const UChar *src, int32_t srcLength,
-                UChar *dest, int32_t destCapacity,
+u_strToPunycode(const char16_t *src, int32_t srcLength,
+                char16_t *dest, int32_t destCapacity,
                 const UBool *caseFlags,
                 UErrorCode *pErrorCode) {
 
     int32_t cpBuffer[ENCODE_MAX_CODE_UNITS];
     int32_t n, delta, handledCPCount, basicLength, destLength, bias, j, m, q, k, t, srcCPCount;
-    UChar c, c2;
+    char16_t c, c2;
 
     /* argument checking */
     if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) {
@@ -371,13 +371,13 @@ u_strToPunycode(const UChar *src, int32_t srcLength,
 
 // decode
 U_CAPI int32_t
-u_strFromPunycode(const UChar *src, int32_t srcLength,
-                  UChar *dest, int32_t destCapacity,
+u_strFromPunycode(const char16_t *src, int32_t srcLength,
+                  char16_t *dest, int32_t destCapacity,
                   UBool *caseFlags,
                   UErrorCode *pErrorCode) {
     int32_t n, destLength, i, bias, basicLength, j, in, oldi, w, k, digit, t,
             destCPCount, firstSupplementaryIndex, cpLength;
-    UChar b;
+    char16_t b;
 
     /* argument checking */
     if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) {
@@ -421,7 +421,7 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
         }
 
         if(j<destCapacity) {
-            dest[j]=(UChar)b;
+            dest[j]=(char16_t)b;
 
             if(caseFlags!=nullptr) {
                 caseFlags[j]=IS_BASIC_UPPERCASE(b);
@@ -550,7 +550,7 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
                 U16_FWD_N(dest, codeUnitIndex, destLength, i-codeUnitIndex);
             }
 
-            /* use the UChar index codeUnitIndex instead of the code point index i */
+            /* use the char16_t index codeUnitIndex instead of the code point index i */
             if(codeUnitIndex<destLength) {
                 uprv_memmove(dest+codeUnitIndex+cpLength,
                              dest+codeUnitIndex,
@@ -563,7 +563,7 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
             }
             if(cpLength==1) {
                 /* BMP, insert one code unit */
-                dest[codeUnitIndex]=(UChar)n;
+                dest[codeUnitIndex]=(char16_t)n;
             } else {
                 /* supplementary character, insert two code units */
                 dest[codeUnitIndex]=U16_LEAD(n);
index 3dbecce9534c273aad2c3b37a8378f5e2629fdc9..747d37efa3d493418ed37d9c3b8290b6d426351f 100644 (file)
@@ -1389,7 +1389,7 @@ static BOOL U_CALLCONV getIcuDataDirectoryUnderWindowsDirectory(char* directoryB
         UErrorCode status = U_ZERO_ERROR;
         int32_t windowsPathUtf8Len = 0;
         u_strToUTF8(windowsPathUtf8, static_cast<int32_t>(UPRV_LENGTHOF(windowsPathUtf8)),
-            &windowsPathUtf8Len, reinterpret_cast<const UChar*>(windowsPath), -1, &status);
+            &windowsPathUtf8Len, reinterpret_cast<const char16_t*>(windowsPath), -1, &status);
 
         if (U_SUCCESS(status) && (status != U_STRING_NOT_TERMINATED_WARNING) &&
             (windowsPathUtf8Len < (UPRV_LENGTHOF(windowsPathUtf8) - 1))) {
@@ -2269,7 +2269,7 @@ u_versionFromString(UVersionInfo versionArray, const char *versionString) {
 }
 
 U_CAPI void U_EXPORT2
-u_versionFromUString(UVersionInfo versionArray, const UChar *versionString) {
+u_versionFromUString(UVersionInfo versionArray, const char16_t *versionString) {
     if(versionArray!=nullptr && versionString!=nullptr) {
         char versionChars[U_MAX_VERSION_STRING_LENGTH+1];
         int32_t len = u_strlen(versionString);
index 1bc76d5e5dc95faac11c826b2706e0a705cb6ba3..04372d1e38941a2e9989b6526177f7ddb65f3ac2 100644 (file)
@@ -85,7 +85,7 @@ struct RBBIDataHeader {
     uint32_t         fTrie;           /*  Offset to Trie data for character categories */
     uint32_t         fTrieLen;
     uint32_t         fRuleSource;     /*  Offset to the source for for the break */
-    uint32_t         fRuleSourceLen;  /*    rules.  Stored UChar *. */
+    uint32_t         fRuleSourceLen;  /*    rules.  Stored char16_t *. */
     uint32_t         fStatusTable;    /* Offset to the table of rule status values */
     uint32_t         fStatusTableLen;
 
index 87d31f8af403d4ac31a0360c653dd0e1675fa507..455ace78b802c01327f90dbb8fd7fd993837708d 100644 (file)
@@ -46,7 +46,7 @@
 //              source form of the state transition table for the RBBI rule parser.
 //
 //------------------------------------------------------------------------------
-static const UChar gRuleSet_rule_char_pattern[]       = {
+static const char16_t gRuleSet_rule_char_pattern[]       = {
  // Characters that may appear as literals in patterns without escaping or quoting.
  //   [    ^      [    \     p     {      Z     }     \     u    0      0    2      0
     0x5b, 0x5e, 0x5b, 0x5c, 0x70, 0x7b, 0x5a, 0x7d, 0x5c, 0x75, 0x30, 0x30, 0x32, 0x30,
@@ -55,19 +55,19 @@ static const UChar gRuleSet_rule_char_pattern[]       = {
  //   {     L     }    ]     -     [      \     p     {     N    }      ]     ]
     0x7b, 0x4c, 0x7d, 0x5d, 0x2d, 0x5b, 0x5c, 0x70, 0x7b, 0x4e, 0x7d, 0x5d, 0x5d, 0};
 
-static const UChar gRuleSet_name_char_pattern[]       = {
+static const char16_t gRuleSet_name_char_pattern[]       = {
 //    [    _      \    p     {     L      }     \     p     {    N      }     ]
     0x5b, 0x5f, 0x5c, 0x70, 0x7b, 0x4c, 0x7d, 0x5c, 0x70, 0x7b, 0x4e, 0x7d, 0x5d, 0};
 
-static const UChar gRuleSet_digit_char_pattern[] = {
+static const char16_t gRuleSet_digit_char_pattern[] = {
 //    [    0      -    9     ]
     0x5b, 0x30, 0x2d, 0x39, 0x5d, 0};
 
-static const UChar gRuleSet_name_start_char_pattern[] = {
+static const char16_t gRuleSet_name_start_char_pattern[] = {
 //    [    _      \    p     {     L      }     ]
     0x5b, 0x5f, 0x5c, 0x70, 0x7b, 0x4c, 0x7d, 0x5d, 0 };
 
-static const UChar kAny[] = {0x61, 0x6e, 0x79, 0x00};  // "any"
+static const char16_t kAny[] = {0x61, 0x6e, 0x79, 0x00};  // "any"
 
 
 U_CDECL_BEGIN
@@ -809,15 +809,15 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
 //     Numeric because there is no portable way to enter them as literals.
 //     (Think EBCDIC).
 //
-static const UChar      chCR        = 0x0d;      // New lines, for terminating comments.
-static const UChar      chLF        = 0x0a;
-static const UChar      chNEL       = 0x85;      //    NEL newline variant
-static const UChar      chLS        = 0x2028;    //    Unicode Line Separator
-static const UChar      chApos      = 0x27;      //  single quote, for quoted chars.
-static const UChar      chPound     = 0x23;      // '#', introduces a comment.
-static const UChar      chBackSlash = 0x5c;      // '\'  introduces a char escape
-static const UChar      chLParen    = 0x28;
-static const UChar      chRParen    = 0x29;
+static const char16_t   chCR        = 0x0d;      // New lines, for terminating comments.
+static const char16_t   chLF        = 0x0a;
+static const char16_t   chNEL       = 0x85;      //    NEL newline variant
+static const char16_t   chLS        = 0x2028;    //    Unicode Line Separator
+static const char16_t   chApos      = 0x27;      //  single quote, for quoted chars.
+static const char16_t   chPound     = 0x23;      // '#', introduces a comment.
+static const char16_t   chBackSlash = 0x5c;      // '\'  introduces a char escape
+static const char16_t   chLParen    = 0x28;
+static const char16_t   chRParen    = 0x29;
 
 
 //------------------------------------------------------------------------------
index 52eb51001d529fe2aa4a641db62bcea97494d316..844351bd0dfbccca390f86c98371d02137dd61f4 100644 (file)
@@ -41,7 +41,7 @@ U_CDECL_END
 U_NAMESPACE_BEGIN
 
 RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules, UErrorCode &status)
-    :fRules(rules), fRuleScanner(rs), ffffString(UChar(0xffff))
+    :fRules(rules), fRuleScanner(rs), ffffString(char16_t(0xffff))
 {
     fHashTable       = nullptr;
     fCachedSetLookup = nullptr;
@@ -144,7 +144,7 @@ UnicodeString   RBBISymbolTable::parseReference(const UnicodeString& text,
     int32_t i = start;
     UnicodeString result;
     while (i < limit) {
-        UChar c = text.charAt(i);
+        char16_t c = text.charAt(i);
         if ((i==start && !u_isIDStart(c)) || !u_isIDPart(c)) {
             break;
         }
index 0bec7bd916d9550bebb6be351d46c8145a767c94..8dee18ba0607f32f385ff004972196bffd790bdc 100644 (file)
@@ -253,7 +253,7 @@ ResourceBundle::clone() const {
 
 UnicodeString ResourceBundle::getString(UErrorCode& status) const {
     int32_t len = 0;
-    const UChar *r = ures_getString(fResource, &len, &status);
+    const char16_t *r = ures_getString(fResource, &len, &status);
     return UnicodeString(true, r, len);
 }
 
@@ -311,13 +311,13 @@ ResourceBundle ResourceBundle::getNext(UErrorCode& status) {
 
 UnicodeString ResourceBundle::getNextString(UErrorCode& status) {
     int32_t len = 0;
-    const UChar* r = ures_getNextString(fResource, &len, 0, &status);
+    const char16_t* r = ures_getNextString(fResource, &len, 0, &status);
     return UnicodeString(true, r, len);
 }
 
 UnicodeString ResourceBundle::getNextString(const char ** key, UErrorCode& status) {
     int32_t len = 0;
-    const UChar* r = ures_getNextString(fResource, &len, key, &status);
+    const char16_t* r = ures_getNextString(fResource, &len, key, &status);
     return UnicodeString(true, r, len);
 }
 
@@ -335,7 +335,7 @@ ResourceBundle ResourceBundle::get(int32_t indexR, UErrorCode& status) const {
 
 UnicodeString ResourceBundle::getStringEx(int32_t indexS, UErrorCode& status) const {
     int32_t len = 0;
-    const UChar* r = ures_getStringByIndex(fResource, indexS, &len, &status);
+    const char16_t* r = ures_getStringByIndex(fResource, indexS, &len, &status);
     return UnicodeString(true, r, len);
 }
 
@@ -363,7 +363,7 @@ ResourceBundle ResourceBundle::getWithFallback(const char* key, UErrorCode& stat
 }
 UnicodeString ResourceBundle::getStringEx(const char* key, UErrorCode& status) const {
     int32_t len = 0;
-    const UChar* r = ures_getStringByKey(fResource, key, &len, &status);
+    const char16_t* r = ures_getStringByKey(fResource, key, &len, &status);
     return UnicodeString(true, r, len);
 }
 
index 9c752e194a66355ad87e54732032a42abe483b63..7f83f06f0e0c0c84087fa0979ea140ad1698f370 100644 (file)
@@ -49,7 +49,7 @@ ResourceBundle::constructForLocale(const UnicodeString& path,
     }
     else {
         UnicodeString nullTerminatedPath(path);
-        nullTerminatedPath.append((UChar)0);
+        nullTerminatedPath.append((char16_t)0);
         fResource = ures_openU(nullTerminatedPath.getBuffer(), locale.getName(), &error);
     }
 }
index 3ac7c3dc61a2d12912ab70617f6992c0200167b0..79ed897bd12900466721b5df37376c69fba4d0c3 100644 (file)
@@ -136,22 +136,22 @@ public:
      *
      * @see ures_getString()
      */
-    virtual const UChar *getString(int32_t &length, UErrorCode &errorCode) const = 0;
+    virtual const char16_t *getString(int32_t &length, UErrorCode &errorCode) const = 0;
 
     inline UnicodeString getUnicodeString(UErrorCode &errorCode) const {
         int32_t len = 0;
-        const UChar *r = getString(len, errorCode);
+        const char16_t *r = getString(len, errorCode);
         return UnicodeString(true, r, len);
     }
 
     /**
      * Sets U_RESOURCE_TYPE_MISMATCH if this is not an alias resource.
      */
-    virtual const UChar *getAliasString(int32_t &length, UErrorCode &errorCode) const = 0;
+    virtual const char16_t *getAliasString(int32_t &length, UErrorCode &errorCode) const = 0;
 
     inline UnicodeString getAliasUnicodeString(UErrorCode &errorCode) const {
         int32_t len = 0;
-        const UChar *r = getAliasString(len, errorCode);
+        const char16_t *r = getAliasString(len, errorCode);
         return UnicodeString(true, r, len);
     }
 
index 33ffd3d8337205574b03b4ad0b84a0ba9184089f..690635a908978024b2b6e35433429f1c60f630ec 100644 (file)
@@ -130,7 +130,7 @@ void RuleCharacterIterator::jumpahead(int32_t count) {
 UnicodeString& RuleCharacterIterator::toString(UnicodeString& result) const {
     int32_t b = pos.getIndex();
     text.extract(0, b, result);
-    return result.append((UChar) 0x7C).append(text, b, 0x7FFFFFFF); // Insert '|' at index
+    return result.append((char16_t) 0x7C).append(text, b, 0x7FFFFFFF); // Insert '|' at index
 }
 */
 
index 22262e06f6a1c1657d9e2f0cc01c3a2917e9c3e7..b4df576187f11836e1b1499bf6eff6ba9608ee2c 100644 (file)
@@ -25,7 +25,7 @@ U_NAMESPACE_BEGIN
 ******************************************************************
 */
 
-const UChar ICUServiceKey::PREFIX_DELIMITER = 0x002F;   /* '/' */
+const char16_t ICUServiceKey::PREFIX_DELIMITER = 0x002F;   /* '/' */
 
 ICUServiceKey::ICUServiceKey(const UnicodeString& id) 
 : _id(id) {
@@ -558,7 +558,7 @@ outerEnd:
 
             if (actualReturn != nullptr) {
                 // strip null prefix
-                if (result->actualDescriptor.indexOf((UChar)0x2f) == 0) { // U+002f=slash (/)
+                if (result->actualDescriptor.indexOf((char16_t)0x2f) == 0) { // U+002f=slash (/)
                     actualReturn->remove();
                     actualReturn->append(result->actualDescriptor, 
                         1, 
index 65f05053922fe296dc7ea63a6dcb180abf5134b3..c9d664d65e875f447d7f182e3b2745605bc9be52 100644 (file)
@@ -74,7 +74,7 @@ class U_COMMON_API ICUServiceKey : public UObject {
   const UnicodeString _id;
 
  protected:
-  static const UChar PREFIX_DELIMITER;
+  static const char16_t PREFIX_DELIMITER;
 
  public:
 
index c9c8c3dcccb1d2a3ca5823696e8918d9d6742999..ba275ea30117f053439edf4056c8d8289b80983a 100644 (file)
@@ -21,9 +21,9 @@
 #include "charstr.h"
 #include "uassert.h"
 
-#define UNDERSCORE_CHAR ((UChar)0x005f)
-#define AT_SIGN_CHAR    ((UChar)64)
-#define PERIOD_CHAR     ((UChar)46)
+#define UNDERSCORE_CHAR ((char16_t)0x005f)
+#define AT_SIGN_CHAR    ((char16_t)64)
+#define PERIOD_CHAR     ((char16_t)46)
 
 U_NAMESPACE_BEGIN
 
@@ -74,7 +74,7 @@ LocaleKey::~LocaleKey() {}
 UnicodeString&
 LocaleKey::prefix(UnicodeString& result) const {
     if (_kind != KIND_ANY) {
-        UChar buffer[64];
+        char16_t buffer[64];
         uprv_itou(buffer, 64, _kind, 10, 0);
         UnicodeString temp(buffer);
         result.append(temp);
index c4baed2df7cf6c5ba0526cd3751b1ae258d25841..935f6b71b3e7a41bd0e527e76008be1c6b2e14ad 100644 (file)
@@ -22,9 +22,9 @@
 #include "ucln_cmn.h"
 #include "uassert.h"
 
-#define UNDERSCORE_CHAR ((UChar)0x005f)
-#define AT_SIGN_CHAR    ((UChar)64)
-#define PERIOD_CHAR     ((UChar)46)
+#define UNDERSCORE_CHAR ((char16_t)0x005f)
+#define AT_SIGN_CHAR    ((char16_t)64)
+#define PERIOD_CHAR     ((char16_t)46)
 
 
 U_NAMESPACE_BEGIN
index 7b1db42034cb0a5ee1277fccb594648c6cf37e30..18c0205918cf8d61f010c13f3b356c73b21d4ea5 100644 (file)
@@ -20,9 +20,9 @@
 #include "charstr.h"
 #include "uassert.h"
 
-#define UNDERSCORE_CHAR ((UChar)0x005f)
-#define AT_SIGN_CHAR    ((UChar)64)
-#define PERIOD_CHAR     ((UChar)46)
+#define UNDERSCORE_CHAR ((char16_t)0x005f)
+#define AT_SIGN_CHAR    ((char16_t)64)
+#define PERIOD_CHAR     ((char16_t)46)
 
 U_NAMESPACE_BEGIN
 
index 68583ef1fbb9a6b8b0f220392ef1adba69f38978..a4feca2c3b00b92171a7ddef434c68ffd8557f29 100644 (file)
@@ -22,9 +22,9 @@
 #include "ucln_cmn.h"
 #include "uassert.h"
 
-#define UNDERSCORE_CHAR ((UChar)0x005f)
-#define AT_SIGN_CHAR    ((UChar)64)
-#define PERIOD_CHAR     ((UChar)46)
+#define UNDERSCORE_CHAR ((char16_t)0x005f)
+#define AT_SIGN_CHAR    ((char16_t)64)
+#define PERIOD_CHAR     ((char16_t)46)
 
 U_NAMESPACE_BEGIN
 
index 9966dac0ce95d813ea48a1c5f3e6de0390d0ba9b..7aa2ee71b890d4fd01fbc068788919e86e514cbf 100644 (file)
@@ -21,9 +21,9 @@
 #include "charstr.h"
 #include "uassert.h"
 
-#define UNDERSCORE_CHAR ((UChar)0x005f)
-#define AT_SIGN_CHAR    ((UChar)64)
-#define PERIOD_CHAR     ((UChar)46)
+#define UNDERSCORE_CHAR ((char16_t)0x005f)
+#define AT_SIGN_CHAR    ((char16_t)64)
+#define PERIOD_CHAR     ((char16_t)46)
 
 U_NAMESPACE_BEGIN
 
index b2ed2eb67d1f0a17d88f39ca9c534e31197427a7..16256270727e8d59b7ff8bf996a33b7ae41d6381 100644 (file)
@@ -25,11 +25,11 @@ namespace {
  */
 const int32_t ARG_NUM_LIMIT = 0x100;
 /**
- * Initial and maximum char/UChar value set for a text segment.
+ * Initial and maximum char/char16_t value set for a text segment.
  * Segment length char values are from ARG_NUM_LIMIT+1 to this value here.
  * Normally 0xffff, but can be as small as ARG_NUM_LIMIT+1 for testing.
  */
-const UChar SEGMENT_LENGTH_PLACEHOLDER_CHAR = 0xffff;
+const char16_t SEGMENT_LENGTH_PLACEHOLDER_CHAR = 0xffff;
 /**
  * Maximum length of a text segment. Longer segments are split into shorter ones.
  */
@@ -70,15 +70,15 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
     // Parse consistent with MessagePattern, but
     // - support only simple numbered arguments
     // - build a simple binary structure into the result string
-    const UChar *patternBuffer = pattern.getBuffer();
+    const char16_t *patternBuffer = pattern.getBuffer();
     int32_t patternLength = pattern.length();
     // Reserve the first char for the number of arguments.
-    compiledPattern.setTo((UChar)0);
+    compiledPattern.setTo((char16_t)0);
     int32_t textLength = 0;
     int32_t maxArg = -1;
     UBool inQuote = false;
     for (int32_t i = 0; i < patternLength;) {
-        UChar c = patternBuffer[i++];
+        char16_t c = patternBuffer[i++];
         if (c == APOS) {
             if (i < patternLength && (c = patternBuffer[i]) == APOS) {
                 // double apostrophe, skip the second one
@@ -98,7 +98,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
         } else if (!inQuote && c == OPEN_BRACE) {
             if (textLength > 0) {
                 compiledPattern.setCharAt(compiledPattern.length() - textLength - 1,
-                                          (UChar)(ARG_NUM_LIMIT + textLength));
+                                          (char16_t)(ARG_NUM_LIMIT + textLength));
                 textLength = 0;
             }
             int32_t argNumber;
@@ -129,7 +129,7 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
             if (argNumber > maxArg) {
                 maxArg = argNumber;
             }
-            compiledPattern.append((UChar)argNumber);
+            compiledPattern.append((char16_t)argNumber);
             continue;
         }  // else: c is part of literal text
         // Append c and track the literal-text segment length.
@@ -144,14 +144,14 @@ UBool SimpleFormatter::applyPatternMinMaxArguments(
     }
     if (textLength > 0) {
         compiledPattern.setCharAt(compiledPattern.length() - textLength - 1,
-                                  (UChar)(ARG_NUM_LIMIT + textLength));
+                                  (char16_t)(ARG_NUM_LIMIT + textLength));
     }
     int32_t argCount = maxArg + 1;
     if (argCount < min || max < argCount) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return false;
     }
-    compiledPattern.setCharAt(0, (UChar)argCount);
+    compiledPattern.setCharAt(0, (char16_t)argCount);
     return true;
 }
 
@@ -207,7 +207,7 @@ UnicodeString &SimpleFormatter::formatAndReplace(
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return result;
     }
-    const UChar *cp = compiledPattern.getBuffer();
+    const char16_t *cp = compiledPattern.getBuffer();
     int32_t cpLength = compiledPattern.length();
     if (valuesLength < getArgumentLimit(cp, cpLength)) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
@@ -246,7 +246,7 @@ UnicodeString &SimpleFormatter::formatAndReplace(
 }
 
 UnicodeString SimpleFormatter::getTextWithNoArguments(
-        const UChar *compiledPattern,
+        const char16_t *compiledPattern,
         int32_t compiledPatternLength,
         int32_t* offsets,
         int32_t offsetsLength) {
@@ -272,7 +272,7 @@ UnicodeString SimpleFormatter::getTextWithNoArguments(
 }
 
 UnicodeString &SimpleFormatter::format(
-        const UChar *compiledPattern, int32_t compiledPatternLength,
+        const char16_t *compiledPattern, int32_t compiledPatternLength,
         const UnicodeString *const *values,
         UnicodeString &result, const UnicodeString *resultCopy, UBool forbidResultAsValue,
         int32_t *offsets, int32_t offsetsLength,
index bdd8b17695057e963da409b46ffca39c9b0da152..c577ff017b5fcb18817eb0e1246d099355bf669b 100644 (file)
@@ -133,7 +133,7 @@ StringTrieBuilder::writeNode(int32_t start, int32_t limit, int32_t unitIndex) {
 // length different units at unitIndex
 int32_t
 StringTrieBuilder::writeBranchSubNode(int32_t start, int32_t limit, int32_t unitIndex, int32_t length) {
-    UChar middleUnits[kMaxSplitBranchLevels];
+    char16_t middleUnits[kMaxSplitBranchLevels];
     int32_t lessThan[kMaxSplitBranchLevels];
     int32_t ltLength=0;
     while(length>getMaxBranchLinearSubNodeLength()) {
@@ -154,7 +154,7 @@ StringTrieBuilder::writeBranchSubNode(int32_t start, int32_t limit, int32_t unit
     int32_t unitNumber=0;
     do {
         int32_t i=starts[unitNumber]=start;
-        UChar unit=getElementUnit(i++, unitIndex);
+        char16_t unit=getElementUnit(i++, unitIndex);
         i=indexOfElementWithNextUnit(i, unitIndex, unit);
         isFinal[unitNumber]= start==i-1 && unitIndex+1==getElementStringLength(start);
         start=i;
@@ -262,7 +262,7 @@ StringTrieBuilder::makeBranchSubNode(int32_t start, int32_t limit, int32_t unitI
     if(U_FAILURE(errorCode)) {
         return nullptr;
     }
-    UChar middleUnits[kMaxSplitBranchLevels];
+    char16_t middleUnits[kMaxSplitBranchLevels];
     Node *lessThan[kMaxSplitBranchLevels];
     int32_t ltLength=0;
     while(length>getMaxBranchLinearSubNodeLength()) {
@@ -289,7 +289,7 @@ StringTrieBuilder::makeBranchSubNode(int32_t start, int32_t limit, int32_t unitI
     int32_t unitNumber=0;
     do {
         int32_t i=start;
-        UChar unit=getElementUnit(i++, unitIndex);
+        char16_t unit=getElementUnit(i++, unitIndex);
         i=indexOfElementWithNextUnit(i, unitIndex, unit);
         if(start==i-1 && unitIndex+1==getElementStringLength(start)) {
             listNode->add(unit, getElementValue(start));
@@ -299,7 +299,7 @@ StringTrieBuilder::makeBranchSubNode(int32_t start, int32_t limit, int32_t unitI
         start=i;
     } while(++unitNumber<length-1);
     // unitNumber==length-1, and the maxUnit elements range is [start..limit[
-    UChar unit=getElementUnit(start, unitIndex);
+    char16_t unit=getElementUnit(start, unitIndex);
     if(start==limit-1 && unitIndex+1==getElementStringLength(start)) {
         listNode->add(unit, getElementValue(start));
     } else {
index c1de0201b76b015f8e5a69e0a344a5e9e212fd85..daee1004dc26ca9c9738d738311ba9f63e795aa1 100644 (file)
  * rules of the BiDi algorithm, in this example to the second rule of the
  * resolution of weak types.
  *
- * For handling surrogate pairs, where two UChar's form one "abstract" (or UTF-32)
- * character according to UTF-16, the second UChar gets the directional property of
+ * For handling surrogate pairs, where two char16_t's form one "abstract" (or UTF-32)
+ * character according to UTF-16, the second char16_t gets the directional property of
  * the entire character assigned, while the first one gets a BN, a boundary
  * neutral, type, which is ignored by most of the algorithm according to
  * rule (X9) and the implementation suggestions of the BiDi algorithm.
  *
  * Later, adjustWSLevels() will set the level for each BN to that of the
- * following character (UChar), which results in surrogate pairs getting the
+ * following character (char16_t), which results in surrogate pairs getting the
  * same level on each of their surrogates.
  *
  * In a UTF-8 implementation, the same thing could be done: the last byte of
@@ -337,7 +337,7 @@ ubidi_getReorderingOptions(UBiDi *pBiDi) {
 }
 
 U_CAPI UBiDiDirection U_EXPORT2
-ubidi_getBaseDirection(const UChar *text,
+ubidi_getBaseDirection(const char16_t *text,
 int32_t length){
 
     int32_t i;
@@ -373,7 +373,7 @@ int32_t length){
  */
 static DirProp
 firstL_R_AL(UBiDi *pBiDi) {
-    const UChar *text=pBiDi->prologue;
+    const char16_t *text=pBiDi->prologue;
     int32_t length=pBiDi->proLength;
     int32_t i;
     UChar32 uchar;
@@ -426,7 +426,7 @@ checkParaCount(UBiDi *pBiDi) {
  */
 static UBool
 getDirProps(UBiDi *pBiDi) {
-    const UChar *text=pBiDi->text;
+    const char16_t *text=pBiDi->text;
     DirProp *dirProps=pBiDi->dirPropsMemory;    /* pBiDi->dirProps is const */
 
     int32_t i=0, originalLength=pBiDi->originalLength;
@@ -744,7 +744,7 @@ bracketProcessPDI(BracketData *bd) {
 
 /* newly found opening bracket: create an openings entry */
 static UBool                            /* return true if success */
-bracketAddOpening(BracketData *bd, UChar match, int32_t position) {
+bracketAddOpening(BracketData *bd, char16_t match, int32_t position) {
     IsoRun *pLastIsoRun=&bd->isoRuns[bd->isoRunLast];
     Opening *pOpening;
     if(pLastIsoRun->limit>=bd->openingsCount) {  /* no available new entry */
@@ -881,7 +881,7 @@ bracketProcessChar(BracketData *bd, int32_t position) {
     dirProps=bd->pBiDi->dirProps;
     dirProp=dirProps[position];
     if(dirProp==ON) {
-        UChar c, match;
+        char16_t c, match;
         int32_t idx;
         /* First see if it is a matching closing bracket. Hopefully, this is
            more efficient than checking if it is a closing bracket at all */
@@ -918,7 +918,7 @@ bracketProcessChar(BracketData *bd, int32_t position) {
            bracket or it is a case of N0d */
         /* Now see if it is an opening bracket */
         if(c)
-            match= static_cast<UChar>(u_getBidiPairedBracket(c));    /* get the matching char */
+            match= static_cast<char16_t>(u_getBidiPairedBracket(c));    /* get the matching char */
         else
             match=0;
         if(match!=c &&                  /* has a matching char */
@@ -1072,7 +1072,7 @@ static UBiDiDirection
 resolveExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) {
     DirProp *dirProps=pBiDi->dirProps;
     UBiDiLevel *levels=pBiDi->levels;
-    const UChar *text=pBiDi->text;
+    const char16_t *text=pBiDi->text;
 
     int32_t i=0, length=pBiDi->length;
     Flags flags=pBiDi->flags;       /* collect all directionalities in the text */
@@ -2068,7 +2068,7 @@ processPropertySeq(UBiDi *pBiDi, LevState *pLevState, uint8_t _prop,
  */
 static DirProp
 lastL_R_AL(UBiDi *pBiDi) {
-    const UChar *text=pBiDi->prologue;
+    const char16_t *text=pBiDi->prologue;
     int32_t length=pBiDi->proLength;
     int32_t i;
     UChar32 uchar;
@@ -2096,7 +2096,7 @@ lastL_R_AL(UBiDi *pBiDi) {
  */
 static DirProp
 firstL_R_AL_EN_AN(UBiDi *pBiDi) {
-    const UChar *text=pBiDi->epilogue;
+    const char16_t *text=pBiDi->epilogue;
     int32_t length=pBiDi->epiLength;
     int32_t i;
     UChar32 uchar;
@@ -2326,8 +2326,8 @@ adjustWSLevels(UBiDi *pBiDi) {
 
 U_CAPI void U_EXPORT2
 ubidi_setContext(UBiDi *pBiDi,
-                 const UChar *prologue, int32_t proLength,
-                 const UChar *epilogue, int32_t epiLength,
+                 const char16_t *prologue, int32_t proLength,
+                 const char16_t *epilogue, int32_t epiLength,
                  UErrorCode *pErrorCode) {
     /* check the argument values */
     RETURN_VOID_IF_NULL_OR_FAILING_ERRCODE(pErrorCode);
@@ -2362,11 +2362,11 @@ setParaSuccess(UBiDi *pBiDi) {
 #define BIDI_ABS(x)      ((x)>=0  ? (x) : (-(x)))
 
 static void
-setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
+setParaRunsOnly(UBiDi *pBiDi, const char16_t *text, int32_t length,
                 UBiDiLevel paraLevel, UErrorCode *pErrorCode) {
     int32_t *runsOnlyMemory = nullptr;
     int32_t *visualMap;
-    UChar *visualText;
+    char16_t *visualText;
     int32_t saveLength, saveTrailingWSStart;
     const UBiDiLevel *levels;
     UBiDiLevel *saveLevels;
@@ -2385,13 +2385,13 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
         goto cleanup3;
     }
     /* obtain memory for mapping table and visual text */
-    runsOnlyMemory=static_cast<int32_t *>(uprv_malloc(length*(sizeof(int32_t)+sizeof(UChar)+sizeof(UBiDiLevel))));
+    runsOnlyMemory=static_cast<int32_t *>(uprv_malloc(length*(sizeof(int32_t)+sizeof(char16_t)+sizeof(UBiDiLevel))));
     if(runsOnlyMemory==nullptr) {
         *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
         goto cleanup3;
     }
     visualMap=runsOnlyMemory;
-    visualText=(UChar *)&visualMap[length];
+    visualText=(char16_t *)&visualMap[length];
     saveLevels=(UBiDiLevel *)&visualText[length];
     saveOptions=pBiDi->reorderingOptions;
     if(saveOptions & UBIDI_OPTION_INSERT_MARKS) {
@@ -2551,7 +2551,7 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
 /* ubidi_setPara ------------------------------------------------------------ */
 
 U_CAPI void U_EXPORT2
-ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
+ubidi_setPara(UBiDi *pBiDi, const char16_t *text, int32_t length,
               UBiDiLevel paraLevel, UBiDiLevel *embeddingLevels,
               UErrorCode *pErrorCode) {
     UBiDiDirection direction;
@@ -2879,7 +2879,7 @@ ubidi_getDirection(const UBiDi *pBiDi) {
     }
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 ubidi_getText(const UBiDi *pBiDi) {
     if(IS_VALID_PARA_OR_LINE(pBiDi)) {
         return pBiDi->text;
index 7ad94498fcbc760eb39302ad9691b0728a01ece3..63c4f9190a9639b98cb6a508563392d21e3746f1 100644 (file)
@@ -694,7 +694,7 @@ ubidi_getRuns(UBiDi *pBiDi, UErrorCode*) {
     /* handle remove BiDi control characters */
     if(pBiDi->controlCount>0) {
         int32_t runIndex;
-        const UChar *start=pBiDi->text, *limit=start+pBiDi->length, *pu;
+        const char16_t *start=pBiDi->text, *limit=start+pBiDi->length, *pu;
         for(pu=start; pu<limit; pu++) {
             if(IS_BIDI_CONTROL_CHAR(*pu)) {
                 runIndex=getRunFromLogicalIndex(pBiDi, (int32_t)(pu-start));
@@ -941,7 +941,7 @@ ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode)
         Run *runs=pBiDi->runs;
         int32_t i, j, start, limit, length, insertRemove;
         int32_t visualStart=0, controlFound=0;
-        UChar uchar=pBiDi->text[logicalIndex];
+        char16_t uchar=pBiDi->text[logicalIndex];
         /* is the logical index pointing to a control ? */
         if(IS_BIDI_CONTROL_CHAR(uchar)) {
             return UBIDI_MAP_NOWHERE;
@@ -1036,7 +1036,7 @@ ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode)
         /* handle removed BiDi control characters */
         int32_t controlFound=0, insertRemove, length;
         int32_t logicalStart, logicalEnd, visualStart=0, j, k;
-        UChar uchar;
+        char16_t uchar;
         UBool evenRun;
         /* add number of controls until visual index */
         for(i=0; ; i++, visualStart+=length) {
@@ -1171,7 +1171,7 @@ ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) {
             int32_t controlFound=0, runCount=pBiDi->runCount;
             int32_t length, insertRemove;
             UBool evenRun;
-            UChar uchar;
+            char16_t uchar;
             visualStart=0;
             /* subtract number of controls found until each index */
             for(i=0; i<runCount; i++, visualStart+=length) {
@@ -1277,7 +1277,7 @@ ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) {
         else if(pBiDi->controlCount>0) {
             int32_t runCount=pBiDi->runCount, logicalEnd;
             int32_t insertRemove, length, i, j, k, m;
-            UChar uchar;
+            char16_t uchar;
             UBool evenRun;
             runs=pBiDi->runs;
             visualStart=0;
index fe190391bb741bf0ad06da045ab9f77522c0d669..01f5901a2c2f6a8b6a55cbb9742a3c48652f44ed 100644 (file)
@@ -78,8 +78,8 @@ typedef struct {
 struct UBiDiTransform {
     UBiDi                   *pBidi;             /* pointer to a UBiDi object */
     const ReorderingScheme  *pActiveScheme;     /* effective reordering scheme */
-    UChar                   *src;               /* input text */
-    UChar                   *dest;              /* output text */
+    char16_t                *src;               /* input text */
+    char16_t                *dest;              /* output text */
     uint32_t                srcLength;          /* input text length - not really needed as we are zero-terminated and can u_strlen */
     uint32_t                srcSize;            /* input text capacity excluding the trailing zero */
     uint32_t                destSize;           /* output text capacity */
@@ -215,12 +215,12 @@ action_reverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
  * 
  * @param pTransform A pointer to the <code>UBiDiTransform</code> structure.
  * @param newSrc A pointer whose value is to be used as input text.
- * @param newLength A length of the new text in <code>UChar</code>s.
- * @param newSize A new source capacity in <code>UChar</code>s.
+ * @param newLength A length of the new text in <code>char16_t</code>s.
+ * @param newSize A new source capacity in <code>char16_t</code>s.
  * @param pErrorCode Pointer to the error code value.
  */
 static void
-updateSrc(UBiDiTransform *pTransform, const UChar *newSrc, uint32_t newLength,
+updateSrc(UBiDiTransform *pTransform, const char16_t *newSrc, uint32_t newLength,
         uint32_t newSize, UErrorCode *pErrorCode)
 {
     if (newSize < newLength) {
@@ -233,7 +233,7 @@ updateSrc(UBiDiTransform *pTransform, const UChar *newSrc, uint32_t newLength,
             uprv_free(pTransform->src);
             pTransform->src = nullptr;
         }
-        pTransform->src = (UChar *)uprv_malloc(newSize * sizeof(UChar));
+        pTransform->src = (char16_t *)uprv_malloc(newSize * sizeof(char16_t));
         if (pTransform->src == nullptr) {
             *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
             //pTransform->srcLength = pTransform->srcSize = 0;
@@ -387,7 +387,7 @@ static const uint32_t nSchemes = sizeof(Schemes) / sizeof(*Schemes);
  * of the first strong bidi character.
  */
 static void
-resolveBaseDirection(const UChar *text, uint32_t length,
+resolveBaseDirection(const char16_t *text, uint32_t length,
         UBiDiLevel *pInLevel, UBiDiLevel *pOutLevel)
 {
     switch (*pInLevel) {
@@ -436,8 +436,8 @@ findMatchingScheme(UBiDiLevel inLevel, UBiDiLevel outLevel,
 
 U_CAPI uint32_t U_EXPORT2
 ubiditransform_transform(UBiDiTransform *pBiDiTransform,
-            const UChar *src, int32_t srcLength,
-            UChar *dest, int32_t destSize,
+            const char16_t *src, int32_t srcLength,
+            char16_t *dest, int32_t destSize,
             UBiDiLevel inParaLevel, UBiDiOrder inOrder,
             UBiDiLevel outParaLevel, UBiDiOrder outOrder,
             UBiDiMirroring doMirroring, uint32_t shapingOptions,
index ba30d46156ca5a222107fd7081b9ee7209fa1d2b..969807c24376aaf13b435877bbef758776333e43 100644 (file)
@@ -56,8 +56,8 @@
  * we are writing RTL output in reverse.
  */
 static int32_t
-doWriteForward(const UChar *src, int32_t srcLength,
-               UChar *dest, int32_t destSize,
+doWriteForward(const char16_t *src, int32_t srcLength,
+               char16_t *dest, int32_t destSize,
                uint16_t options,
                UErrorCode *pErrorCode) {
     /* optimize for several combinations of options */
@@ -93,7 +93,7 @@ doWriteForward(const UChar *src, int32_t srcLength,
     case UBIDI_REMOVE_BIDI_CONTROLS: {
         /* copy the LTR run and remove any BiDi control characters */
         int32_t remaining=destSize;
-        UChar c;
+        char16_t c;
         do {
             c=*src++;
             if(!IS_BIDI_CONTROL_CHAR(c)) {
@@ -149,8 +149,8 @@ doWriteForward(const UChar *src, int32_t srcLength,
 }
 
 static int32_t
-doWriteReverse(const UChar *src, int32_t srcLength,
-               UChar *dest, int32_t destSize,
+doWriteReverse(const char16_t *src, int32_t srcLength,
+               char16_t *dest, int32_t destSize,
                uint16_t options,
                UErrorCode *pErrorCode) {
     /*
@@ -248,7 +248,7 @@ doWriteReverse(const UChar *src, int32_t srcLength,
             /* we need to find out the destination length of the run,
                which will not include the BiDi control characters */
             int32_t length=srcLength;
-            UChar ch;
+            char16_t ch;
 
             i=0;
             do {
@@ -306,8 +306,8 @@ doWriteReverse(const UChar *src, int32_t srcLength,
 }
 
 U_CAPI int32_t U_EXPORT2
-ubidi_writeReverse(const UChar *src, int32_t srcLength,
-                   UChar *dest, int32_t destSize,
+ubidi_writeReverse(const char16_t *src, int32_t srcLength,
+                   char16_t *dest, int32_t destSize,
                    uint16_t options,
                    UErrorCode *pErrorCode) {
     int32_t destLength;
@@ -355,11 +355,11 @@ ubidi_writeReverse(const UChar *src, int32_t srcLength,
 #endif
 U_CAPI int32_t U_EXPORT2
 ubidi_writeReordered(UBiDi *pBiDi,
-                     UChar *dest, int32_t destSize,
+                     char16_t *dest, int32_t destSize,
                      uint16_t options,
                      UErrorCode *pErrorCode) {
-    const UChar *text;
-    UChar *saveDest;
+    const char16_t *text;
+    char16_t *saveDest;
     int32_t length, destCapacity;
     int32_t run, runCount, logicalStart, runLength;
 
@@ -459,8 +459,8 @@ ubidi_writeReordered(UBiDi *pBiDi,
         } else {
             /* insert BiDi controls for "inverse BiDi" */
             const DirProp *dirProps=pBiDi->dirProps;
-            const UChar *src;
-            UChar uc;
+            const char16_t *src;
+            char16_t uc;
             UBiDiDirection dir;
             int32_t markFlag;
 
@@ -586,7 +586,7 @@ ubidi_writeReordered(UBiDi *pBiDi,
         } else {
             /* insert BiDi controls for "inverse BiDi" */
             const DirProp *dirProps=pBiDi->dirProps;
-            const UChar *src;
+            const char16_t *src;
             UBiDiDirection dir;
 
             for(run=runCount; --run>=0;) {
index 2e5543dfe8676ee183a897ed36f3c994ddd4c661..46ec0d785adf13cc7f48b03af153519cfa5325c8 100644 (file)
@@ -33,7 +33,7 @@ U_NAMESPACE_USE
 U_CAPI UBreakIterator* U_EXPORT2
 ubrk_open(UBreakIteratorType type,
       const char *locale,
-      const UChar *text,
+      const char16_t *text,
       int32_t textLength,
       UErrorCode *status)
 {
@@ -94,9 +94,9 @@ ubrk_open(UBreakIteratorType type,
 //
 //------------------------------------------------------------------------------
 U_CAPI UBreakIterator* U_EXPORT2
-ubrk_openRules(  const UChar        *rules,
+ubrk_openRules(  const char16_t     *rules,
                        int32_t       rulesLength,
-                 const UChar        *text,
+                 const char16_t     *text,
                        int32_t       textLength,
                        UParseError  *parseErr,
                        UErrorCode   *status)  {
@@ -122,7 +122,7 @@ ubrk_openRules(  const UChar        *rules,
 
 U_CAPI UBreakIterator* U_EXPORT2
 ubrk_openBinaryRules(const uint8_t *binaryRules, int32_t rulesLength,
-                     const UChar *  text, int32_t textLength,
+                     const char16_t *  text, int32_t textLength,
                      UErrorCode *   status)
 {
     if (U_FAILURE(*status)) {
@@ -188,14 +188,14 @@ ubrk_close(UBreakIterator *bi)
 
 U_CAPI void U_EXPORT2
 ubrk_setText(UBreakIterator* bi,
-             const UChar*    text,
+             const char16_t*    text,
              int32_t         textLength,
              UErrorCode*     status)
 {
     UText  ut = UTEXT_INITIALIZER;
     utext_openUChars(&ut, text, textLength, status);
     ((BreakIterator*)bi)->setText(&ut, *status);
-    // A stack allocated UText wrapping a UChar * string
+    // A stack allocated UText wrapping a char16_t * string
     //   can be dumped without explicitly closing it.
 }
 
index e73b096bc590b6441cd433acef6934c078ff9070..de5e046fb0318db7c74705db78508a98f3aedda5 100644 (file)
@@ -195,12 +195,12 @@ ucase_totitle(UChar32 c) {
     return c;
 }
 
-static const UChar iDot[2] = { 0x69, 0x307 };
-static const UChar jDot[2] = { 0x6a, 0x307 };
-static const UChar iOgonekDot[3] = { 0x12f, 0x307 };
-static const UChar iDotGrave[3] = { 0x69, 0x307, 0x300 };
-static const UChar iDotAcute[3] = { 0x69, 0x307, 0x301 };
-static const UChar iDotTilde[3] = { 0x69, 0x307, 0x303 };
+static const char16_t iDot[2] = { 0x69, 0x307 };
+static const char16_t jDot[2] = { 0x6a, 0x307 };
+static const char16_t iOgonekDot[3] = { 0x12f, 0x307 };
+static const char16_t iDotGrave[3] = { 0x69, 0x307, 0x300 };
+static const char16_t iDotAcute[3] = { 0x69, 0x307, 0x301 };
+static const char16_t iDotTilde[3] = { 0x69, 0x307, 0x303 };
 
 
 U_CFUNC void U_EXPORT2
@@ -250,7 +250,7 @@ ucase_addCaseClosure(UChar32 c, const USetAdder *sa) {
          * full case mappings. Add them all.
          */
         const uint16_t *pe0, *pe=GET_EXCEPTIONS(&ucase_props_singleton, props);
-        const UChar *closure;
+        const char16_t *closure;
         uint16_t excWord=*pe++;
         int32_t idx, closureLength, fullLength, length;
 
@@ -276,7 +276,7 @@ ucase_addCaseClosure(UChar32 c, const USetAdder *sa) {
             pe=pe0;
             GET_SLOT_VALUE(excWord, UCASE_EXC_CLOSURE, pe, closureLength);
             closureLength&=UCASE_CLOSURE_MAX_LENGTH; /* higher bits are reserved */
-            closure=(const UChar *)pe+1; /* behind this slot, unless there are full case mappings */
+            closure=(const char16_t *)pe+1; /* behind this slot, unless there are full case mappings */
         } else {
             closureLength=0;
             closure=nullptr;
@@ -299,7 +299,7 @@ ucase_addCaseClosure(UChar32 c, const USetAdder *sa) {
             /* add the full case folding string */
             length=fullLength&0xf;
             if(length!=0) {
-                sa->addString(sa->set, (const UChar *)pe, length);
+                sa->addString(sa->set, (const char16_t *)pe, length);
                 pe+=length;
             }
 
@@ -309,7 +309,7 @@ ucase_addCaseClosure(UChar32 c, const USetAdder *sa) {
             fullLength>>=4;
             pe+=fullLength;
 
-            closure=(const UChar *)pe; /* behind full case mappings */
+            closure=(const char16_t *)pe; /* behind full case mappings */
         }
 
         /* add each code point in the closure string */
@@ -325,7 +325,7 @@ ucase_addCaseClosure(UChar32 c, const USetAdder *sa) {
  * must be length>0 and max>0 and length<=max
  */
 static inline int32_t
-strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) {
+strcmpMax(const char16_t *s, int32_t length, const char16_t *t, int32_t max) {
     int32_t c1, c2;
 
     max-=length; /* we require length<=max, so no need to decrement max in the loop */
@@ -350,7 +350,7 @@ strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) {
 }
 
 U_CFUNC UBool U_EXPORT2
-ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa) {
+ucase_addStringCaseClosure(const char16_t *s, int32_t length, const USetAdder *sa) {
     int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth;
 
     if(ucase_props_singleton.unfold==nullptr || s==nullptr) {
@@ -383,7 +383,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
     limit=unfoldRows;
     while(start<limit) {
         i=(start+limit)/2;
-        const UChar *p=reinterpret_cast<const UChar *>(unfold+(i*unfoldRowWidth));
+        const char16_t *p=reinterpret_cast<const char16_t *>(unfold+(i*unfoldRowWidth));
         result=strcmpMax(s, length, p, unfoldStringWidth);
 
         if(result==0) {
@@ -409,7 +409,7 @@ ucase_addStringCaseClosure(const UChar *s, int32_t length, const USetAdder *sa)
 U_NAMESPACE_BEGIN
 
 FullCaseFoldingIterator::FullCaseFoldingIterator()
-        : unfold(reinterpret_cast<const UChar *>(ucase_props_singleton.unfold)),
+        : unfold(reinterpret_cast<const char16_t *>(ucase_props_singleton.unfold)),
           unfoldRows(unfold[UCASE_UNFOLD_ROWS]),
           unfoldRowWidth(unfold[UCASE_UNFOLD_ROW_WIDTH]),
           unfoldStringWidth(unfold[UCASE_UNFOLD_STRING_WIDTH]),
@@ -421,7 +421,7 @@ FullCaseFoldingIterator::FullCaseFoldingIterator()
 UChar32
 FullCaseFoldingIterator::next(UnicodeString &full) {
     // Advance past the last-delivered code point.
-    const UChar *p=unfold+(currentRow*unfoldRowWidth);
+    const char16_t *p=unfold+(currentRow*unfoldRowWidth);
     if(rowCpIndex>=unfoldRowWidth || p[rowCpIndex]==0) {
         ++currentRow;
         p+=unfoldRowWidth;
@@ -1053,7 +1053,7 @@ isFollowedByDotAbove(UCaseContextIterator *iter, void *context) {
 U_CAPI int32_t U_EXPORT2
 ucase_toFullLower(UChar32 c,
                   UCaseContextIterator *iter, void *context,
-                  const UChar **pString,
+                  const char16_t **pString,
                   int32_t loc) {
     // The sign of the result has meaning, input must be non-negative so that it can be returned as is.
     U_ASSERT(c >= 0);
@@ -1180,7 +1180,7 @@ ucase_toFullLower(UChar32 c,
             full&=UCASE_FULL_LOWER;
             if(full!=0) {
                 /* set the output pointer to the lowercase mapping */
-                *pString=reinterpret_cast<const UChar *>(pe+1);
+                *pString=reinterpret_cast<const char16_t *>(pe+1);
 
                 /* return the string length */
                 return full;
@@ -1204,7 +1204,7 @@ ucase_toFullLower(UChar32 c,
 static int32_t
 toUpperOrTitle(UChar32 c,
                UCaseContextIterator *iter, void *context,
-               const UChar **pString,
+               const char16_t **pString,
                int32_t loc,
                UBool upperNotTitle) {
     // The sign of the result has meaning, input must be non-negative so that it can be returned as is.
@@ -1286,7 +1286,7 @@ toUpperOrTitle(UChar32 c,
 
             if(full!=0) {
                 /* set the output pointer to the result string */
-                *pString=reinterpret_cast<const UChar *>(pe);
+                *pString=reinterpret_cast<const char16_t *>(pe);
 
                 /* return the string length */
                 return full;
@@ -1315,7 +1315,7 @@ toUpperOrTitle(UChar32 c,
 U_CAPI int32_t U_EXPORT2
 ucase_toFullUpper(UChar32 c,
                   UCaseContextIterator *iter, void *context,
-                  const UChar **pString,
+                  const char16_t **pString,
                   int32_t caseLocale) {
     return toUpperOrTitle(c, iter, context, pString, caseLocale, true);
 }
@@ -1323,7 +1323,7 @@ ucase_toFullUpper(UChar32 c,
 U_CAPI int32_t U_EXPORT2
 ucase_toFullTitle(UChar32 c,
                   UCaseContextIterator *iter, void *context,
-                  const UChar **pString,
+                  const char16_t **pString,
                   int32_t caseLocale) {
     return toUpperOrTitle(c, iter, context, pString, caseLocale, false);
 }
@@ -1440,7 +1440,7 @@ ucase_fold(UChar32 c, uint32_t options) {
 
 U_CAPI int32_t U_EXPORT2
 ucase_toFullFolding(UChar32 c,
-                    const UChar **pString,
+                    const char16_t **pString,
                     uint32_t options) {
     // The sign of the result has meaning, input must be non-negative so that it can be returned as is.
     U_ASSERT(c >= 0);
@@ -1493,7 +1493,7 @@ ucase_toFullFolding(UChar32 c,
 
             if(full!=0) {
                 /* set the output pointer to the result string */
-                *pString=reinterpret_cast<const UChar *>(pe);
+                *pString=reinterpret_cast<const char16_t *>(pe);
 
                 /* return the string length */
                 return full;
@@ -1562,7 +1562,7 @@ u_foldCase(UChar32 c, uint32_t options) {
 U_CFUNC int32_t U_EXPORT2
 ucase_hasBinaryProperty(UChar32 c, UProperty which) {
     /* case mapping properties */
-    const UChar *resultString;
+    const char16_t *resultString;
     switch(which) {
     case UCHAR_LOWERCASE:
         return (UBool)(UCASE_LOWER==ucase_getType(c));
index 049f0429122186b7d59869f055195e4903e5d311..d1c3183b240e219ce90ce7e8de0249d4aca5e4e9 100644 (file)
@@ -142,7 +142,7 @@ private:
     FullCaseFoldingIterator(const FullCaseFoldingIterator &) = delete;  // no copy
     FullCaseFoldingIterator &operator=(const FullCaseFoldingIterator &) = delete;  // no assignment
 
-    const UChar *unfold;
+    const char16_t *unfold;
     int32_t unfoldRows;
     int32_t unfoldRowWidth;
     int32_t unfoldStringWidth;
@@ -159,9 +159,9 @@ private:
 namespace LatinCase {
 
 /** Case mapping/folding data for code points up to U+017F. */
-constexpr UChar LIMIT = 0x180;
+constexpr char16_t LIMIT = 0x180;
 /** U+017F case-folds and uppercases crossing the ASCII boundary. */
-constexpr UChar LONG_S = 0x17f;
+constexpr char16_t LONG_S = 0x17f;
 /** Exception: Complex mapping, or too-large delta. */
 constexpr int8_t EXC = -0x80;
 
index 1eb049e2b2b0f4829a8d3b6776eec9524a698c19..1d8a8b6c2f7ecac65e4d64995d0fc3e895ba7a19 100644 (file)
@@ -136,7 +136,7 @@ namespace {
 
 /* append a full case mapping result, see UCASE_MAX_STRING_LENGTH */
 inline UBool
-appendResult(int32_t cpLength, int32_t result, const UChar *s,
+appendResult(int32_t cpLength, int32_t result, const char16_t *s,
              ByteSink &sink, uint32_t options, icu::Edits *edits, UErrorCode &errorCode) {
     U_ASSERT(U_SUCCESS(errorCode));
 
@@ -292,7 +292,7 @@ void toLower(int32_t caseLocale, uint32_t options,
             break;
         }
         // slow path
-        const UChar *s;
+        const char16_t *s;
         if (caseLocale >= 0) {
             csc->cpStart = cpStart;
             csc->cpLimit = srcIndex;
@@ -402,7 +402,7 @@ void toUpper(int32_t caseLocale, uint32_t options,
         // slow path
         csc->cpStart = cpStart;
         csc->cpLimit = srcIndex;
-        const UChar *s;
+        const char16_t *s;
         c = ucase_toFullUpper(c, utf8_caseContextIterator, csc, &s, caseLocale);
         if (c >= 0) {
             ByteSinkUtil::appendUnchanged(src + prev, cpStart - prev,
@@ -580,7 +580,7 @@ ucasemap_internalUTF8ToTitle(
                 if(c>=0) {
                     csc.cpStart=titleStart;
                     csc.cpLimit=titleLimit;
-                    const UChar *s;
+                    const char16_t *s;
                     c=ucase_toFullTitle(c, utf8_caseContextIterator, &csc, &s, caseLocale);
                     if (!appendResult(titleLimit-titleStart, c, s, sink, options, edits, errorCode)) {
                         return;
@@ -783,7 +783,7 @@ void toUpper(uint32_t options,
                 }
             }
         } else if(c>=0) {
-            const UChar *s;
+            const char16_t *s;
             c=ucase_toFullUpper(c, nullptr, nullptr, &s, UCASE_LOC_GREEK);
             if (!appendResult(nextIndex - i, c, s, sink, options, edits, errorCode)) {
                 return;
index e17a0ae5a36b6d3ddd5dfd49826efb2f083fd7b7..71d0e9033fe2932de6d670d5157ef50bbe9b32e6 100644 (file)
@@ -139,16 +139,16 @@ ustrcase_getCaseLocale(const char *locale);
 /** Implements UStringCaseMapper. */
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalToLower(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-                         UChar *dest, int32_t destCapacity,
-                         const UChar *src, int32_t srcLength,
+                         char16_t *dest, int32_t destCapacity,
+                         const char16_t *src, int32_t srcLength,
                          icu::Edits *edits,
                          UErrorCode &errorCode);
 
 /** Implements UStringCaseMapper. */
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-                         UChar *dest, int32_t destCapacity,
-                         const UChar *src, int32_t srcLength,
+                         char16_t *dest, int32_t destCapacity,
+                         const char16_t *src, int32_t srcLength,
                          icu::Edits *edits,
                          UErrorCode &errorCode);
 
@@ -158,8 +158,8 @@ ustrcase_internalToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_IT
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalToTitle(int32_t caseLocale, uint32_t options,
                          icu::BreakIterator *iter,
-                         UChar *dest, int32_t destCapacity,
-                         const UChar *src, int32_t srcLength,
+                         char16_t *dest, int32_t destCapacity,
+                         const char16_t *src, int32_t srcLength,
                          icu::Edits *edits,
                          UErrorCode &errorCode);
 
@@ -168,8 +168,8 @@ ustrcase_internalToTitle(int32_t caseLocale, uint32_t options,
 /** Implements UStringCaseMapper. */
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalFold(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-                      UChar *dest, int32_t destCapacity,
-                      const UChar *src, int32_t srcLength,
+                      char16_t *dest, int32_t destCapacity,
+                      const char16_t *src, int32_t srcLength,
                       icu::Edits *edits,
                       UErrorCode &errorCode);
 
@@ -179,8 +179,8 @@ ustrcase_internalFold(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERA
  */
 U_CFUNC int32_t
 ustrcase_map(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-             UChar *dest, int32_t destCapacity,
-             const UChar *src, int32_t srcLength,
+             char16_t *dest, int32_t destCapacity,
+             const char16_t *src, int32_t srcLength,
              UStringCaseMapper *stringCaseMapper,
              icu::Edits *edits,
              UErrorCode &errorCode);
@@ -192,8 +192,8 @@ ustrcase_map(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
  */
 U_CFUNC int32_t
 ustrcase_mapWithOverlap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-                        UChar *dest, int32_t destCapacity,
-                        const UChar *src, int32_t srcLength,
+                        char16_t *dest, int32_t destCapacity,
+                        const char16_t *src, int32_t srcLength,
                         UStringCaseMapper *stringCaseMapper,
                         UErrorCode &errorCode);
 
index a5d2e296d5f7127d0d97f48aef434824b5eca57f..2f7fdcd980c482358da95da32976d99cb8303976 100644 (file)
@@ -46,13 +46,13 @@ u_catclose(u_nl_catd catd) {
     ures_close((UResourceBundle*) catd); /* may be nullptr */
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 u_catgets(u_nl_catd catd, int32_t set_num, int32_t msg_num,
-          const UChar* s,
+          const char16_t* s,
           int32_t* len, UErrorCode* ec) {
 
     char key[MAX_KEY_LEN];
-    const UChar* result;
+    const char16_t* result;
 
     if (ec == nullptr || U_FAILURE(*ec)) {
         goto ERROR;
index e9aead4895deb8137171e109a06b2f6cf2eb5b72..ba9cea7ba390257166a35f8c0c53ab4824c0d5cd 100644 (file)
@@ -30,7 +30,7 @@ UCharsTrie::~UCharsTrie() {
 
 UStringTrieResult
 UCharsTrie::current() const {
-    const UChar *pos=pos_;
+    const char16_t *pos=pos_;
     if(pos==nullptr) {
         return USTRINGTRIE_NO_MATCH;
     } else {
@@ -59,7 +59,7 @@ UCharsTrie::nextForCodePoint(UChar32 cp) {
 }
 
 UStringTrieResult
-UCharsTrie::branchNext(const UChar *pos, int32_t length, int32_t uchar) {
+UCharsTrie::branchNext(const char16_t *pos, int32_t length, int32_t uchar) {
     // Branch according to the current unit.
     if(length==0) {
         length=*pos++;
@@ -121,7 +121,7 @@ UCharsTrie::branchNext(const UChar *pos, int32_t length, int32_t uchar) {
 }
 
 UStringTrieResult
-UCharsTrie::nextImpl(const UChar *pos, int32_t uchar) {
+UCharsTrie::nextImpl(const char16_t *pos, int32_t uchar) {
     int32_t node=*pos++;
     for(;;) {
         if(node<kMinLinearMatch) {
@@ -153,7 +153,7 @@ UCharsTrie::nextImpl(const UChar *pos, int32_t uchar) {
 
 UStringTrieResult
 UCharsTrie::next(int32_t uchar) {
-    const UChar *pos=pos_;
+    const char16_t *pos=pos_;
     if(pos==nullptr) {
         return USTRINGTRIE_NO_MATCH;
     }
@@ -176,12 +176,12 @@ UCharsTrie::next(int32_t uchar) {
 
 UStringTrieResult
 UCharsTrie::next(ConstChar16Ptr ptr, int32_t sLength) {
-    const UChar *s=ptr;
+    const char16_t *s=ptr;
     if(sLength<0 ? *s==0 : sLength==0) {
         // Empty input.
         return current();
     }
-    const UChar *pos=pos_;
+    const char16_t *pos=pos_;
     if(pos==nullptr) {
         return USTRINGTRIE_NO_MATCH;
     }
@@ -282,8 +282,8 @@ UCharsTrie::next(ConstChar16Ptr ptr, int32_t sLength) {
     }
 }
 
-const UChar *
-UCharsTrie::findUniqueValueFromBranch(const UChar *pos, int32_t length,
+const char16_t *
+UCharsTrie::findUniqueValueFromBranch(const char16_t *pos, int32_t length,
                                       UBool haveUniqueValue, int32_t &uniqueValue) {
     while(length>kMaxBranchLinearSubNodeLength) {
         ++pos;  // ignore the comparison unit
@@ -321,7 +321,7 @@ UCharsTrie::findUniqueValueFromBranch(const UChar *pos, int32_t length,
 }
 
 UBool
-UCharsTrie::findUniqueValue(const UChar *pos, UBool haveUniqueValue, int32_t &uniqueValue) {
+UCharsTrie::findUniqueValue(const char16_t *pos, UBool haveUniqueValue, int32_t &uniqueValue) {
     int32_t node=*pos++;
     for(;;) {
         if(node<kMinLinearMatch) {
@@ -365,7 +365,7 @@ UCharsTrie::findUniqueValue(const UChar *pos, UBool haveUniqueValue, int32_t &un
 
 int32_t
 UCharsTrie::getNextUChars(Appendable &out) const {
-    const UChar *pos=pos_;
+    const char16_t *pos=pos_;
     if(pos==nullptr) {
         return 0;
     }
@@ -397,7 +397,7 @@ UCharsTrie::getNextUChars(Appendable &out) const {
 }
 
 void
-UCharsTrie::getNextBranchUChars(const UChar *pos, int32_t length, Appendable &out) {
+UCharsTrie::getNextBranchUChars(const char16_t *pos, int32_t length, Appendable &out) {
     while(length>kMaxBranchLinearSubNodeLength) {
         ++pos;  // ignore the comparison unit
         getNextBranchUChars(jumpByDelta(pos), length>>1, out);
index 3c6c14f75a2983313df344b930065ed5a5999166..4bb5450c12f64b1ababc3c1c89ed1e06b379f5cd 100644 (file)
@@ -47,7 +47,7 @@ public:
         return strings[stringOffset];
     }
 
-    UChar charAt(int32_t index, const UnicodeString &strings) const {
+    char16_t charAt(int32_t index, const UnicodeString &strings) const {
         return strings[stringOffset+1+index];
     }
 
@@ -75,7 +75,7 @@ UCharsTrieElement::setTo(const UnicodeString &s, int32_t val,
         return;
     }
     stringOffset=strings.length();
-    strings.append((UChar)length);
+    strings.append((char16_t)length);
     value=val;
     strings.append(s);
 }
@@ -204,7 +204,7 @@ UCharsTrieBuilder::buildUChars(UStringTrieBuildOption buildOption, UErrorCode &e
             prev.fastCopyFrom(current);
         }
     }
-    // Create and UChar-serialize the trie for the elements.
+    // Create and char16_t-serialize the trie for the elements.
     ucharsLength=0;
     int32_t capacity=strings.length();
     if(capacity<1024) {
@@ -212,7 +212,7 @@ UCharsTrieBuilder::buildUChars(UStringTrieBuildOption buildOption, UErrorCode &e
     }
     if(ucharsCapacity<capacity) {
         uprv_free(uchars);
-        uchars=static_cast<UChar *>(uprv_malloc(capacity*2));
+        uchars=static_cast<char16_t *>(uprv_malloc(capacity*2));
         if(uchars==nullptr) {
             errorCode=U_MEMORY_ALLOCATION_ERROR;
             ucharsCapacity=0;
@@ -231,7 +231,7 @@ UCharsTrieBuilder::getElementStringLength(int32_t i) const {
     return elements[i].getStringLength(strings);
 }
 
-UChar
+char16_t
 UCharsTrieBuilder::getElementUnit(int32_t i, int32_t unitIndex) const {
     return elements[i].charAt(unitIndex, strings);
 }
@@ -257,7 +257,7 @@ UCharsTrieBuilder::countElementUnits(int32_t start, int32_t limit, int32_t unitI
     int32_t length=0;  // Number of different units at unitIndex.
     int32_t i=start;
     do {
-        UChar unit=elements[i++].charAt(unitIndex, strings);
+        char16_t unit=elements[i++].charAt(unitIndex, strings);
         while(i<limit && unit==elements[i].charAt(unitIndex, strings)) {
             ++i;
         }
@@ -269,7 +269,7 @@ UCharsTrieBuilder::countElementUnits(int32_t start, int32_t limit, int32_t unitI
 int32_t
 UCharsTrieBuilder::skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const {
     do {
-        UChar unit=elements[i++].charAt(unitIndex, strings);
+        char16_t unit=elements[i++].charAt(unitIndex, strings);
         while(unit==elements[i].charAt(unitIndex, strings)) {
             ++i;
         }
@@ -278,14 +278,14 @@ UCharsTrieBuilder::skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t
 }
 
 int32_t
-UCharsTrieBuilder::indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, UChar unit) const {
+UCharsTrieBuilder::indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const {
     while(unit==elements[i].charAt(unitIndex, strings)) {
         ++i;
     }
     return i;
 }
 
-UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const UChar *units, int32_t len, Node *nextNode)
+UCharsTrieBuilder::UCTLinearMatchNode::UCTLinearMatchNode(const char16_t *units, int32_t len, Node *nextNode)
         : LinearMatchNode(len, nextNode), s(units) {
     hash=hash*37u+ustr_hashUCharsN(units, len);
 }
@@ -329,7 +329,7 @@ UCharsTrieBuilder::ensureCapacity(int32_t length) {
         do {
             newCapacity*=2;
         } while(newCapacity<=length);
-        UChar *newUChars=static_cast<UChar *>(uprv_malloc(newCapacity*2));
+        char16_t *newUChars=static_cast<char16_t *>(uprv_malloc(newCapacity*2));
         if(newUChars==nullptr) {
             // unable to allocate memory
             uprv_free(uchars);
@@ -351,13 +351,13 @@ UCharsTrieBuilder::write(int32_t unit) {
     int32_t newLength=ucharsLength+1;
     if(ensureCapacity(newLength)) {
         ucharsLength=newLength;
-        uchars[ucharsCapacity-ucharsLength]=(UChar)unit;
+        uchars[ucharsCapacity-ucharsLength]=(char16_t)unit;
     }
     return ucharsLength;
 }
 
 int32_t
-UCharsTrieBuilder::write(const UChar *s, int32_t length) {
+UCharsTrieBuilder::write(const char16_t *s, int32_t length) {
     int32_t newLength=ucharsLength+length;
     if(ensureCapacity(newLength)) {
         ucharsLength=newLength;
@@ -376,22 +376,22 @@ UCharsTrieBuilder::writeValueAndFinal(int32_t i, UBool isFinal) {
     if(0<=i && i<=UCharsTrie::kMaxOneUnitValue) {
         return write(i|(isFinal<<15));
     }
-    UChar intUnits[3];
+    char16_t intUnits[3];
     int32_t length;
     if(i<0 || i>UCharsTrie::kMaxTwoUnitValue) {
-        intUnits[0]=(UChar)(UCharsTrie::kThreeUnitValueLead);
-        intUnits[1]=(UChar)((uint32_t)i>>16);
-        intUnits[2]=(UChar)i;
+        intUnits[0]=(char16_t)(UCharsTrie::kThreeUnitValueLead);
+        intUnits[1]=(char16_t)((uint32_t)i>>16);
+        intUnits[2]=(char16_t)i;
         length=3;
     // } else if(i<=UCharsTrie::kMaxOneUnitValue) {
-    //     intUnits[0]=(UChar)(i);
+    //     intUnits[0]=(char16_t)(i);
     //     length=1;
     } else {
-        intUnits[0]=(UChar)(UCharsTrie::kMinTwoUnitValueLead+(i>>16));
-        intUnits[1]=(UChar)i;
+        intUnits[0]=(char16_t)(UCharsTrie::kMinTwoUnitValueLead+(i>>16));
+        intUnits[1]=(char16_t)i;
         length=2;
     }
-    intUnits[0]=(UChar)(intUnits[0]|(isFinal<<15));
+    intUnits[0]=(char16_t)(intUnits[0]|(isFinal<<15));
     return write(intUnits, length);
 }
 
@@ -400,22 +400,22 @@ UCharsTrieBuilder::writeValueAndType(UBool hasValue, int32_t value, int32_t node
     if(!hasValue) {
         return write(node);
     }
-    UChar intUnits[3];
+    char16_t intUnits[3];
     int32_t length;
     if(value<0 || value>UCharsTrie::kMaxTwoUnitNodeValue) {
-        intUnits[0]=(UChar)(UCharsTrie::kThreeUnitNodeValueLead);
-        intUnits[1]=(UChar)((uint32_t)value>>16);
-        intUnits[2]=(UChar)value;
+        intUnits[0]=(char16_t)(UCharsTrie::kThreeUnitNodeValueLead);
+        intUnits[1]=(char16_t)((uint32_t)value>>16);
+        intUnits[2]=(char16_t)value;
         length=3;
     } else if(value<=UCharsTrie::kMaxOneUnitNodeValue) {
-        intUnits[0]=(UChar)((value+1)<<6);
+        intUnits[0]=(char16_t)((value+1)<<6);
         length=1;
     } else {
-        intUnits[0]=(UChar)(UCharsTrie::kMinTwoUnitNodeValueLead+((value>>10)&0x7fc0));
-        intUnits[1]=(UChar)value;
+        intUnits[0]=(char16_t)(UCharsTrie::kMinTwoUnitNodeValueLead+((value>>10)&0x7fc0));
+        intUnits[1]=(char16_t)value;
         length=2;
     }
-    intUnits[0]|=(UChar)node;
+    intUnits[0]|=(char16_t)node;
     return write(intUnits, length);
 }
 
@@ -426,17 +426,17 @@ UCharsTrieBuilder::writeDeltaTo(int32_t jumpTarget) {
     if(i<=UCharsTrie::kMaxOneUnitDelta) {
         return write(i);
     }
-    UChar intUnits[3];
+    char16_t intUnits[3];
     int32_t length;
     if(i<=UCharsTrie::kMaxTwoUnitDelta) {
-        intUnits[0]=(UChar)(UCharsTrie::kMinTwoUnitDeltaLead+(i>>16));
+        intUnits[0]=(char16_t)(UCharsTrie::kMinTwoUnitDeltaLead+(i>>16));
         length=1;
     } else {
-        intUnits[0]=(UChar)(UCharsTrie::kThreeUnitDeltaLead);
-        intUnits[1]=(UChar)(i>>16);
+        intUnits[0]=(char16_t)(UCharsTrie::kThreeUnitDeltaLead);
+        intUnits[1]=(char16_t)(i>>16);
         length=2;
     }
-    intUnits[length++]=(UChar)i;
+    intUnits[length++]=(char16_t)i;
     return write(intUnits, length);
 }
 
index 767157ca74f62ab012b07ba74d19e170c08ad16b..176aed68259cb593204cd93d578ccf6583ddf376 100644 (file)
@@ -102,7 +102,7 @@ UCharsTrie::Iterator::next(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) {
         return false;
     }
-    const UChar *pos=pos_;
+    const char16_t *pos=pos_;
     if(pos==nullptr) {
         if(stack_->isEmpty()) {
             return false;
@@ -182,8 +182,8 @@ UCharsTrie::Iterator::next(UErrorCode &errorCode) {
 }
 
 // Branch node, needs to take the first outbound edge and push state for the rest.
-const UChar *
-UCharsTrie::Iterator::branchNext(const UChar *pos, int32_t length, UErrorCode &errorCode) {
+const char16_t *
+UCharsTrie::Iterator::branchNext(const char16_t *pos, int32_t length, UErrorCode &errorCode) {
     while(length>kMaxBranchLinearSubNodeLength) {
         ++pos;  // ignore the comparison unit
         // Push state for the greater-or-equal edge.
@@ -195,7 +195,7 @@ UCharsTrie::Iterator::branchNext(const UChar *pos, int32_t length, UErrorCode &e
     }
     // List of key-value pairs where values are either final values or jump deltas.
     // Read the first (key, value) pair.
-    UChar trieUnit=*pos++;
+    char16_t trieUnit=*pos++;
     int32_t node=*pos++;
     UBool isFinal=(UBool)(node>>15);
     int32_t value=readValue(pos, node&=0x7fff);
index f2a995384130965d3c5cd76f3de0a10ed4325f75..89c1b418db667b24c5d7b4848edfb2110a7cc350 100644 (file)
@@ -94,7 +94,7 @@ UCharCharacterIterator::clone() const {
     return new UCharCharacterIterator(*this);
 }
 
-UChar
+char16_t
 UCharCharacterIterator::first() {
     pos = begin;
     if(pos < end) {
@@ -104,7 +104,7 @@ UCharCharacterIterator::first() {
     }
 }
 
-UChar
+char16_t
 UCharCharacterIterator::firstPostInc() {
     pos = begin;
     if(pos < end) {
@@ -114,7 +114,7 @@ UCharCharacterIterator::firstPostInc() {
     }
 }
 
-UChar
+char16_t
 UCharCharacterIterator::last() {
     pos = end;
     if(pos > begin) {
@@ -124,7 +124,7 @@ UCharCharacterIterator::last() {
     }
 }
 
-UChar
+char16_t
 UCharCharacterIterator::setIndex(int32_t position) {
     if(position < begin) {
         pos = begin;
@@ -140,7 +140,7 @@ UCharCharacterIterator::setIndex(int32_t position) {
     }
 }
 
-UChar
+char16_t
 UCharCharacterIterator::current() const {
     if (pos >= begin && pos < end) {
         return text[pos];
@@ -149,7 +149,7 @@ UCharCharacterIterator::current() const {
     }
 }
 
-UChar
+char16_t
 UCharCharacterIterator::next() {
     if (pos + 1 < end) {
         return text[++pos];
@@ -160,7 +160,7 @@ UCharCharacterIterator::next() {
     }
 }
 
-UChar
+char16_t
 UCharCharacterIterator::nextPostInc() {
     if (pos < end) {
         return text[pos++];
@@ -174,7 +174,7 @@ UCharCharacterIterator::hasNext() {
     return (UBool)(pos < end ? true : false);
 }
 
-UChar
+char16_t
 UCharCharacterIterator::previous() {
     if (pos > begin) {
         return text[--pos];
index e913dead520fd0f35717983ad77e0651907e1d1b..471d61af3afd9715a0d15a07f1a15d2916139569 100644 (file)
@@ -48,7 +48,7 @@
 
 typedef struct UAmbiguousConverter {
     const char *name;
-    const UChar variant5c;
+    const char16_t variant5c;
 } UAmbiguousConverter;
 
 static const UAmbiguousConverter ambiguousConverters[]={
@@ -89,9 +89,9 @@ ucnv_openPackage   (const char *packageName, const char *converterName, UErrorCo
     return ucnv_createConverterFromPackage(packageName, converterName,  err);
 }
 
-/*Extracts the UChar* to a char* and calls through createConverter */
+/*Extracts the char16_t* to a char* and calls through createConverter */
 U_CAPI UConverter*   U_EXPORT2
-ucnv_openU (const UChar * name,
+ucnv_openU (const char16_t * name,
                          UErrorCode * err)
 {
     char asciiName[UCNV_MAX_CONVERTER_NAME_LENGTH];
@@ -479,7 +479,7 @@ ucnv_setSubstChars (UConverter * converter,
 
 U_CAPI void U_EXPORT2
 ucnv_setSubstString(UConverter *cnv,
-                    const UChar *s,
+                    const char16_t *s,
                     int32_t length,
                     UErrorCode *err) {
     alignas(UConverter) char cloneBuffer[U_CNV_SAFECLONE_BUFFERSIZE];
@@ -517,7 +517,7 @@ ucnv_setSubstString(UConverter *cnv,
         if (length > UCNV_ERROR_BUFFER_LENGTH) {
             /*
              * Should not occur. The converter should output at least one byte
-             * per UChar, which means that ucnv_fromUChars() should catch all
+             * per char16_t, which means that ucnv_fromUChars() should catch all
              * overflows.
              */
             *err = U_BUFFER_OVERFLOW_ERROR;
@@ -833,7 +833,7 @@ static void
 _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
     UConverterFromUnicode fromUnicode;
     UConverter *cnv;
-    const UChar *s;
+    const char16_t *s;
     char *t;
     int32_t *offsets;
     int32_t sourceIndex;
@@ -841,8 +841,8 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) {
     UBool converterSawEndOfInput, calledCallback;
 
     /* variables for m:n conversion */
-    UChar replay[UCNV_EXT_MAX_UCHARS];
-    const UChar *realSource, *realSourceLimit;
+    char16_t replay[UCNV_EXT_MAX_UCHARS];
+    const char16_t *realSource, *realSourceLimit;
     int32_t realSourceIndex;
     UBool realFlush;
 
@@ -1176,12 +1176,12 @@ ucnv_outputOverflowFromUnicode(UConverter *cnv,
 U_CAPI void U_EXPORT2
 ucnv_fromUnicode(UConverter *cnv,
                  char **target, const char *targetLimit,
-                 const UChar **source, const UChar *sourceLimit,
+                 const char16_t **source, const char16_t *sourceLimit,
                  int32_t *offsets,
                  UBool flush,
                  UErrorCode *err) {
     UConverterFromUnicodeArgs args;
-    const UChar *s;
+    const char16_t *s;
     char *t;
 
     /* check parameters */
@@ -1200,10 +1200,10 @@ ucnv_fromUnicode(UConverter *cnv,
     if ((const void *)U_MAX_PTR(sourceLimit) == (const void *)sourceLimit) {
         /*
         Prevent code from going into an infinite loop in case we do hit this
-        limit. The limit pointer is expected to be on a UChar * boundary.
+        limit. The limit pointer is expected to be on a char16_t * boundary.
         This also prevents the next argument check from failing.
         */
-        sourceLimit = (const UChar *)(((const char *)sourceLimit) - 1);
+        sourceLimit = (const char16_t *)(((const char *)sourceLimit) - 1);
     }
 
     /*
@@ -1222,8 +1222,8 @@ ucnv_fromUnicode(UConverter *cnv,
      * consumed or the target filled (unless an error occurs).
      * An adjustment would be targetLimit=t+0x7fffffff; for example.
      *
-     * 3) Make sure that the user didn't incorrectly cast a UChar * pointer
-     * to a char * pointer and provide an incomplete UChar code unit.
+     * 3) Make sure that the user didn't incorrectly cast a char16_t * pointer
+     * to a char * pointer and provide an incomplete char16_t code unit.
      */
     if (sourceLimit<s || targetLimit<t ||
         ((size_t)(sourceLimit-s)>(size_t)0x3fffffff && sourceLimit>s) ||
@@ -1279,7 +1279,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
     UConverterToUnicode toUnicode;
     UConverter *cnv;
     const char *s;
-    UChar *t;
+    char16_t *t;
     int32_t *offsets;
     int32_t sourceIndex;
     int32_t errorInputLength;
@@ -1568,11 +1568,11 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
  */
 static UBool
 ucnv_outputOverflowToUnicode(UConverter *cnv,
-                             UChar **target, const UChar *targetLimit,
+                             char16_t **target, const char16_t *targetLimit,
                              int32_t **pOffsets,
                              UErrorCode *err) {
     int32_t *offsets;
-    UChar *overflow, *t;
+    char16_t *overflow, *t;
     int32_t i, length;
 
     t=*target;
@@ -1621,14 +1621,14 @@ ucnv_outputOverflowToUnicode(UConverter *cnv,
 
 U_CAPI void U_EXPORT2
 ucnv_toUnicode(UConverter *cnv,
-               UChar **target, const UChar *targetLimit,
+               char16_t **target, const char16_t *targetLimit,
                const char **source, const char *sourceLimit,
                int32_t *offsets,
                UBool flush,
                UErrorCode *err) {
     UConverterToUnicodeArgs args;
     const char *s;
-    UChar *t;
+    char16_t *t;
 
     /* check parameters */
     if(err==nullptr || U_FAILURE(*err)) {
@@ -1646,10 +1646,10 @@ ucnv_toUnicode(UConverter *cnv,
     if ((const void *)U_MAX_PTR(targetLimit) == (const void *)targetLimit) {
         /*
         Prevent code from going into an infinite loop in case we do hit this
-        limit. The limit pointer is expected to be on a UChar * boundary.
+        limit. The limit pointer is expected to be on a char16_t * boundary.
         This also prevents the next argument check from failing.
         */
-        targetLimit = (const UChar *)(((const char *)targetLimit) - 1);
+        targetLimit = (const char16_t *)(((const char *)targetLimit) - 1);
     }
 
     /*
@@ -1668,8 +1668,8 @@ ucnv_toUnicode(UConverter *cnv,
      * consumed or the target filled (unless an error occurs).
      * An adjustment would be sourceLimit=t+0x7fffffff; for example.
      *
-     * 3) Make sure that the user didn't incorrectly cast a UChar * pointer
-     * to a char * pointer and provide an incomplete UChar code unit.
+     * 3) Make sure that the user didn't incorrectly cast a char16_t * pointer
+     * to a char * pointer and provide an incomplete char16_t code unit.
      */
     if (sourceLimit<s || targetLimit<t ||
         ((size_t)(sourceLimit-s)>(size_t)0x7fffffff && sourceLimit>s) ||
@@ -1723,9 +1723,9 @@ ucnv_toUnicode(UConverter *cnv,
 U_CAPI int32_t U_EXPORT2
 ucnv_fromUChars(UConverter *cnv,
                 char *dest, int32_t destCapacity,
-                const UChar *src, int32_t srcLength,
+                const char16_t *src, int32_t srcLength,
                 UErrorCode *pErrorCode) {
-    const UChar *srcLimit;
+    const char16_t *srcLimit;
     char *originalDest, *destLimit;
     int32_t destLength;
 
@@ -1778,11 +1778,11 @@ ucnv_fromUChars(UConverter *cnv,
 
 U_CAPI int32_t U_EXPORT2
 ucnv_toUChars(UConverter *cnv,
-              UChar *dest, int32_t destCapacity,
+              char16_t *dest, int32_t destCapacity,
               const char *src, int32_t srcLength,
               UErrorCode *pErrorCode) {
     const char *srcLimit;
-    UChar *originalDest, *destLimit;
+    char16_t *originalDest, *destLimit;
     int32_t destLength;
 
     /* check arguments */
@@ -1816,7 +1816,7 @@ ucnv_toUChars(UConverter *cnv,
         /* if an overflow occurs, then get the preflighting length */
         if(*pErrorCode==U_BUFFER_OVERFLOW_ERROR)
         {
-            UChar buffer[1024];
+            char16_t buffer[1024];
 
             destLimit=buffer+UPRV_LENGTHOF(buffer);
             do {
@@ -1841,7 +1841,7 @@ ucnv_getNextUChar(UConverter *cnv,
                   const char **source, const char *sourceLimit,
                   UErrorCode *err) {
     UConverterToUnicodeArgs args;
-    UChar buffer[U16_MAX_LENGTH];
+    char16_t buffer[U16_MAX_LENGTH];
     const char *s;
     UChar32 c;
     int32_t i, length;
@@ -1883,7 +1883,7 @@ ucnv_getNextUChar(UConverter *cnv,
 
     /* flush the target overflow buffer */
     if(cnv->UCharErrorBufferLength>0) {
-        UChar *overflow;
+        char16_t *overflow;
 
         overflow=cnv->UCharErrorBuffer;
         i=0;
@@ -1949,7 +1949,7 @@ ucnv_getNextUChar(UConverter *cnv,
             }
         }
 
-        /* convert to one UChar in buffer[0], or handle getNextUChar() errors */
+        /* convert to one char16_t in buffer[0], or handle getNextUChar() errors */
         _toUnicodeWithCallback(&args, err);
 
         if(*err==U_BUFFER_OVERFLOW_ERROR) {
@@ -1960,7 +1960,7 @@ ucnv_getNextUChar(UConverter *cnv,
         length=(int32_t)(args.target-buffer);
     } else {
         /* write the lead surrogate from the overflow buffer */
-        buffer[0]=(UChar)c;
+        buffer[0]=(char16_t)c;
         args.target=buffer+1;
         i=0;
         length=1;
@@ -1982,7 +1982,7 @@ ucnv_getNextUChar(UConverter *cnv,
             /* consume c=buffer[0], done */
         } else {
             /* got a lead surrogate, see if a trail surrogate follows */
-            UChar c2;
+            char16_t c2;
 
             if(cnv->UCharErrorBufferLength>0) {
                 /* got overflow output from the conversion */
@@ -2045,13 +2045,13 @@ U_CAPI void U_EXPORT2
 ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
                char **target, const char *targetLimit,
                const char **source, const char *sourceLimit,
-               UChar *pivotStart, UChar **pivotSource,
-               UChar **pivotTarget, const UChar *pivotLimit,
+               char16_t *pivotStart, char16_t **pivotSource,
+               char16_t **pivotTarget, const char16_t *pivotLimit,
                UBool reset, UBool flush,
                UErrorCode *pErrorCode) {
-    UChar pivotBuffer[CHUNK_SIZE];
-    const UChar *myPivotSource;
-    UChar *myPivotTarget;
+    char16_t pivotBuffer[CHUNK_SIZE];
+    const char16_t *myPivotSource;
+    char16_t *myPivotTarget;
     const char *s;
     char *t;
 
@@ -2100,7 +2100,7 @@ ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
 
         /* use the stack pivot buffer */
         myPivotSource=myPivotTarget=pivotStart=pivotBuffer;
-        pivotSource=(UChar **)&myPivotSource;
+        pivotSource=(char16_t **)&myPivotSource;
         pivotTarget=&myPivotTarget;
         pivotLimit=pivotBuffer+CHUNK_SIZE;
     } else if(  pivotStart>=pivotLimit ||
@@ -2229,7 +2229,7 @@ ucnv_convertEx(UConverter *targetCnv, UConverter *sourceCnv,
             _fromUnicodeWithCallback(&fromUArgs, pErrorCode);
             if(U_FAILURE(*pErrorCode)) {
                 /* target overflow, or conversion error */
-                *pivotSource=(UChar *)fromUArgs.source;
+                *pivotSource=(char16_t *)fromUArgs.source;
                 break;
             }
 
@@ -2405,8 +2405,8 @@ ucnv_internalConvert(UConverter *outConverter, UConverter *inConverter,
                      char *target, int32_t targetCapacity,
                      const char *source, int32_t sourceLength,
                      UErrorCode *pErrorCode) {
-    UChar pivotBuffer[CHUNK_SIZE];
-    UChar *pivot, *pivot2;
+    char16_t pivotBuffer[CHUNK_SIZE];
+    char16_t *pivot, *pivot2;
 
     char *myTarget;
     const char *sourceLimit;
@@ -2660,11 +2660,11 @@ static const UAmbiguousConverter *ucnv_getAmbiguous(const UConverter *cnv)
 
 U_CAPI void  U_EXPORT2
 ucnv_fixFileSeparator(const UConverter *cnv, 
-                      UChar* source, 
+                      char16_t* source,
                       int32_t sourceLength) {
     const UAmbiguousConverter *a;
     int32_t i;
-    UChar variant5c;
+    char16_t variant5c;
 
     if(cnv==nullptr || source==nullptr || sourceLength<=0 || (a=ucnv_getAmbiguous(cnv))==nullptr)
     {
@@ -2724,7 +2724,7 @@ ucnv_getInvalidChars (const UConverter * converter,
 
 U_CAPI void  U_EXPORT2
 ucnv_getInvalidUChars (const UConverter * converter,
-                       UChar *errChars,
+                       char16_t *errChars,
                        int8_t * len,
                        UErrorCode * err)
 {
index b6c648586d80705a13f0d48ea9e8e53b94d7d888..5989c1b405a7895adfb09aba15adeece51e3da75 100644 (file)
@@ -1259,7 +1259,7 @@ T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverterToUnicodeArgs* args,
                                                            UErrorCode* err){
     const char* mySourceLimit, *realSourceLimit;
     const char* sourceStart;
-    const UChar* myTargetStart;
+    const char16_t* myTargetStart;
     UConverter* saveThis;
     UConverterDataISO2022* myData;
     int8_t length;
@@ -1667,8 +1667,8 @@ UConverter_fromUnicode_ISO_2022_JP_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args
     ISO2022State *pFromU2022State;
     uint8_t *target = (uint8_t *) args->target;
     const uint8_t *targetLimit = (const uint8_t *) args->targetLimit;
-    const UChar* source = args->source;
-    const UChar* sourceLimit = args->sourceLimit;
+    const char16_t* source = args->source;
+    const char16_t* sourceLimit = args->sourceLimit;
     int32_t* offsets = args->offsets;
     UChar32 sourceChar;
     char buffer[8];
@@ -1703,7 +1703,7 @@ getTrail:
                     /*look ahead to find the trail surrogate*/
                     if(source < sourceLimit) {
                         /* test the following code unit */
-                        UChar trail=(UChar) *source;
+                        char16_t trail=(char16_t) *source;
                         if(U16_IS_TRAIL(trail)) {
                             source++;
                             sourceChar=U16_GET_SUPPLEMENTARY(sourceChar, trail);
@@ -2082,7 +2082,7 @@ UConverter_toUnicode_ISO_2022_JP_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                                                UErrorCode* err){
     char tempBuf[2];
     const char *mySource = (char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const char *mySourceLimit = args->sourceLimit;
     uint32_t targetUniChar = 0x0000;
     uint32_t mySourceChar = 0x0000;
@@ -2281,25 +2281,25 @@ getTrailByte:
                 if(args->offsets){
                     args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                 }
-                *(myTarget++)=(UChar)targetUniChar;
+                *(myTarget++)=(char16_t)targetUniChar;
             }
             else if(targetUniChar > missingCharMarker){
                 /* disassemble the surrogate pair and write to output*/
                 targetUniChar-=0x0010000;
-                *myTarget = (UChar)(0xd800+(UChar)(targetUniChar>>10));
+                *myTarget = (char16_t)(0xd800+(char16_t)(targetUniChar>>10));
                 if(args->offsets){
                     args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                 }
                 ++myTarget;
                 if(myTarget< args->targetLimit){
-                    *myTarget = (UChar)(0xdc00+(UChar)(targetUniChar&0x3ff));
+                    *myTarget = (char16_t)(0xdc00+(char16_t)(targetUniChar&0x3ff));
                     if(args->offsets){
                         args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                     }
                     ++myTarget;
                 }else{
                     args->converter->UCharErrorBuffer[args->converter->UCharErrorBufferLength++]=
-                                    (UChar)(0xdc00+(UChar)(targetUniChar&0x3ff));
+                                    (char16_t)(0xdc00+(char16_t)(targetUniChar&0x3ff));
                 }
 
             }
@@ -2356,8 +2356,8 @@ UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterFromUnicodeArgs*
 static void U_CALLCONV
 UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args, UErrorCode* err){
 
-    const UChar *source = args->source;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *source = args->source;
+    const char16_t *sourceLimit = args->sourceLimit;
     unsigned char *target = (unsigned char *) args->target;
     unsigned char *targetLimit = (unsigned char *) args->targetLimit;
     int32_t* offsets = args->offsets;
@@ -2480,7 +2480,7 @@ getTrail:
                         /*look ahead to find the trail surrogate*/
                         if(source <  sourceLimit) {
                             /* test the following code unit */
-                            UChar trail=(UChar) *source;
+                            char16_t trail=(char16_t) *source;
                             if(U16_IS_TRAIL(trail)) {
                                 source++;
                                 sourceChar=U16_GET_SUPPLEMENTARY(sourceChar, trail);
@@ -2627,7 +2627,7 @@ UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterToUnicodeArgs *args
             if(args->offsets != nullptr && sourceStart != args->source) {
                 /* update offsets to base them on the actual start of the input */
                 int32_t *offsets = args->offsets;
-                UChar *target = args->target;
+                char16_t *target = args->target;
                 int32_t delta = (int32_t)(args->source - sourceStart);
                 while(target < subArgs.target) {
                     if(*offsets >= 0) {
@@ -2675,10 +2675,10 @@ UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                                                             UErrorCode* err){
     char tempBuf[2];
     const char *mySource = ( char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const char *mySourceLimit = args->sourceLimit;
     UChar32 targetUniChar = 0x0000;
-    UChar mySourceChar = 0x0000;
+    char16_t mySourceChar = 0x0000;
     UConverterDataISO2022* myData;
     UConverterSharedData* sharedData ;
     UBool useFallback;
@@ -2772,7 +2772,7 @@ getTrailByte:
                         /* report a pair of illegal bytes if the second byte is not a DBCS starter */
                         ++mySource;
                         /* add another bit so that the code below writes 2 bytes in case of error */
-                        mySourceChar = static_cast<UChar>(0x10000 | (mySourceChar << 8) | trailByte);
+                        mySourceChar = static_cast<char16_t>(0x10000 | (mySourceChar << 8) | trailByte);
                     }
                 } else {
                     args->converter->toUBytes[0] = (uint8_t)mySourceChar;
@@ -2789,7 +2789,7 @@ getTrailByte:
                 if(args->offsets) {
                     args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                 }
-                *(myTarget++)=(UChar)targetUniChar;
+                *(myTarget++)=(char16_t)targetUniChar;
             }
             else {
                 /* Call the callback function*/
@@ -2919,8 +2919,8 @@ UConverter_fromUnicode_ISO_2022_CN_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args
     ISO2022State *pFromU2022State;
     uint8_t *target = (uint8_t *) args->target;
     const uint8_t *targetLimit = (const uint8_t *) args->targetLimit;
-    const UChar* source = args->source;
-    const UChar* sourceLimit = args->sourceLimit;
+    const char16_t* source = args->source;
+    const char16_t* sourceLimit = args->sourceLimit;
     int32_t* offsets = args->offsets;
     UChar32 sourceChar;
     char buffer[8];
@@ -2952,7 +2952,7 @@ getTrail:
                     /*look ahead to find the trail surrogate*/
                     if(source < sourceLimit) {
                         /* test the following code unit */
-                        UChar trail=(UChar) *source;
+                        char16_t trail=(char16_t) *source;
                         if(U16_IS_TRAIL(trail)) {
                             source++;
                             sourceChar=U16_GET_SUPPLEMENTARY(sourceChar, trail);
@@ -3268,7 +3268,7 @@ UConverter_toUnicode_ISO_2022_CN_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                                                UErrorCode* err){
     char tempBuf[3];
     const char *mySource = (char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const char *mySourceLimit = args->sourceLimit;
     uint32_t targetUniChar = 0x0000;
     uint32_t mySourceChar = 0x0000;
@@ -3417,7 +3417,7 @@ getTrailByte:
                 }
                 else{
                     if(mySourceChar <= 0x7f) {
-                        targetUniChar = (UChar) mySourceChar;
+                        targetUniChar = (char16_t) mySourceChar;
                     }
                 }
                 break;
@@ -3426,25 +3426,25 @@ getTrailByte:
                 if(args->offsets){
                     args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                 }
-                *(myTarget++)=(UChar)targetUniChar;
+                *(myTarget++)=(char16_t)targetUniChar;
             }
             else if(targetUniChar > missingCharMarker){
                 /* disassemble the surrogate pair and write to output*/
                 targetUniChar-=0x0010000;
-                *myTarget = (UChar)(0xd800+(UChar)(targetUniChar>>10));
+                *myTarget = (char16_t)(0xd800+(char16_t)(targetUniChar>>10));
                 if(args->offsets){
                     args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                 }
                 ++myTarget;
                 if(myTarget< args->targetLimit){
-                    *myTarget = (UChar)(0xdc00+(UChar)(targetUniChar&0x3ff));
+                    *myTarget = (char16_t)(0xdc00+(char16_t)(targetUniChar&0x3ff));
                     if(args->offsets){
                         args->offsets[myTarget - args->target] = (int32_t)(mySource - args->source - (mySourceChar <= 0xff ? 1 : 2));
                     }
                     ++myTarget;
                 }else{
                     args->converter->UCharErrorBuffer[args->converter->UCharErrorBufferLength++]=
-                                    (UChar)(0xdc00+(UChar)(targetUniChar&0x3ff));
+                                    (char16_t)(0xdc00+(char16_t)(targetUniChar&0x3ff));
                 }
 
             }
@@ -3805,7 +3805,7 @@ static const UConverterStaticData _ISO2022StaticData={
     UCNV_IBM,
     UCNV_ISO_2022,
     1,
-    3, /* max 3 bytes per UChar from UTF-8 (4 bytes from surrogate _pair_) */
+    3, /* max 3 bytes per char16_t from UTF-8 (4 bytes from surrogate _pair_) */
     { 0x1a, 0, 0, 0 },
     1,
     false,
@@ -3850,7 +3850,7 @@ static const UConverterStaticData _ISO2022JPStaticData={
     UCNV_IBM,
     UCNV_ISO_2022,
     1,
-    6, /* max 6 bytes per UChar: 4-byte escape sequence + DBCS */
+    6, /* max 6 bytes per char16_t: 4-byte escape sequence + DBCS */
     { 0x1a, 0, 0, 0 },
     1,
     false,
@@ -3901,7 +3901,7 @@ static const UConverterStaticData _ISO2022KRStaticData={
     UCNV_IBM,
     UCNV_ISO_2022,
     1,
-    8, /* max 8 bytes per UChar */
+    8, /* max 8 bytes per char16_t */
     { 0x1a, 0, 0, 0 },
     1,
     false,
@@ -3952,7 +3952,7 @@ static const UConverterStaticData _ISO2022CNStaticData={
     UCNV_IBM,
     UCNV_ISO_2022,
     1,
-    8, /* max 8 bytes per UChar: 4-byte CNS designator + 2 bytes for SS2/SS3 + DBCS */
+    8, /* max 8 bytes per char16_t: 4-byte CNS designator + 2 bytes for SS2/SS3 + DBCS */
     { 0x1a, 0, 0, 0 },
     1,
     false,
index afd1e5eae517a58d7025a340367822be03323a46..dd559270dd7c8afecb01cc75a7ac7a0768ed894b 100644 (file)
@@ -54,8 +54,8 @@ ucnv_cbFromUWriteBytes (UConverterFromUnicodeArgs *args,
 
 U_CAPI void  U_EXPORT2
 ucnv_cbFromUWriteUChars(UConverterFromUnicodeArgs *args,
-                             const UChar** source,
-                             const UChar*  sourceLimit,
+                             const char16_t** source,
+                             const char16_t*  sourceLimit,
                              int32_t offsetIndex,
                              UErrorCode * err)
 {
@@ -200,7 +200,7 @@ ucnv_cbFromUWriteSub (UConverterFromUnicodeArgs *args,
          * and will not recurse.
          * At worst we should get a U_BUFFER_OVERFLOW_ERROR.
          */
-        const UChar *source = (const UChar *)converter->subChars;
+        const char16_t *source = (const char16_t *)converter->subChars;
         ucnv_cbFromUWriteUChars(args, &source, source - length, offsetIndex, err);
         return;
     }
@@ -226,7 +226,7 @@ ucnv_cbFromUWriteSub (UConverterFromUnicodeArgs *args,
 
 U_CAPI void  U_EXPORT2
 ucnv_cbToUWriteUChars (UConverterToUnicodeArgs *args,
-                            const UChar* source,
+                            const char16_t* source,
                             int32_t length,
                             int32_t offsetIndex,
                             UErrorCode * err)
@@ -248,7 +248,7 @@ ucnv_cbToUWriteSub (UConverterToUnicodeArgs *args,
                          int32_t offsetIndex,
                        UErrorCode * err)
 {
-    static const UChar kSubstituteChar1 = 0x1A, kSubstituteChar = 0xFFFD;
+    static const char16_t kSubstituteChar1 = 0x1A, kSubstituteChar = 0xFFFD;
 
     /* could optimize this case, just one uchar */
     if(args->converter->invalidCharLength == 1 && args->converter->subChar1 != 0) {
index 93b096b437f2841e5b9e8042c6629960692f55fb..ffff9429ad9e6f803846ea32341f55d0940d54bf 100644 (file)
@@ -93,12 +93,12 @@ ucnv_fromUWriteBytes(UConverter *cnv,
 
 U_CFUNC void
 ucnv_toUWriteUChars(UConverter *cnv,
-                    const UChar *uchars, int32_t length,
-                    UChar **target, const UChar *targetLimit,
+                    const char16_t *uchars, int32_t length,
+                    char16_t **target, const char16_t *targetLimit,
                     int32_t **offsets,
                     int32_t sourceIndex,
                     UErrorCode *pErrorCode) {
-    UChar *t=*target;
+    char16_t *t=*target;
     int32_t *o;
 
     /* write UChars */
@@ -134,24 +134,24 @@ ucnv_toUWriteUChars(UConverter *cnv,
 U_CFUNC void
 ucnv_toUWriteCodePoint(UConverter *cnv,
                        UChar32 c,
-                       UChar **target, const UChar *targetLimit,
+                       char16_t **target, const char16_t *targetLimit,
                        int32_t **offsets,
                        int32_t sourceIndex,
                        UErrorCode *pErrorCode) {
-    UChar *t;
+    char16_t *t;
     int32_t *o;
 
     t=*target;
 
     if(t<targetLimit) {
         if(c<=0xffff) {
-            *t++=(UChar)c;
+            *t++=(char16_t)c;
             c=U_SENTINEL;
         } else /* c is a supplementary code point */ {
             *t++=U16_LEAD(c);
             c=U16_TRAIL(c);
             if(t<targetLimit) {
-                *t++=(UChar)c;
+                *t++=(char16_t)c;
                 c=U_SENTINEL;
             }
         }
index 3cb333dc72559b074ba56d2873f12c2591de731f..46f30e5ece6d8cacb8bdaa6245e6d69d014d43ed 100644 (file)
@@ -336,8 +336,8 @@ UConverter_fromUnicode_CompoundText_OFFSETS(UConverterFromUnicodeArgs* args, UEr
     UConverter *cnv = args->converter;
     uint8_t *target = (uint8_t *) args->target;
     const uint8_t *targetLimit = (const uint8_t *) args->targetLimit;
-    const UChar* source = args->source;
-    const UChar* sourceLimit = args->sourceLimit;
+    const char16_t* source = args->source;
+    const char16_t* sourceLimit = args->sourceLimit;
     /* int32_t* offsets = args->offsets; */
     UChar32 sourceChar;
     UBool useFallback = cnv->useFallback;
@@ -368,7 +368,7 @@ getTrail:
                     /*look ahead to find the trail surrogate*/
                     if(source < sourceLimit) {
                         /* test the following code unit */
-                        UChar trail=(UChar) *source;
+                        char16_t trail=(char16_t) *source;
                         if(U16_IS_TRAIL(trail)) {
                             source++;
                             sourceChar=U16_GET_SUPPLEMENTARY(sourceChar, trail);
@@ -467,7 +467,7 @@ static void U_CALLCONV
 UConverter_toUnicode_CompoundText_OFFSETS(UConverterToUnicodeArgs *args,
                                                UErrorCode* err){
     const char *mySource = (char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const char *mySourceLimit = args->sourceLimit;
     const char *tmpSourceLimit = mySourceLimit;
     uint32_t mySourceChar = 0x0000;
index 4201f3395dae84fe4d923e3204b3272bdcf861a5..761c442632f1ef39553bd28ada994295dd27cd1c 100644 (file)
@@ -91,7 +91,7 @@ U_CAPI void    U_EXPORT2
 UCNV_FROM_U_CALLBACK_STOP (
                   const void *context,
                   UConverterFromUnicodeArgs *fromUArgs,
-                  const UChar* codeUnits,
+                  const char16_t* codeUnits,
                   int32_t length,
                   UChar32 codePoint,
                   UConverterCallbackReason reason,
@@ -132,7 +132,7 @@ U_CAPI void    U_EXPORT2
 UCNV_FROM_U_CALLBACK_SKIP (                  
                   const void *context,
                   UConverterFromUnicodeArgs *fromUArgs,
-                  const UChar* codeUnits,
+                  const char16_t* codeUnits,
                   int32_t length,
                   UChar32 codePoint,
                   UConverterCallbackReason reason,
@@ -163,7 +163,7 @@ U_CAPI void    U_EXPORT2
 UCNV_FROM_U_CALLBACK_SUBSTITUTE (
                   const void *context,
                   UConverterFromUnicodeArgs *fromArgs,
-                  const UChar* codeUnits,
+                  const char16_t* codeUnits,
                   int32_t length,
                   UChar32 codePoint,
                   UConverterCallbackReason reason,
@@ -199,18 +199,18 @@ U_CAPI void    U_EXPORT2
 UCNV_FROM_U_CALLBACK_ESCAPE (
                          const void *context,
                          UConverterFromUnicodeArgs *fromArgs,
-                         const UChar *codeUnits,
+                         const char16_t *codeUnits,
                          int32_t length,
                          UChar32 codePoint,
                          UConverterCallbackReason reason,
                          UErrorCode * err)
 {
 
-  UChar valueString[VALUE_STRING_LENGTH];
+  char16_t valueString[VALUE_STRING_LENGTH];
   int32_t valueStringLength = 0;
   int32_t i = 0;
 
-  const UChar *myValueSource = nullptr;
+  const char16_t *myValueSource = nullptr;
   UErrorCode err2 = U_ZERO_ERROR;
   UConverterFromUCallback original = nullptr;
   const void *originalContext;
@@ -247,8 +247,8 @@ UCNV_FROM_U_CALLBACK_ESCAPE (
   { 
       while (i < length)
       {
-        valueString[valueStringLength++] = (UChar) UNICODE_PERCENT_SIGN_CODEPOINT;  /* adding % */
-        valueString[valueStringLength++] = (UChar) UNICODE_U_CODEPOINT; /* adding U */
+        valueString[valueStringLength++] = (char16_t) UNICODE_PERCENT_SIGN_CODEPOINT;  /* adding % */
+        valueString[valueStringLength++] = (char16_t) UNICODE_U_CODEPOINT; /* adding U */
         valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[i++], 16, 4);
       }
   }
@@ -259,78 +259,78 @@ UCNV_FROM_U_CALLBACK_ESCAPE (
       case UCNV_PRV_ESCAPE_JAVA:
           while (i < length)
           {
-              valueString[valueStringLength++] = (UChar) UNICODE_RS_CODEPOINT;    /* adding \ */
-              valueString[valueStringLength++] = (UChar) UNICODE_U_LOW_CODEPOINT; /* adding u */
+              valueString[valueStringLength++] = (char16_t) UNICODE_RS_CODEPOINT;    /* adding \ */
+              valueString[valueStringLength++] = (char16_t) UNICODE_U_LOW_CODEPOINT; /* adding u */
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[i++], 16, 4);
           }
           break;
 
       case UCNV_PRV_ESCAPE_C:
-          valueString[valueStringLength++] = (UChar) UNICODE_RS_CODEPOINT;    /* adding \ */
+          valueString[valueStringLength++] = (char16_t) UNICODE_RS_CODEPOINT;    /* adding \ */
 
           if(length==2){
-              valueString[valueStringLength++] = (UChar) UNICODE_U_CODEPOINT; /* adding U */
+              valueString[valueStringLength++] = (char16_t) UNICODE_U_CODEPOINT; /* adding U */
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, codePoint, 16, 8);
 
           }
           else{
-              valueString[valueStringLength++] = (UChar) UNICODE_U_LOW_CODEPOINT; /* adding u */
+              valueString[valueStringLength++] = (char16_t) UNICODE_U_LOW_CODEPOINT; /* adding u */
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[0], 16, 4);
           }
           break;
 
       case UCNV_PRV_ESCAPE_XML_DEC:
 
-          valueString[valueStringLength++] = (UChar) UNICODE_AMP_CODEPOINT;   /* adding & */
-          valueString[valueStringLength++] = (UChar) UNICODE_HASH_CODEPOINT;  /* adding # */
+          valueString[valueStringLength++] = (char16_t) UNICODE_AMP_CODEPOINT;   /* adding & */
+          valueString[valueStringLength++] = (char16_t) UNICODE_HASH_CODEPOINT;  /* adding # */
           if(length==2){
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, codePoint, 10, 0);
           }
           else{
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[0], 10, 0);
           }
-          valueString[valueStringLength++] = (UChar) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
+          valueString[valueStringLength++] = (char16_t) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
           break;
 
       case UCNV_PRV_ESCAPE_XML_HEX:
 
-          valueString[valueStringLength++] = (UChar) UNICODE_AMP_CODEPOINT;   /* adding & */
-          valueString[valueStringLength++] = (UChar) UNICODE_HASH_CODEPOINT;  /* adding # */
-          valueString[valueStringLength++] = (UChar) UNICODE_X_LOW_CODEPOINT; /* adding x */
+          valueString[valueStringLength++] = (char16_t) UNICODE_AMP_CODEPOINT;   /* adding & */
+          valueString[valueStringLength++] = (char16_t) UNICODE_HASH_CODEPOINT;  /* adding # */
+          valueString[valueStringLength++] = (char16_t) UNICODE_X_LOW_CODEPOINT; /* adding x */
           if(length==2){
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, codePoint, 16, 0);
           }
           else{
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[0], 16, 0);
           }
-          valueString[valueStringLength++] = (UChar) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
+          valueString[valueStringLength++] = (char16_t) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
           break;
 
       case UCNV_PRV_ESCAPE_UNICODE:
-          valueString[valueStringLength++] = (UChar) UNICODE_LEFT_CURLY_CODEPOINT;    /* adding { */
-          valueString[valueStringLength++] = (UChar) UNICODE_U_CODEPOINT;    /* adding U */
-          valueString[valueStringLength++] = (UChar) UNICODE_PLUS_CODEPOINT; /* adding + */
+          valueString[valueStringLength++] = (char16_t) UNICODE_LEFT_CURLY_CODEPOINT;    /* adding { */
+          valueString[valueStringLength++] = (char16_t) UNICODE_U_CODEPOINT;    /* adding U */
+          valueString[valueStringLength++] = (char16_t) UNICODE_PLUS_CODEPOINT; /* adding + */
           if (length == 2) {
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, codePoint, 16, 4);
           } else {
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[0], 16, 4);
           }
-          valueString[valueStringLength++] = (UChar) UNICODE_RIGHT_CURLY_CODEPOINT;    /* adding } */
+          valueString[valueStringLength++] = (char16_t) UNICODE_RIGHT_CURLY_CODEPOINT;    /* adding } */
           break;
 
       case UCNV_PRV_ESCAPE_CSS2:
-          valueString[valueStringLength++] = (UChar) UNICODE_RS_CODEPOINT;    /* adding \ */
+          valueString[valueStringLength++] = (char16_t) UNICODE_RS_CODEPOINT;    /* adding \ */
           valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, codePoint, 16, 0);
           /* Always add space character, because the next character might be whitespace,
              which would erroneously be considered the termination of the escape sequence. */
-          valueString[valueStringLength++] = (UChar) UNICODE_SPACE_CODEPOINT;
+          valueString[valueStringLength++] = (char16_t) UNICODE_SPACE_CODEPOINT;
           break;
 
       default:
           while (i < length)
           {
-              valueString[valueStringLength++] = (UChar) UNICODE_PERCENT_SIGN_CODEPOINT;  /* adding % */
-              valueString[valueStringLength++] = (UChar) UNICODE_U_CODEPOINT;             /* adding U */
+              valueString[valueStringLength++] = (char16_t) UNICODE_PERCENT_SIGN_CODEPOINT;  /* adding % */
+              valueString[valueStringLength++] = (char16_t) UNICODE_U_CODEPOINT;             /* adding U */
               valueStringLength += uprv_itou (valueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint16_t)codeUnits[i++], 16, 4);
           }
       }
@@ -417,7 +417,7 @@ UCNV_TO_U_CALLBACK_ESCAPE (
                  UConverterCallbackReason reason,
                  UErrorCode * err)
 {
-    UChar uniValueString[VALUE_STRING_LENGTH];
+    char16_t uniValueString[VALUE_STRING_LENGTH];
     int32_t valueStringLength = 0;
     int32_t i = 0;
 
@@ -430,8 +430,8 @@ UCNV_TO_U_CALLBACK_ESCAPE (
     {    
         while (i < length)
         {
-            uniValueString[valueStringLength++] = (UChar) UNICODE_PERCENT_SIGN_CODEPOINT; /* adding % */
-            uniValueString[valueStringLength++] = (UChar) UNICODE_X_CODEPOINT;    /* adding X */
+            uniValueString[valueStringLength++] = (char16_t) UNICODE_PERCENT_SIGN_CODEPOINT; /* adding % */
+            uniValueString[valueStringLength++] = (char16_t) UNICODE_X_CODEPOINT;    /* adding X */
             valueStringLength += uprv_itou (uniValueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint8_t) codeUnits[i++], 16, 2);
         }
     }
@@ -442,36 +442,36 @@ UCNV_TO_U_CALLBACK_ESCAPE (
         case UCNV_PRV_ESCAPE_XML_DEC:
             while (i < length)
             {
-                uniValueString[valueStringLength++] = (UChar) UNICODE_AMP_CODEPOINT;   /* adding & */
-                uniValueString[valueStringLength++] = (UChar) UNICODE_HASH_CODEPOINT;  /* adding # */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_AMP_CODEPOINT;   /* adding & */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_HASH_CODEPOINT;  /* adding # */
                 valueStringLength += uprv_itou (uniValueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint8_t)codeUnits[i++], 10, 0);
-                uniValueString[valueStringLength++] = (UChar) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
             }
             break;
 
         case UCNV_PRV_ESCAPE_XML_HEX:
             while (i < length)
             {
-                uniValueString[valueStringLength++] = (UChar) UNICODE_AMP_CODEPOINT;   /* adding & */
-                uniValueString[valueStringLength++] = (UChar) UNICODE_HASH_CODEPOINT;  /* adding # */
-                uniValueString[valueStringLength++] = (UChar) UNICODE_X_LOW_CODEPOINT; /* adding x */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_AMP_CODEPOINT;   /* adding & */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_HASH_CODEPOINT;  /* adding # */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_X_LOW_CODEPOINT; /* adding x */
                 valueStringLength += uprv_itou (uniValueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint8_t)codeUnits[i++], 16, 0);
-                uniValueString[valueStringLength++] = (UChar) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_SEMICOLON_CODEPOINT; /* adding ; */
             }
             break;
         case UCNV_PRV_ESCAPE_C:
             while (i < length)
             {
-                uniValueString[valueStringLength++] = (UChar) UNICODE_RS_CODEPOINT;    /* adding \ */
-                uniValueString[valueStringLength++] = (UChar) UNICODE_X_LOW_CODEPOINT; /* adding x */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_RS_CODEPOINT;    /* adding \ */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_X_LOW_CODEPOINT; /* adding x */
                 valueStringLength += uprv_itou (uniValueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint8_t)codeUnits[i++], 16, 2);
             }
             break;
         default:
             while (i < length)
             {
-                uniValueString[valueStringLength++] = (UChar) UNICODE_PERCENT_SIGN_CODEPOINT; /* adding % */
-                uniValueString[valueStringLength++] = (UChar) UNICODE_X_CODEPOINT;    /* adding X */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_PERCENT_SIGN_CODEPOINT; /* adding % */
+                uniValueString[valueStringLength++] = (char16_t) UNICODE_X_CODEPOINT;    /* adding X */
                 uprv_itou (uniValueString + valueStringLength, VALUE_STRING_LENGTH - valueStringLength, (uint8_t) codeUnits[i++], 16, 2);
                 valueStringLength += 2;
             }
index 558bdce1e34a6ce91d463c1333181e983e1d8b4d..10d00a62c2ce06e7cc047294f8466b67afb870a9 100644 (file)
@@ -198,7 +198,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
             }
         }
 
-        /* search for the current UChar */
+        /* search for the current char16_t */
         value=ucnv_extFindToU(toUSection, length, b);
         if(value==0) {
             /* no match here, stop with the longest match so far */
@@ -236,7 +236,7 @@ ucnv_extMatchToU(const int32_t *cx, int8_t sisoState,
 static inline void
 ucnv_extWriteToU(UConverter *cnv, const int32_t *cx,
                  uint32_t value,
-                 UChar **target, const UChar *targetLimit,
+                 char16_t **target, const char16_t *targetLimit,
                  int32_t **offsets, int32_t srcIndex,
                  UErrorCode *pErrorCode) {
     /* output the result */
@@ -251,7 +251,7 @@ ucnv_extWriteToU(UConverter *cnv, const int32_t *cx,
         /* output a string - with correct data we have resultLength>0 */
         ucnv_toUWriteUChars(
             cnv,
-            UCNV_EXT_ARRAY(cx, UCNV_EXT_TO_U_UCHARS_INDEX, UChar)+
+            UCNV_EXT_ARRAY(cx, UCNV_EXT_TO_U_UCHARS_INDEX, char16_t)+
                 UCNV_EXT_TO_U_GET_INDEX(value),
             UCNV_EXT_TO_U_GET_LENGTH(value),
             target, targetLimit,
@@ -279,7 +279,7 @@ U_CFUNC UBool
 ucnv_extInitialMatchToU(UConverter *cnv, const int32_t *cx,
                         int32_t firstLength,
                         const char **src, const char *srcLimit,
-                        UChar **target, const UChar *targetLimit,
+                        char16_t **target, const char16_t *targetLimit,
                         int32_t **offsets, int32_t srcIndex,
                         UBool flush,
                         UErrorCode *pErrorCode) {
@@ -459,10 +459,10 @@ extFromUUseMapping(UBool useFallback, uint32_t value, UChar32 firstCP) {
 }
 
 /*
- * @return index of the UChar, if found; else <0
+ * @return index of the char16_t, if found; else <0
  */
 static inline int32_t
-ucnv_extFindFromU(const UChar *fromUSection, int32_t length, UChar u) {
+ucnv_extFindFromU(const char16_t *fromUSection, int32_t length, char16_t u) {
     int32_t i, start, limit;
 
     /* binary search */
@@ -530,19 +530,19 @@ ucnv_extFindFromU(const UChar *fromUSection, int32_t length, UChar u) {
 static int32_t
 ucnv_extMatchFromU(const int32_t *cx,
                    UChar32 firstCP,
-                   const UChar *pre, int32_t preLength,
-                   const UChar *src, int32_t srcLength,
+                   const char16_t *pre, int32_t preLength,
+                   const char16_t *src, int32_t srcLength,
                    uint32_t *pMatchValue,
                    UBool useFallback, UBool flush) {
     const uint16_t *stage12, *stage3;
     const uint32_t *stage3b;
 
-    const UChar *fromUTableUChars, *fromUSectionUChars;
+    const char16_t *fromUTableUChars, *fromUSectionUChars;
     const uint32_t *fromUTableValues, *fromUSectionValues;
 
     uint32_t value, matchValue;
     int32_t i, j, idx, length, matchLength;
-    UChar c;
+    char16_t c;
 
     if(cx==nullptr) {
         return 0; /* no extension data, no match */
@@ -575,7 +575,7 @@ ucnv_extMatchFromU(const int32_t *cx,
         idx=(int32_t)UCNV_EXT_FROM_U_GET_PARTIAL_INDEX(value);
 
         /* initialize */
-        fromUTableUChars=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_UCHARS_INDEX, UChar);
+        fromUTableUChars=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_UCHARS_INDEX, char16_t);
         fromUTableValues=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_VALUES_INDEX, uint32_t);
 
         matchValue=0;
@@ -618,7 +618,7 @@ ucnv_extMatchFromU(const int32_t *cx,
                 }
             }
 
-            /* search for the current UChar */
+            /* search for the current char16_t */
             idx=ucnv_extFindFromU(fromUSectionUChars, length, c);
             if(idx<0) {
                 /* no match here, stop with the longest match so far */
@@ -749,7 +749,7 @@ ucnv_extWriteFromU(UConverter *cnv, const int32_t *cx,
 U_CFUNC UBool
 ucnv_extInitialMatchFromU(UConverter *cnv, const int32_t *cx,
                           UChar32 cp,
-                          const UChar **src, const UChar *srcLimit,
+                          const char16_t **src, const char16_t *srcLimit,
                           char **target, const char *targetLimit,
                           int32_t **offsets, int32_t srcIndex,
                           UBool flush,
@@ -781,7 +781,7 @@ ucnv_extInitialMatchFromU(UConverter *cnv, const int32_t *cx,
         return true;
     } else if(match<0) {
         /* save state for partial match */
-        const UChar *s;
+        const char16_t *s;
         int32_t j;
 
         /* copy the first code point */
@@ -901,7 +901,7 @@ ucnv_extContinueMatchFromU(UConverter *cnv,
                            pErrorCode);
     } else if(match<0) {
         /* save state for partial match */
-        const UChar *s;
+        const char16_t *s;
         int32_t j;
 
         /* just _append_ the newly consumed input to preFromU[] */
@@ -981,16 +981,16 @@ ucnv_extGetUnicodeSetString(const UConverterSharedData *sharedData,
                             UConverterUnicodeSet which,
                             int32_t minLength,
                             UChar32 firstCP,
-                            UChar s[UCNV_EXT_MAX_UCHARS], int32_t length,
+                            char16_t s[UCNV_EXT_MAX_UCHARS], int32_t length,
                             int32_t sectionIndex,
                             UErrorCode *pErrorCode) {
-    const UChar *fromUSectionUChars;
+    const char16_t *fromUSectionUChars;
     const uint32_t *fromUSectionValues;
 
     uint32_t value;
     int32_t i, count;
 
-    fromUSectionUChars=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_UCHARS_INDEX, UChar)+sectionIndex;
+    fromUSectionUChars=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_UCHARS_INDEX, char16_t)+sectionIndex;
     fromUSectionValues=UCNV_EXT_ARRAY(cx, UCNV_EXT_FROM_U_VALUES_INDEX, uint32_t)+sectionIndex;
 
     /* read first pair of the section */
@@ -1039,7 +1039,7 @@ ucnv_extGetUnicodeSet(const UConverterSharedData *sharedData,
     uint32_t value;
     int32_t st1, stage1Length, st2, st3, minLength;
 
-    UChar s[UCNV_EXT_MAX_UCHARS];
+    char16_t s[UCNV_EXT_MAX_UCHARS];
     UChar32 c;
     int32_t length;
 
index 03af75f032ff0bc16c35e3458fa517901d1c1302..ab14a119efb8e8dd038397f0efa263b6e3e8feb4 100644 (file)
@@ -298,8 +298,8 @@ ambiguous mappings: */
 
 static const struct _UniLMBCSGrpMap  
 {
-   const UChar uniStartRange;
-   const UChar uniEndRange;
+   const char16_t uniStartRange;
+   const char16_t uniEndRange;
    const ulmbcs_byte_t  GrpType;
 } UniLMBCSGrpMap[]
 =
@@ -445,7 +445,7 @@ static const struct _UniLMBCSGrpMap
 };
    
 static ulmbcs_byte_t 
-FindLMBCSUniRange(UChar uniChar)
+FindLMBCSUniRange(char16_t uniChar)
 {
    const struct _UniLMBCSGrpMap * pTable = UniLMBCSGrpMap;
 
@@ -748,7 +748,7 @@ LMBCSConversionWorker (
    UConverterDataLMBCS * extraInfo,    /* subconverters, opt & locale groups */
    ulmbcs_byte_t group,                /* The group to try */
    ulmbcs_byte_t  * pStartLMBCS,              /* where to put the results */
-   UChar * pUniChar,                   /* The input unicode character */
+   char16_t * pUniChar,                   /* The input unicode character */
    ulmbcs_byte_t * lastConverterIndex, /* output: track last successful group used */
    UBool * groups_tried                /* output: track any unsuccessful groups */
 )   
@@ -824,7 +824,7 @@ LMBCSConversionWorker (
 know we are writing LMBCS using the Unicode group
 */
 static size_t 
-LMBCSConvertUni(ulmbcs_byte_t * pLMBCS, UChar uniChar)  
+LMBCSConvertUni(ulmbcs_byte_t * pLMBCS, char16_t uniChar)
 {
      /* encode into LMBCS Unicode range */
    uint8_t LowCh =   (uint8_t)(uniChar & 0x00FF);
@@ -853,7 +853,7 @@ _LMBCSFromUnicode(UConverterFromUnicodeArgs*     args,
                   UErrorCode*     err)
 {
    ulmbcs_byte_t lastConverterIndex = 0;
-   UChar uniChar;
+   char16_t uniChar;
    ulmbcs_byte_t  LMBCS[ULMBCS_CHARSIZE_MAX];
    ulmbcs_byte_t  * pLMBCS;
    int32_t bytes_written;
@@ -1085,7 +1085,7 @@ _LMBCSFromUnicode(UConverterFromUnicodeArgs*     args,
 
 
 /* A function to call when we are looking at the Unicode group byte in LMBCS */
-static UChar
+static char16_t
 GetUniFromLMBCSUni(char const ** ppLMBCSin)  /* Called with LMBCS-style Unicode byte stream */
 {
    uint8_t  HighCh = *(*ppLMBCSin)++;  /* Big-endian Unicode in LMBCS compatibility group*/
@@ -1096,7 +1096,7 @@ GetUniFromLMBCSUni(char const ** ppLMBCSin)  /* Called with LMBCS-style Unicode
       HighCh = LowCh;
       LowCh = 0; /* zero-byte in LSB special character */
    }
-   return (UChar)((HighCh << 8) | LowCh);
+   return (char16_t)((HighCh << 8) | LowCh);
 }
 
 
@@ -1264,7 +1264,7 @@ _LMBCSToUnicodeWithOffsets(UConverterToUnicodeArgs*    args,
                      UErrorCode*    err)
 {
    char LMBCS [ULMBCS_CHARSIZE_MAX];
-   UChar uniChar;    /* one output UNICODE char */
+   char16_t uniChar;    /* one output UNICODE char */
    const char * saveSource; /* beginning of current code point */
    const char * pStartLMBCS = args->source;  /* beginning of whole string */
    const char * errSource = nullptr; /* pointer to actual input in case an error occurs */
@@ -1292,7 +1292,7 @@ _LMBCSToUnicodeWithOffsets(UConverterToUnicodeArgs*    args,
         args->source = errSource = LMBCS;
         args->sourceLimit = LMBCS+size_old+size_new;
         savebytes = (int8_t)(size_old+size_new);
-        uniChar = (UChar) _LMBCSGetNextUCharWorker(args, err);
+        uniChar = (char16_t) _LMBCSGetNextUCharWorker(args, err);
         args->source = saveSource + ((args->source - LMBCS) - size_old);
         args->sourceLimit = saveSourceLimit;
 
@@ -1314,7 +1314,7 @@ _LMBCSToUnicodeWithOffsets(UConverterToUnicodeArgs*    args,
       else
       {
          errSource = saveSource;
-         uniChar = (UChar) _LMBCSGetNextUCharWorker(args, err);
+         uniChar = (char16_t) _LMBCSGetNextUCharWorker(args, err);
          savebytes = (int8_t)(args->source - saveSource);
       }
       if (U_SUCCESS(*err))
index 6e0b95c4809a8484ddf3ba6bb14c9c93dc0851b0..c3bcfef50cb5c369b56f5c5b0f3af1bbf076c4e0 100644 (file)
@@ -52,12 +52,12 @@ static void  U_CALLCONV
 _UTF16BEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                                UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source;
+    const char16_t *source;
     char *target;
     int32_t *offsets;
 
     uint32_t targetCapacity, length, sourceIndex;
-    UChar c, trail;
+    char16_t c, trail;
     char overflow[4];
 
     source=pArgs->source;
@@ -92,7 +92,7 @@ _UTF16BEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 
     /* c!=0 indicates in several places outside the main loops that a surrogate was found */
 
-    if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
+    if((c=(char16_t)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
         /* the last buffer ended with a lead surrogate, output the surrogate pair */
         ++source;
         --length;
@@ -257,11 +257,11 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                              UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source;
-    UChar *target;
+    char16_t *target;
     int32_t *offsets;
 
     uint32_t targetCapacity, length, count, sourceIndex;
-    UChar c, trail;
+    char16_t c, trail;
 
     if(pArgs->converter->mode<8) {
         _UTF16ToUnicodeWithOffsets(pArgs, pErrorCode);
@@ -287,7 +287,7 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     sourceIndex=0;
     c=0;
 
-    /* complete a partial UChar or pair from the last call */
+    /* complete a partial char16_t or pair from the last call */
     if(cnv->toUnicodeStatus!=0) {
         /*
          * special case: single byte from a previous buffer,
@@ -306,7 +306,7 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
             ++sourceIndex;
             --length;
             if(count==2) {
-                c=((UChar)p[0]<<8)|p[1];
+                c=((char16_t)p[0]<<8)|p[1];
                 if(U16_IS_SINGLE(c)) {
                     /* output the BMP code point */
                     *target++=c;
@@ -325,8 +325,8 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                     break;
                 }
             } else if(count==4) {
-                c=((UChar)p[0]<<8)|p[1];
-                trail=((UChar)p[2]<<8)|p[3];
+                c=((char16_t)p[0]<<8)|p[1];
+                trail=((char16_t)p[2]<<8)|p[3];
                 if(U16_IS_TRAIL(trail)) {
                     /* output the surrogate pair */
                     *target++=c;
@@ -386,12 +386,12 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         targetCapacity-=count;
         if(offsets==nullptr) {
             do {
-                c=((UChar)source[0]<<8)|source[1];
+                c=((char16_t)source[0]<<8)|source[1];
                 source+=2;
                 if(U16_IS_SINGLE(c)) {
                     *target++=c;
                 } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
-                          U16_IS_TRAIL(trail=((UChar)source[0]<<8)|source[1])
+                          U16_IS_TRAIL(trail=((char16_t)source[0]<<8)|source[1])
                 ) {
                     source+=2;
                     --count;
@@ -403,14 +403,14 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
             } while(--count>0);
         } else {
             do {
-                c=((UChar)source[0]<<8)|source[1];
+                c=((char16_t)source[0]<<8)|source[1];
                 source+=2;
                 if(U16_IS_SINGLE(c)) {
                     *target++=c;
                     *offsets++=sourceIndex;
                     sourceIndex+=2;
                 } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
-                          U16_IS_TRAIL(trail=((UChar)source[0]<<8)|source[1])
+                          U16_IS_TRAIL(trail=((char16_t)source[0]<<8)|source[1])
                 ) {
                     source+=2;
                     --count;
@@ -447,7 +447,7 @@ _UTF16BEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
 
         if(U16_IS_SURROGATE_LEAD(c)) {
             if(length>=2) {
-                if(U16_IS_TRAIL(trail=((UChar)source[0]<<8)|source[1])) {
+                if(U16_IS_TRAIL(trail=((char16_t)source[0]<<8)|source[1])) {
                     /* output the surrogate pair, will overflow (see conditions comment above) */
                     source+=2;
                     length-=2;
@@ -509,7 +509,7 @@ _UTF16BEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
     }
 
     if(s+2>sourceLimit) {
-        /* only one byte: truncated UChar */
+        /* only one byte: truncated char16_t */
         pArgs->converter->toUBytes[0]=*s++;
         pArgs->converter->toULength=1;
         pArgs->source=(const char *)s;
@@ -517,7 +517,7 @@ _UTF16BEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
         return 0xffff;
     }
 
-    /* get one UChar */
+    /* get one char16_t */
     c=((UChar32)*s<<8)|s[1];
     s+=2;
 
@@ -525,10 +525,10 @@ _UTF16BEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
     if(U_IS_SURROGATE(c)) {
         if(U16_IS_SURROGATE_LEAD(c)) {
             if(s+2<=sourceLimit) {
-                UChar trail;
+                char16_t trail;
 
-                /* get a second UChar and see if it is a trail surrogate */
-                trail=((UChar)*s<<8)|s[1];
+                /* get a second char16_t and see if it is a trail surrogate */
+                trail=((char16_t)*s<<8)|s[1];
                 if(U16_IS_TRAIL(trail)) {
                     c=U16_GET_SUPPLEMENTARY(c, trail);
                     s+=2;
@@ -653,12 +653,12 @@ static void  U_CALLCONV
 _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                                UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source;
+    const char16_t *source;
     char *target;
     int32_t *offsets;
 
     uint32_t targetCapacity, length, sourceIndex;
-    UChar c, trail;
+    char16_t c, trail;
     char overflow[4];
 
     source=pArgs->source;
@@ -693,7 +693,7 @@ _UTF16LEFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 
     /* c!=0 indicates in several places outside the main loops that a surrogate was found */
 
-    if((c=(UChar)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
+    if((c=(char16_t)cnv->fromUChar32)!=0 && U16_IS_TRAIL(trail=*source) && targetCapacity>=4) {
         /* the last buffer ended with a lead surrogate, output the surrogate pair */
         ++source;
         --length;
@@ -858,11 +858,11 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                              UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source;
-    UChar *target;
+    char16_t *target;
     int32_t *offsets;
 
     uint32_t targetCapacity, length, count, sourceIndex;
-    UChar c, trail;
+    char16_t c, trail;
 
     if(pArgs->converter->mode<8) {
         _UTF16ToUnicodeWithOffsets(pArgs, pErrorCode);
@@ -888,7 +888,7 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     sourceIndex=0;
     c=0;
 
-    /* complete a partial UChar or pair from the last call */
+    /* complete a partial char16_t or pair from the last call */
     if(cnv->toUnicodeStatus!=0) {
         /*
          * special case: single byte from a previous buffer,
@@ -907,7 +907,7 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
             ++sourceIndex;
             --length;
             if(count==2) {
-                c=((UChar)p[1]<<8)|p[0];
+                c=((char16_t)p[1]<<8)|p[0];
                 if(U16_IS_SINGLE(c)) {
                     /* output the BMP code point */
                     *target++=c;
@@ -926,8 +926,8 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                     break;
                 }
             } else if(count==4) {
-                c=((UChar)p[1]<<8)|p[0];
-                trail=((UChar)p[3]<<8)|p[2];
+                c=((char16_t)p[1]<<8)|p[0];
+                trail=((char16_t)p[3]<<8)|p[2];
                 if(U16_IS_TRAIL(trail)) {
                     /* output the surrogate pair */
                     *target++=c;
@@ -987,12 +987,12 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         targetCapacity-=count;
         if(offsets==nullptr) {
             do {
-                c=((UChar)source[1]<<8)|source[0];
+                c=((char16_t)source[1]<<8)|source[0];
                 source+=2;
                 if(U16_IS_SINGLE(c)) {
                     *target++=c;
                 } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
-                          U16_IS_TRAIL(trail=((UChar)source[1]<<8)|source[0])
+                          U16_IS_TRAIL(trail=((char16_t)source[1]<<8)|source[0])
                 ) {
                     source+=2;
                     --count;
@@ -1004,14 +1004,14 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
             } while(--count>0);
         } else {
             do {
-                c=((UChar)source[1]<<8)|source[0];
+                c=((char16_t)source[1]<<8)|source[0];
                 source+=2;
                 if(U16_IS_SINGLE(c)) {
                     *target++=c;
                     *offsets++=sourceIndex;
                     sourceIndex+=2;
                 } else if(U16_IS_SURROGATE_LEAD(c) && count>=2 &&
-                          U16_IS_TRAIL(trail=((UChar)source[1]<<8)|source[0])
+                          U16_IS_TRAIL(trail=((char16_t)source[1]<<8)|source[0])
                 ) {
                     source+=2;
                     --count;
@@ -1048,7 +1048,7 @@ _UTF16LEToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
 
         if(U16_IS_SURROGATE_LEAD(c)) {
             if(length>=2) {
-                if(U16_IS_TRAIL(trail=((UChar)source[1]<<8)|source[0])) {
+                if(U16_IS_TRAIL(trail=((char16_t)source[1]<<8)|source[0])) {
                     /* output the surrogate pair, will overflow (see conditions comment above) */
                     source+=2;
                     length-=2;
@@ -1110,7 +1110,7 @@ _UTF16LEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
     }
 
     if(s+2>sourceLimit) {
-        /* only one byte: truncated UChar */
+        /* only one byte: truncated char16_t */
         pArgs->converter->toUBytes[0]=*s++;
         pArgs->converter->toULength=1;
         pArgs->source=(const char *)s;
@@ -1118,7 +1118,7 @@ _UTF16LEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
         return 0xffff;
     }
 
-    /* get one UChar */
+    /* get one char16_t */
     c=((UChar32)s[1]<<8)|*s;
     s+=2;
 
@@ -1126,10 +1126,10 @@ _UTF16LEGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *err) {
     if(U_IS_SURROGATE(c)) {
         if(U16_IS_SURROGATE_LEAD(c)) {
             if(s+2<=sourceLimit) {
-                UChar trail;
+                char16_t trail;
 
-                /* get a second UChar and see if it is a trail surrogate */
-                trail=((UChar)s[1]<<8)|*s;
+                /* get a second char16_t and see if it is a trail surrogate */
+                trail=((char16_t)s[1]<<8)|*s;
                 if(U16_IS_TRAIL(trail)) {
                     c=U16_GET_SUPPLEMENTARY(c, trail);
                     s+=2;
index 6d8b579352195eb86013356b41751b8704ea4641..d513e8e7e0e6df5054c2d1c1330a77634a6232d3 100644 (file)
@@ -48,9 +48,9 @@ T_UConverter_toUnicode_UTF32_BE(UConverterToUnicodeArgs * args,
                                 UErrorCode * err)
 {
     const unsigned char *mySource = (unsigned char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
-    const UChar *targetLimit = args->targetLimit;
+    const char16_t *targetLimit = args->targetLimit;
     unsigned char *toUBytes = args->converter->toUBytes;
     uint32_t ch, i;
 
@@ -87,18 +87,18 @@ morebytes:
             if (ch <= MAXIMUM_UCS2) 
             {
                 /* fits in 16 bits */
-                *(myTarget++) = (UChar) ch;
+                *(myTarget++) = (char16_t) ch;
             }
             else {
                 /* write out the surrogates */
                 *(myTarget++) = U16_LEAD(ch);
                 ch = U16_TRAIL(ch);
                 if (myTarget < targetLimit) {
-                    *(myTarget++) = (UChar)ch;
+                    *(myTarget++) = (char16_t)ch;
                 }
                 else {
                     /* Put in overflow buffer (not handled here) */
-                    args->converter->UCharErrorBuffer[0] = (UChar) ch;
+                    args->converter->UCharErrorBuffer[0] = (char16_t) ch;
                     args->converter->UCharErrorBufferLength = 1;
                     *err = U_BUFFER_OVERFLOW_ERROR;
                     break;
@@ -127,10 +127,10 @@ T_UConverter_toUnicode_UTF32_BE_OFFSET_LOGIC(UConverterToUnicodeArgs * args,
                                              UErrorCode * err)
 {
     const unsigned char *mySource = (unsigned char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     int32_t *myOffsets = args->offsets;
     const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
-    const UChar *targetLimit = args->targetLimit;
+    const char16_t *targetLimit = args->targetLimit;
     unsigned char *toUBytes = args->converter->toUBytes;
     uint32_t ch, i;
     int32_t offsetNum = 0;
@@ -167,7 +167,7 @@ morebytes:
             /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
             if (ch <= MAXIMUM_UCS2) {
                 /* fits in 16 bits */
-                *(myTarget++) = (UChar) ch;
+                *(myTarget++) = (char16_t) ch;
                 *(myOffsets++) = offsetNum;
             }
             else {
@@ -177,12 +177,12 @@ morebytes:
                 ch = U16_TRAIL(ch);
                 if (myTarget < targetLimit)
                 {
-                    *(myTarget++) = (UChar)ch;
+                    *(myTarget++) = (char16_t)ch;
                     *(myOffsets++) = offsetNum;
                 }
                 else {
                     /* Put in overflow buffer (not handled here) */
-                    args->converter->UCharErrorBuffer[0] = (UChar) ch;
+                    args->converter->UCharErrorBuffer[0] = (char16_t) ch;
                     args->converter->UCharErrorBufferLength = 1;
                     *err = U_BUFFER_OVERFLOW_ERROR;
                     break;
@@ -213,9 +213,9 @@ static void U_CALLCONV
 T_UConverter_fromUnicode_UTF32_BE(UConverterFromUnicodeArgs * args,
                                   UErrorCode * err)
 {
-    const UChar *mySource = args->source;
+    const char16_t *mySource = args->source;
     unsigned char *myTarget;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *sourceLimit = args->sourceLimit;
     const unsigned char *targetLimit = (unsigned char *) args->targetLimit;
     UChar32 ch, ch2;
     unsigned int indexToWrite;
@@ -314,10 +314,10 @@ static void U_CALLCONV
 T_UConverter_fromUnicode_UTF32_BE_OFFSET_LOGIC(UConverterFromUnicodeArgs * args,
                                                UErrorCode * err)
 {
-    const UChar *mySource = args->source;
+    const char16_t *mySource = args->source;
     unsigned char *myTarget;
     int32_t *myOffsets;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *sourceLimit = args->sourceLimit;
     const unsigned char *targetLimit = (unsigned char *) args->targetLimit;
     UChar32 ch, ch2;
     int32_t offsetNum = 0;
@@ -510,9 +510,9 @@ T_UConverter_toUnicode_UTF32_LE(UConverterToUnicodeArgs * args,
                                 UErrorCode * err)
 {
     const unsigned char *mySource = (unsigned char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
-    const UChar *targetLimit = args->targetLimit;
+    const char16_t *targetLimit = args->targetLimit;
     unsigned char *toUBytes = args->converter->toUBytes;
     uint32_t ch, i;
 
@@ -554,18 +554,18 @@ morebytes:
             /* Normal valid byte when the loop has not prematurely terminated (i < inBytes) */
             if (ch <= MAXIMUM_UCS2) {
                 /* fits in 16 bits */
-                *(myTarget++) = (UChar) ch;
+                *(myTarget++) = (char16_t) ch;
             }
             else {
                 /* write out the surrogates */
                 *(myTarget++) = U16_LEAD(ch);
                 ch = U16_TRAIL(ch);
                 if (myTarget < targetLimit) {
-                    *(myTarget++) = (UChar)ch;
+                    *(myTarget++) = (char16_t)ch;
                 }
                 else {
                     /* Put in overflow buffer (not handled here) */
-                    args->converter->UCharErrorBuffer[0] = (UChar) ch;
+                    args->converter->UCharErrorBuffer[0] = (char16_t) ch;
                     args->converter->UCharErrorBufferLength = 1;
                     *err = U_BUFFER_OVERFLOW_ERROR;
                     break;
@@ -595,10 +595,10 @@ T_UConverter_toUnicode_UTF32_LE_OFFSET_LOGIC(UConverterToUnicodeArgs * args,
                                              UErrorCode * err)
 {
     const unsigned char *mySource = (unsigned char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     int32_t *myOffsets = args->offsets;
     const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
-    const UChar *targetLimit = args->targetLimit;
+    const char16_t *targetLimit = args->targetLimit;
     unsigned char *toUBytes = args->converter->toUBytes;
     uint32_t ch, i;
     int32_t offsetNum = 0;
@@ -643,7 +643,7 @@ morebytes:
             if (ch <= MAXIMUM_UCS2) 
             {
                 /* fits in 16 bits */
-                *(myTarget++) = (UChar) ch;
+                *(myTarget++) = (char16_t) ch;
                 *(myOffsets++) = offsetNum;
             }
             else {
@@ -653,13 +653,13 @@ morebytes:
                 ch = U16_TRAIL(ch);
                 if (myTarget < targetLimit)
                 {
-                    *(myTarget++) = (UChar)ch;
+                    *(myTarget++) = (char16_t)ch;
                     *(myOffsets++) = offsetNum;
                 }
                 else
                 {
                     /* Put in overflow buffer (not handled here) */
-                    args->converter->UCharErrorBuffer[0] = (UChar) ch;
+                    args->converter->UCharErrorBuffer[0] = (char16_t) ch;
                     args->converter->UCharErrorBufferLength = 1;
                     *err = U_BUFFER_OVERFLOW_ERROR;
                     break;
@@ -691,9 +691,9 @@ static void U_CALLCONV
 T_UConverter_fromUnicode_UTF32_LE(UConverterFromUnicodeArgs * args,
                                   UErrorCode * err)
 {
-    const UChar *mySource = args->source;
+    const char16_t *mySource = args->source;
     unsigned char *myTarget;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *sourceLimit = args->sourceLimit;
     const unsigned char *targetLimit = (unsigned char *) args->targetLimit;
     UChar32 ch, ch2;
     unsigned int indexToWrite;
@@ -800,10 +800,10 @@ static void U_CALLCONV
 T_UConverter_fromUnicode_UTF32_LE_OFFSET_LOGIC(UConverterFromUnicodeArgs * args,
                                                UErrorCode * err)
 {
-    const UChar *mySource = args->source;
+    const char16_t *mySource = args->source;
     unsigned char *myTarget;
     int32_t *myOffsets;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *sourceLimit = args->sourceLimit;
     const unsigned char *targetLimit = (unsigned char *) args->targetLimit;
     UChar32 ch, ch2;
     unsigned int indexToWrite;
index 25e40d7cb592bcbd8f2ace2b2c6a7884f6f819b3..398b528e832d282e599024efbfe732135c95b87c 100644 (file)
@@ -212,8 +212,8 @@ _UTF7ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                           UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     int32_t *offsets;
 
     uint8_t *bytes;
@@ -320,10 +320,10 @@ unicodeMode:
                      * base64Value==-1 for any legal character except base64 and minus sign, or
                      * base64Value==-3 for illegal characters:
                      * 1. In either case, leave Unicode mode.
-                     * 2.1. If we ended with an incomplete UChar or none after the +, then
+                     * 2.1. If we ended with an incomplete char16_t or none after the +, then
                      *      generate an error for the preceding erroneous sequence and deal with
                      *      the current (possibly illegal) character next time through.
-                     * 2.2. Else the current char comes after a complete UChar, which was already
+                     * 2.2. Else the current char comes after a complete char16_t, which was already
                      *      pushed to the output buf, so:
                      * 2.2.1. If the current char is legal, just save it for processing next time.
                      *        It may be for example, a plus which we need to deal with in direct mode.
@@ -339,14 +339,14 @@ unicodeMode:
                         *pErrorCode=U_ILLEGAL_CHAR_FOUND;
                         break;
                     } else if(bits!=0) {
-                        /* bits are illegally left over, a UChar is incomplete */
+                        /* bits are illegally left over, a char16_t is incomplete */
                         /* don't include current char (legal or illegal) in error seq */
                         --source;
                         --byteIndex;
                         *pErrorCode=U_ILLEGAL_CHAR_FOUND;
                         break;
                     } else {
-                        /* previous UChar was complete */
+                        /* previous char16_t was complete */
                         if(base64Value==-3) {
                             /* current character is illegal, deal with it here */
                             *pErrorCode=U_ILLEGAL_CHAR_FOUND;
@@ -374,7 +374,7 @@ unicodeMode:
                         ++base64Counter;
                         break;
                     case 2:
-                        *target++=(UChar)((bits<<4)|(base64Value>>2));
+                        *target++=(char16_t)((bits<<4)|(base64Value>>2));
                         if(offsets!=nullptr) {
                             *offsets++=sourceIndex;
                             sourceIndex=nextSourceIndex-1;
@@ -385,7 +385,7 @@ unicodeMode:
                         base64Counter=3;
                         break;
                     case 5:
-                        *target++=(UChar)((bits<<2)|(base64Value>>4));
+                        *target++=(char16_t)((bits<<2)|(base64Value>>4));
                         if(offsets!=nullptr) {
                             *offsets++=sourceIndex;
                             sourceIndex=nextSourceIndex-1;
@@ -396,7 +396,7 @@ unicodeMode:
                         base64Counter=6;
                         break;
                     case 7:
-                        *target++=(UChar)((bits<<6)|base64Value);
+                        *target++=(char16_t)((bits<<6)|base64Value);
                         if(offsets!=nullptr) {
                             *offsets++=sourceIndex;
                             sourceIndex=nextSourceIndex;
@@ -421,7 +421,7 @@ unicodeMode:
                     } else {
                         /* absorb the minus and leave the Unicode Mode */
                         if(bits!=0) {
-                            /* bits are illegally left over, a UChar is incomplete */
+                            /* bits are illegally left over, a char16_t is incomplete */
                             *pErrorCode=U_ILLEGAL_CHAR_FOUND;
                             break;
                         }
@@ -462,12 +462,12 @@ static void U_CALLCONV
 _UTF7FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                             UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target, *targetLimit;
     int32_t *offsets;
 
     int32_t length, targetCapacity, sourceIndex;
-    UChar c;
+    char16_t c;
 
     /* UTF-7 state */
     const UBool *encodeDirectly;
@@ -896,8 +896,8 @@ _IMAPToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                           UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     int32_t *offsets;
 
     uint8_t *bytes;
@@ -914,7 +914,7 @@ _IMAPToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
 
     int32_t sourceIndex, nextSourceIndex;
 
-    UChar c;
+    char16_t c;
     uint8_t b;
 
     /* set up the local pointers */
@@ -1021,7 +1021,7 @@ unicodeMode:
                         ++base64Counter;
                         break;
                     case 2:
-                        c=(UChar)((bits<<4)|(base64Value>>2));
+                        c=(char16_t)((bits<<4)|(base64Value>>2));
                         if(isLegalIMAP(c)) {
                             /* illegal */
                             inDirectMode=true;
@@ -1039,7 +1039,7 @@ unicodeMode:
                         base64Counter=3;
                         break;
                     case 5:
-                        c=(UChar)((bits<<2)|(base64Value>>4));
+                        c=(char16_t)((bits<<2)|(base64Value>>4));
                         if(isLegalIMAP(c)) {
                             /* illegal */
                             inDirectMode=true;
@@ -1057,7 +1057,7 @@ unicodeMode:
                         base64Counter=6;
                         break;
                     case 7:
-                        c=(UChar)((bits<<6)|base64Value);
+                        c=(char16_t)((bits<<6)|base64Value);
                         if(isLegalIMAP(c)) {
                             /* illegal */
                             inDirectMode=true;
@@ -1089,7 +1089,7 @@ unicodeMode:
                     } else {
                         /* absorb the minus and leave the Unicode Mode */
                         if(bits!=0 || (base64Counter!=0 && base64Counter!=3 && base64Counter!=6)) {
-                            /* bits are illegally left over, a UChar is incomplete */
+                            /* bits are illegally left over, a char16_t is incomplete */
                             /* base64Counter other than 0, 3, 6 means non-minimal zero-padding, also illegal */
                             *pErrorCode=U_ILLEGAL_CHAR_FOUND;
                             break;
@@ -1163,12 +1163,12 @@ static void U_CALLCONV
 _IMAPFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                             UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target, *targetLimit;
     int32_t *offsets;
 
     int32_t length, targetCapacity, sourceIndex;
-    UChar c;
+    char16_t c;
     uint8_t b;
 
     /* UTF-7 state */
index bed5753fd6c8d7f3d458ed46531c4883a0c09671..cf3bb22a02a7f7b4ff60efedf9e036263b61ffaa 100644 (file)
@@ -67,9 +67,9 @@ static void  U_CALLCONV ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args,
 {
     UConverter *cnv = args->converter;
     const unsigned char *mySource = (unsigned char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
-    const UChar *targetLimit = args->targetLimit;
+    const char16_t *targetLimit = args->targetLimit;
     unsigned char *toUBytes = cnv->toUBytes;
     UBool isCESU8 = hasCESU8Data(cnv);
     uint32_t ch, ch2 = 0;
@@ -93,7 +93,7 @@ static void  U_CALLCONV ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args,
         ch = *(mySource++);
         if (U8_IS_SINGLE(ch))        /* Simple case */
         {
-            *(myTarget++) = (UChar) ch;
+            *(myTarget++) = (char16_t) ch;
         }
         else
         {
@@ -137,7 +137,7 @@ morebytes:
                 if (ch <= MAXIMUM_UCS2) 
                 {
                     /* fits in 16 bits */
-                    *(myTarget++) = (UChar) ch;
+                    *(myTarget++) = (char16_t) ch;
                 }
                 else
                 {
@@ -146,12 +146,12 @@ morebytes:
                     ch = U16_TRAIL(ch);
                     if (myTarget < targetLimit)
                     {
-                        *(myTarget++) = (UChar)ch;
+                        *(myTarget++) = (char16_t)ch;
                     }
                     else
                     {
                         /* Put in overflow buffer (not handled here) */
-                        cnv->UCharErrorBuffer[0] = (UChar) ch;
+                        cnv->UCharErrorBuffer[0] = (char16_t) ch;
                         cnv->UCharErrorBufferLength = 1;
                         *err = U_BUFFER_OVERFLOW_ERROR;
                         break;
@@ -183,11 +183,11 @@ static void  U_CALLCONV ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeAr
 {
     UConverter *cnv = args->converter;
     const unsigned char *mySource = (unsigned char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     int32_t *myOffsets = args->offsets;
     int32_t offsetNum = 0;
     const unsigned char *sourceLimit = (unsigned char *) args->sourceLimit;
-    const UChar *targetLimit = args->targetLimit;
+    const char16_t *targetLimit = args->targetLimit;
     unsigned char *toUBytes = cnv->toUBytes;
     UBool isCESU8 = hasCESU8Data(cnv);
     uint32_t ch, ch2 = 0;
@@ -210,7 +210,7 @@ static void  U_CALLCONV ucnv_toUnicode_UTF8_OFFSETS_LOGIC (UConverterToUnicodeAr
         ch = *(mySource++);
         if (U8_IS_SINGLE(ch))        /* Simple case */
         {
-            *(myTarget++) = (UChar) ch;
+            *(myTarget++) = (char16_t) ch;
             *(myOffsets++) = offsetNum++;
         }
         else
@@ -253,7 +253,7 @@ morebytes:
                 if (ch <= MAXIMUM_UCS2) 
                 {
                     /* fits in 16 bits */
-                    *(myTarget++) = (UChar) ch;
+                    *(myTarget++) = (char16_t) ch;
                     *(myOffsets++) = offsetNum;
                 }
                 else
@@ -264,12 +264,12 @@ morebytes:
                     ch = U16_TRAIL(ch);
                     if (myTarget < targetLimit)
                     {
-                        *(myTarget++) = (UChar)ch;
+                        *(myTarget++) = (char16_t)ch;
                         *(myOffsets++) = offsetNum;
                     }
                     else
                     {
-                        cnv->UCharErrorBuffer[0] = (UChar) ch;
+                        cnv->UCharErrorBuffer[0] = (char16_t) ch;
                         cnv->UCharErrorBufferLength = 1;
                         *err = U_BUFFER_OVERFLOW_ERROR;
                     }
@@ -301,8 +301,8 @@ U_CFUNC void  U_CALLCONV ucnv_fromUnicode_UTF8 (UConverterFromUnicodeArgs * args
                                     UErrorCode * err)
 {
     UConverter *cnv = args->converter;
-    const UChar *mySource = args->source;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *mySource = args->source;
+    const char16_t *sourceLimit = args->sourceLimit;
     uint8_t *myTarget = (uint8_t *) args->target;
     const uint8_t *targetLimit = (uint8_t *) args->targetLimit;
     uint8_t *tempPtr;
@@ -415,9 +415,9 @@ U_CFUNC void  U_CALLCONV ucnv_fromUnicode_UTF8_OFFSETS_LOGIC (UConverterFromUnic
                                                   UErrorCode * err)
 {
     UConverter *cnv = args->converter;
-    const UChar *mySource = args->source;
+    const char16_t *mySource = args->source;
     int32_t *myOffsets = args->offsets;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *sourceLimit = args->sourceLimit;
     uint8_t *myTarget = (uint8_t *) args->target;
     const uint8_t *targetLimit = (uint8_t *) args->targetLimit;
     uint8_t *tempPtr;
@@ -887,7 +887,7 @@ static const UConverterStaticData _UTF8StaticData={
     sizeof(UConverterStaticData),
     "UTF-8",
     1208, UCNV_IBM, UCNV_UTF8,
-    1, 3, /* max 3 bytes per UChar from UTF-8 (4 bytes from surrogate _pair_) */
+    1, 3, /* max 3 bytes per char16_t from UTF-8 (4 bytes from surrogate _pair_) */
     { 0xef, 0xbf, 0xbd, 0 },3,false,false,
     0,
     0,
index 26afcc2fabd463e37a7fc2d9280718637c16e150..8d460a440b1e9f56d91dc00d57d06edf5dc60363 100644 (file)
@@ -392,7 +392,7 @@ static void U_CALLCONV
 _Bocu1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                              UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
     int32_t *offsets;
@@ -485,7 +485,7 @@ fastSingle:
 getTrail:
                 if(source<sourceLimit) {
                     /* test the following code unit */
-                    UChar trail=*source;
+                    char16_t trail=*source;
                     if(U16_IS_TRAIL(trail)) {
                         ++source;
                         ++nextSourceIndex;
@@ -653,7 +653,7 @@ static void U_CALLCONV
 _Bocu1FromUnicode(UConverterFromUnicodeArgs *pArgs,
                   UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
 
@@ -729,7 +729,7 @@ fastSingle:
 getTrail:
                 if(source<sourceLimit) {
                     /* test the following code unit */
-                    UChar trail=*source;
+                    char16_t trail=*source;
                     if(U16_IS_TRAIL(trail)) {
                         ++source;
                         c=U16_GET_SUPPLEMENTARY(c, trail);
@@ -957,8 +957,8 @@ _Bocu1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                            UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     int32_t *offsets;
 
     int32_t prev, count, diff, c;
@@ -1009,7 +1009,7 @@ fastSingle:
         if(BOCU1_START_NEG_2<=(c=*source) && c<BOCU1_START_POS_2) {
             c=prev+(c-BOCU1_MIDDLE);
             if(c<0x3000) {
-                *target++=(UChar)c;
+                *target++=(char16_t)c;
                 *offsets++=nextSourceIndex++;
                 prev=BOCU1_SIMPLE_PREV(c);
             } else {
@@ -1019,7 +1019,7 @@ fastSingle:
             if(c!=0x20) {
                 prev=BOCU1_ASCII_PREV;
             }
-            *target++=(UChar)c;
+            *target++=(char16_t)c;
             *offsets++=nextSourceIndex++;
         } else {
             break;
@@ -1043,7 +1043,7 @@ fastSingle:
             /* Write a code point directly from a single-byte difference. */
             c=prev+(c-BOCU1_MIDDLE);
             if(c<0x3000) {
-                *target++=(UChar)c;
+                *target++=(char16_t)c;
                 *offsets++=sourceIndex;
                 prev=BOCU1_SIMPLE_PREV(c);
                 sourceIndex=nextSourceIndex;
@@ -1057,7 +1057,7 @@ fastSingle:
             if(c!=0x20) {
                 prev=BOCU1_ASCII_PREV;
             }
-            *target++=(UChar)c;
+            *target++=(char16_t)c;
             *offsets++=sourceIndex;
             sourceIndex=nextSourceIndex;
             continue;
@@ -1128,7 +1128,7 @@ getTrail:
         /* calculate the next prev and output c */
         prev=BOCU1_PREV(c);
         if(c<=0xffff) {
-            *target++=(UChar)c;
+            *target++=(char16_t)c;
             *offsets++=sourceIndex;
         } else {
             /* output surrogate pair */
@@ -1180,8 +1180,8 @@ _Bocu1ToUnicode(UConverterToUnicodeArgs *pArgs,
                 UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
 
     int32_t prev, count, diff, c;
 
@@ -1224,7 +1224,7 @@ fastSingle:
         if(BOCU1_START_NEG_2<=(c=*source) && c<BOCU1_START_POS_2) {
             c=prev+(c-BOCU1_MIDDLE);
             if(c<0x3000) {
-                *target++=(UChar)c;
+                *target++=(char16_t)c;
                 prev=BOCU1_SIMPLE_PREV(c);
             } else {
                 break;
@@ -1233,7 +1233,7 @@ fastSingle:
             if(c!=0x20) {
                 prev=BOCU1_ASCII_PREV;
             }
-            *target++=(UChar)c;
+            *target++=(char16_t)c;
         } else {
             break;
         }
@@ -1254,7 +1254,7 @@ fastSingle:
             /* Write a code point directly from a single-byte difference. */
             c=prev+(c-BOCU1_MIDDLE);
             if(c<0x3000) {
-                *target++=(UChar)c;
+                *target++=(char16_t)c;
                 prev=BOCU1_SIMPLE_PREV(c);
                 goto fastSingle;
             }
@@ -1266,7 +1266,7 @@ fastSingle:
             if(c!=0x20) {
                 prev=BOCU1_ASCII_PREV;
             }
-            *target++=(UChar)c;
+            *target++=(char16_t)c;
             continue;
         } else if(BOCU1_START_NEG_3<=c && c<BOCU1_START_POS_3 && source<sourceLimit) {
             /* Optimize two-byte case. */
@@ -1332,7 +1332,7 @@ getTrail:
         /* calculate the next prev and output c */
         prev=BOCU1_PREV(c);
         if(c<=0xffff) {
-            *target++=(UChar)c;
+            *target++=(char16_t)c;
         } else {
             /* output surrogate pair */
             *target++=U16_LEAD(c);
@@ -1399,7 +1399,7 @@ static const UConverterStaticData _Bocu1StaticData={
     "BOCU-1",
     1214, /* CCSID for BOCU-1 */
     UCNV_IBM, UCNV_BOCU1,
-    1, 4, /* one UChar generates at least 1 byte and at most 4 bytes */
+    1, 4, /* one char16_t generates at least 1 byte and at most 4 bytes */
     { 0x1a, 0, 0, 0 }, 1, /* BOCU-1 never needs to write a subchar */
     false, false,
     0,
index 20a5999924e37f90879d052104348f1b5a07376f..0830042d0bbee7a64563f28bb4375bca2a1cf22e 100644 (file)
 U_CAPI int32_t U_EXPORT2
 ucnv_getDisplayName(const UConverter *cnv,
                     const char *displayLocale,
-                    UChar *displayName, int32_t displayNameCapacity,
+                    char16_t *displayName, int32_t displayNameCapacity,
                     UErrorCode *pErrorCode) {
     UResourceBundle *rb;
-    const UChar *name;
+    const char16_t *name;
     int32_t length;
     UErrorCode localStatus = U_ZERO_ERROR;
 
index 00f05c35220fbdb84f63db0faad52eb0a031520e..fa0f2b40ea71788c145ff3dd352de5e3ad6298c6 100644 (file)
@@ -157,7 +157,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                                                             UErrorCode* err){
     char tempBuf[2];
     const char *mySource = ( char *) args->source;
-    UChar *myTarget = args->target;
+    char16_t *myTarget = args->target;
     const char *mySourceLimit = args->sourceLimit;
     UChar32 targetUniChar = 0x0000;
     int32_t mySourceChar = 0x0000;
@@ -188,7 +188,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                     if(args->offsets) {
                         args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 2);
                     }
-                    *(myTarget++)=(UChar)mySourceChar;
+                    *(myTarget++)=(char16_t)mySourceChar;
                     myData->isEmptySegment = false;
                     continue;
                 case UCNV_OPEN_BRACE:
@@ -288,7 +288,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                     args->converter->mode = UCNV_TILDE;
                     continue;
                 } else if(mySourceChar <= 0x7f) {
-                    targetUniChar = (UChar)mySourceChar;  /* ASCII */
+                    targetUniChar = (char16_t)mySourceChar;  /* ASCII */
                     myData->isEmptySegment = false; /* the segment has something valid */
                 } else {
                     targetUniChar = 0xffff;
@@ -300,7 +300,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
                     args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 1-(myData->isStateDBCS));
                 }
 
-                *(myTarget++)=(UChar)targetUniChar;
+                *(myTarget++)=(char16_t)targetUniChar;
             }
             else /* targetUniChar>=0xfffe */ {
                 if(targetUniChar == 0xfffe){
@@ -335,7 +335,7 @@ UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
 static void  U_CALLCONV
 UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
                                                       UErrorCode * err){
-    const UChar *mySource = args->source;
+    const char16_t *mySource = args->source;
     char *myTarget = args->target;
     int32_t* offsets = args->offsets;
     int32_t mySourceIndex = 0;
@@ -363,7 +363,7 @@ UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
         targetUniChar = missingCharMarker;
         if (myTargetIndex < targetLength){
             
-            mySourceChar = (UChar) mySource[mySourceIndex++];
+            mySourceChar = (char16_t) mySource[mySourceIndex++];
             
 
             oldIsTargetUCharDBCS = isTargetUCharDBCS;
@@ -453,7 +453,7 @@ getTrail:
                         /*look ahead to find the trail surrogate*/
                         if(mySourceIndex <  mySourceLength) {
                             /* test the following code unit */
-                            UChar trail=(UChar) args->source[mySourceIndex];
+                            char16_t trail=(char16_t) args->source[mySourceIndex];
                             if(U16_IS_TRAIL(trail)) {
                                 ++mySourceIndex;
                                 mySourceChar=U16_GET_SUPPLEMENTARY(args->converter->fromUChar32, trail);
index 80b09923d6f765382739f7f28607813e8b5fb56b..507a50c89254b0e9aeedfaad0de5e026a54d82a6 100644 (file)
@@ -119,8 +119,8 @@ typedef enum {
 #define ISCII_CNV_PREFIX "ISCII,version="
 
 typedef struct {
-    UChar contextCharToUnicode;         /* previous Unicode codepoint for contextual analysis */
-    UChar contextCharFromUnicode;       /* previous Unicode codepoint for contextual analysis */
+    char16_t contextCharToUnicode;         /* previous Unicode codepoint for contextual analysis */
+    char16_t contextCharFromUnicode;       /* previous Unicode codepoint for contextual analysis */
     uint16_t defDeltaToUnicode;         /* delta for switching to default state when DEF is encountered  */
     uint16_t currentDeltaFromUnicode;   /* current delta in Indic block */
     uint16_t currentDeltaToUnicode;     /* current delta in Indic block */
@@ -895,8 +895,8 @@ static const uint16_t nuktaSpecialCases[][2]={
 static void U_CALLCONV
 UConverter_fromUnicode_ISCII_OFFSETS_LOGIC(
         UConverterFromUnicodeArgs * args, UErrorCode * err) {
-    const UChar *source = args->source;
-    const UChar *sourceLimit = args->sourceLimit;
+    const char16_t *source = args->source;
+    const char16_t *sourceLimit = args->sourceLimit;
     unsigned char *target = (unsigned char *) args->target;
     unsigned char *targetLimit = (unsigned char *) args->targetLimit;
     int32_t* offsets = args->offsets;
@@ -1052,7 +1052,7 @@ UConverter_fromUnicode_ISCII_OFFSETS_LOGIC(
             }
         } else if (targetByteUnit != missingCharMarker) {
             if (targetByteUnit==ISCII_HALANT) {
-                converterData->contextCharFromUnicode = (UChar)targetByteUnit;
+                converterData->contextCharFromUnicode = (char16_t)targetByteUnit;
             }
             /* write targetByteUnit to target*/
             WRITE_TO_TARGET_FROM_U(args,offsets,source,target,targetLimit,targetByteUnit,err);
@@ -1068,7 +1068,7 @@ getTrail:
                     /*look ahead to find the trail surrogate*/
                     if (source < sourceLimit) {
                         /* test the following code unit */
-                        UChar trail= (*source);
+                        char16_t trail= (*source);
                         if (U16_IS_TRAIL(trail)) {
                             source++;
                             sourceChar=U16_GET_SUPPLEMENTARY(sourceChar, trail);
@@ -1131,13 +1131,13 @@ static const uint16_t lookupTable[][2]={
     }                                                                                    \
     /* now write the targetUniChar */                                                    \
     if(target<args->targetLimit){                                                        \
-        *(target)++ = (UChar)targetUniChar;                                              \
+        *(target)++ = (char16_t)targetUniChar;                                              \
         if(offsets){                                                                     \
             *(offsets)++ = (int32_t)(offset);                                            \
         }                                                                                \
     }else{                                                                               \
         args->converter->UCharErrorBuffer[args->converter->UCharErrorBufferLength++] =   \
-            (UChar)targetUniChar;                                                        \
+            (char16_t)targetUniChar;                                                        \
         *err = U_BUFFER_OVERFLOW_ERROR;                                                  \
     }                                                                                    \
 } UPRV_BLOCK_MACRO_END
@@ -1179,15 +1179,15 @@ static const uint16_t lookupTable[][2]={
 static void U_CALLCONV
 UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err) {
     const char *source = ( char *) args->source;
-    UChar *target = args->target;
+    char16_t *target = args->target;
     const char *sourceLimit = args->sourceLimit;
-    const UChar* targetLimit = args->targetLimit;
+    const char16_t* targetLimit = args->targetLimit;
     uint32_t targetUniChar = 0x0000;
     uint8_t sourceChar = 0x0000;
     UConverterDataISCII* data;
     UChar32* toUnicodeStatus=nullptr;
     UChar32 tempTargetUniChar = 0x0000;
-    UChar* contextCharToUnicode= nullptr;
+    char16_t* contextCharToUnicode= nullptr;
     UBool found;
     int i; 
     int offset = 0;
@@ -1293,7 +1293,7 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
             case ISCII_INV:
             case EXT:
             case ATR:
-                *contextCharToUnicode = (UChar)sourceChar;
+                *contextCharToUnicode = (char16_t)sourceChar;
 
                 if (*toUnicodeStatus != missingCharMarker) {
                     /* Write the previous toUnicodeStatus, this was delayed to handle consonant clustering for Gurmukhi script. */
@@ -1471,7 +1471,7 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
 
             if (targetUniChar != missingCharMarker) {
                 /* now save the targetUniChar for delayed write */
-                *toUnicodeStatus = (UChar) targetUniChar;
+                *toUnicodeStatus = (char16_t) targetUniChar;
                 if (data->resetToDefaultToUnicode) {
                     data->currentDeltaToUnicode = data->defDeltaToUnicode;
                     data->currentMaskToUnicode = data->defMaskToUnicode;
index 3e4c38c627f4adfd9c2f83aaed13161e53cbc296..09206885269d5f0aaaf31158ff79a1fde9135e60 100644 (file)
@@ -36,7 +36,7 @@ static void U_CALLCONV
 _Latin1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                             UErrorCode *pErrorCode) {
     const uint8_t *source;
-    UChar *target;
+    char16_t *target;
     int32_t targetCapacity, length;
     int32_t *offsets;
 
@@ -51,7 +51,7 @@ _Latin1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     sourceIndex=0;
 
     /*
-     * since the conversion here is 1:1 UChar:uint8_t, we need only one counter
+     * since the conversion here is 1:1 char16_t:uint8_t, we need only one counter
      * for the minimum of the sourceLength and targetCapacity
      */
     length=(int32_t)((const uint8_t *)pArgs->sourceLimit-source);
@@ -137,13 +137,13 @@ static void U_CALLCONV
 _Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                               UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target, *oldTarget;
     int32_t targetCapacity, length;
     int32_t *offsets;
 
     UChar32 cp;
-    UChar c, max;
+    char16_t c, max;
 
     int32_t sourceIndex;
 
@@ -168,7 +168,7 @@ _Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
     sourceIndex= cp==0 ? 0 : -1;
 
     /*
-     * since the conversion here is 1:1 UChar:uint8_t, we need only one counter
+     * since the conversion here is 1:1 char16_t:uint8_t, we need only one counter
      * for the minimum of the sourceLength and targetCapacity
      */
     length=(int32_t)(sourceLimit-source);
@@ -185,7 +185,7 @@ _Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
     /* unroll the loop with the most common case */
     if(targetCapacity>=16) {
         int32_t count, loops;
-        UChar u, oredChars;
+        char16_t u, oredChars;
 
         loops=count=targetCapacity>>4;
         do {
@@ -274,7 +274,7 @@ _Latin1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 getTrail:
             if(source<sourceLimit) {
                 /* test the following code unit */
-                UChar trail=*source;
+                char16_t trail=*source;
                 if(U16_IS_TRAIL(trail)) {
                     ++source;
                     cp=U16_GET_SUPPLEMENTARY(cp, trail);
@@ -482,7 +482,7 @@ static void U_CALLCONV
 _ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                            UErrorCode *pErrorCode) {
     const uint8_t *source, *sourceLimit;
-    UChar *target, *oldTarget;
+    char16_t *target, *oldTarget;
     int32_t targetCapacity, length;
     int32_t *offsets;
 
@@ -501,7 +501,7 @@ _ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     sourceIndex=0;
 
     /*
-     * since the conversion here is 1:1 UChar:uint8_t, we need only one counter
+     * since the conversion here is 1:1 char16_t:uint8_t, we need only one counter
      * for the minimum of the sourceLength and targetCapacity
      */
     length=(int32_t)(sourceLimit-source);
@@ -512,7 +512,7 @@ _ASCIIToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     if(targetCapacity>=8) {
         /* This loop is unrolled for speed and improved pipelining. */
         int32_t count, loops;
-        UChar oredChars;
+        char16_t oredChars;
 
         loops=count=targetCapacity>>3;
         do {
index 69b3d05eb0932644609722abed4700992c788240..d760603980026a208951d5a21d4bcc611bd77306 100644 (file)
@@ -683,7 +683,7 @@ enumToU(UConverterMBCSTable *mbcsTable, int8_t stateProps[],
             action=MBCS_ENTRY_FINAL_ACTION(entry);
             if(action==MBCS_STATE_VALID_DIRECT_16) {
                 /* output BMP code point */
-                c=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             } else if(action==MBCS_STATE_VALID_16) {
                 int32_t finalOffset=offset+MBCS_ENTRY_FINAL_VALUE_16(entry);
                 c=unicodeCodeUnits[finalOffset];
@@ -1104,7 +1104,7 @@ ucnv_MBCSGetUnicodeSet(const UConverter *cnv,
 static UChar32
 _extFromU(UConverter *cnv, const UConverterSharedData *sharedData,
           UChar32 cp,
-          const UChar **source, const UChar *sourceLimit,
+          const char16_t **source, const char16_t *sourceLimit,
           uint8_t **target, const uint8_t *targetLimit,
           int32_t **offsets, int32_t sourceIndex,
           UBool flush,
@@ -1172,7 +1172,7 @@ static int8_t
 _extToU(UConverter *cnv, const UConverterSharedData *sharedData,
         int8_t length,
         const uint8_t **source, const uint8_t *sourceLimit,
-        UChar **target, const UChar *targetLimit,
+        char16_t **target, const char16_t *targetLimit,
         int32_t **offsets, int32_t sourceIndex,
         UBool flush,
         UErrorCode *pErrorCode) {
@@ -1828,7 +1828,7 @@ ucnv_MBCSLoad(UConverterSharedData *sharedData,
                 mbcsTable->mbcsIndex=(const uint16_t *)
                     (mbcsTable->fromUnicodeBytes+
                      (noFromU ? 0 : mbcsTable->fromUBytesLength));
-                mbcsTable->maxFastUChar=(((UChar)header->version[2])<<8)|0xff;
+                mbcsTable->maxFastUChar=(((char16_t)header->version[2])<<8)|0xff;
             }
         }
 
@@ -2034,8 +2034,8 @@ ucnv_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                                 UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     int32_t *offsets;
 
     const int32_t (*stateTable)[256];
@@ -2043,7 +2043,7 @@ ucnv_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     int32_t sourceIndex;
 
     int32_t entry;
-    UChar c;
+    char16_t c;
     uint8_t action;
 
     /* set up the local pointers */
@@ -2085,7 +2085,7 @@ ucnv_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         /* test the most common case first */
         if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
             /* output BMP code point */
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             if(offsets!=nullptr) {
                 *offsets++=sourceIndex;
             }
@@ -2105,11 +2105,11 @@ ucnv_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         ) {
             entry=MBCS_ENTRY_FINAL_VALUE(entry);
             /* output surrogate pair */
-            *target++=(UChar)(0xd800|(UChar)(entry>>10));
+            *target++=(char16_t)(0xd800|(char16_t)(entry>>10));
             if(offsets!=nullptr) {
                 *offsets++=sourceIndex;
             }
-            c=(UChar)(0xdc00|(UChar)(entry&0x3ff));
+            c=(char16_t)(0xdc00|(char16_t)(entry&0x3ff));
             if(target<targetLimit) {
                 *target++=c;
                 if(offsets!=nullptr) {
@@ -2128,7 +2128,7 @@ ucnv_MBCSSingleToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         } else if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
             if(UCNV_TO_U_USE_FALLBACK(cnv)) {
                 /* output BMP code point */
-                *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                 if(offsets!=nullptr) {
                     *offsets++=sourceIndex;
                 }
@@ -2186,7 +2186,7 @@ ucnv_MBCSSingleToBMPWithOffsets(UConverterToUnicodeArgs *pArgs,
                             UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit, *lastSource;
-    UChar *target;
+    char16_t *target;
     int32_t targetCapacity, length;
     int32_t *offsets;
 
@@ -2216,7 +2216,7 @@ ucnv_MBCSSingleToBMPWithOffsets(UConverterToUnicodeArgs *pArgs,
     lastSource=source;
 
     /*
-     * since the conversion here is 1:1 UChar:uint8_t, we need only one counter
+     * since the conversion here is 1:1 char16_t:uint8_t, we need only one counter
      * for the minimum of the sourceLength and targetCapacity
      */
     length=(int32_t)(sourceLimit-source);
@@ -2234,37 +2234,37 @@ unrolled:
         loops=count=targetCapacity>>4;
         do {
             oredEntries=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             oredEntries|=entry=stateTable[0][*source++];
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
 
             /* were all 16 entries really valid? */
             if(!MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(oredEntries)) {
@@ -2310,7 +2310,7 @@ unrolled:
         /* test the most common case first */
         if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
             /* output BMP code point */
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             --targetCapacity;
             continue;
         }
@@ -2323,7 +2323,7 @@ unrolled:
         if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
             if(UCNV_TO_U_USE_FALLBACK(cnv)) {
                 /* output BMP code point */
-                *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                 --targetCapacity;
                 continue;
             }
@@ -2466,8 +2466,8 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                           UErrorCode *pErrorCode) {
     UConverter *cnv;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     int32_t *offsets;
 
     const int32_t (*stateTable)[256];
@@ -2481,7 +2481,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     int32_t sourceIndex, nextSourceIndex;
 
     int32_t entry;
-    UChar c;
+    char16_t c;
     uint8_t action;
 
     /* use optimized function if possible */
@@ -2585,7 +2585,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                         if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
                             /* output BMP code point */
                             ++source;
-                            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                             state=(uint8_t)MBCS_ENTRY_FINAL_STATE(entry); /* typically 0 */
                         } else {
                             /* leave the optimized loop */
@@ -2625,7 +2625,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                         if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
                             /* output BMP code point */
                             ++source;
-                            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                             if(offsets!=nullptr) {
                                 *offsets++=sourceIndex;
                                 sourceIndex=++nextSourceIndex;
@@ -2689,7 +2689,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
             } else if(c==0xfffe) {
                 if(UCNV_TO_U_USE_FALLBACK(cnv) && (entry=(int32_t)ucnv_MBCSGetFallback(&cnv->sharedData->mbcs, offset))!=0xfffe) {
                     /* output fallback BMP code point */
-                    *target++=(UChar)entry;
+                    *target++=(char16_t)entry;
                     if(offsets!=nullptr) {
                         *offsets++=sourceIndex;
                     }
@@ -2701,7 +2701,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
             }
         } else if(action==MBCS_STATE_VALID_DIRECT_16) {
             /* output BMP code point */
-            *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             if(offsets!=nullptr) {
                 *offsets++=sourceIndex;
             }
@@ -2718,7 +2718,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
                 byteIndex=0;
             } else if(UCNV_TO_U_USE_FALLBACK(cnv) ? c<=0xdfff : c<=0xdbff) {
                 /* output roundtrip or fallback surrogate pair */
-                *target++=(UChar)(c&0xdbff);
+                *target++=(char16_t)(c&0xdbff);
                 if(offsets!=nullptr) {
                     *offsets++=sourceIndex;
                 }
@@ -2753,12 +2753,12 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         ) {
             entry=MBCS_ENTRY_FINAL_VALUE(entry);
             /* output surrogate pair */
-            *target++=(UChar)(0xd800|(UChar)(entry>>10));
+            *target++=(char16_t)(0xd800|(char16_t)(entry>>10));
             if(offsets!=nullptr) {
                 *offsets++=sourceIndex;
             }
             byteIndex=0;
-            c=(UChar)(0xdc00|(UChar)(entry&0x3ff));
+            c=(char16_t)(0xdc00|(char16_t)(entry&0x3ff));
             if(target<targetLimit) {
                 *target++=c;
                 if(offsets!=nullptr) {
@@ -2793,7 +2793,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
         } else if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
             if(UCNV_TO_U_USE_FALLBACK(cnv)) {
                 /* output BMP code point */
-                *target++=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                *target++=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                 if(offsets!=nullptr) {
                     *offsets++=sourceIndex;
                 }
@@ -2908,7 +2908,7 @@ ucnv_MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs,
 
         if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
             /* output BMP code point */
-            return (UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+            return (char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
         }
 
         /*
@@ -2924,7 +2924,7 @@ ucnv_MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs,
         } else if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
             if(UCNV_TO_U_USE_FALLBACK(cnv)) {
                 /* output BMP code point */
-                return (UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                return (char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
             }
         } else if(action==MBCS_STATE_UNASSIGNED) {
             /* just fall through */
@@ -3054,7 +3054,7 @@ ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
             action=(uint8_t)(MBCS_ENTRY_FINAL_ACTION(entry));
             if(action==MBCS_STATE_VALID_DIRECT_16) {
                 /* output BMP code point */
-                c=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                 break;
             } else if(action==MBCS_STATE_VALID_16) {
                 offset+=MBCS_ENTRY_FINAL_VALUE_16(entry);
@@ -3112,7 +3112,7 @@ ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs,
             } else if(action==MBCS_STATE_FALLBACK_DIRECT_16) {
                 if(UCNV_TO_U_USE_FALLBACK(cnv)) {
                     /* output BMP code point */
-                    c=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                    c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                     break;
                 }
             } else if(action==MBCS_STATE_UNASSIGNED) {
@@ -3213,7 +3213,7 @@ ucnv_MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
 
     if(MBCS_ENTRY_FINAL_IS_VALID_DIRECT_16(entry)) {
         /* output BMP code point */
-        return (UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+        return (char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
     }
 
     /*
@@ -3229,7 +3229,7 @@ ucnv_MBCSSingleSimpleGetNextUChar(UConverterSharedData *sharedData,
             return 0xfffe;
         }
         /* output BMP code point */
-        return (UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+        return (char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
     } else if(action==MBCS_STATE_FALLBACK_DIRECT_20) {
         if(!TO_U_USE_FALLBACK(useFallback)) {
             return 0xfffe;
@@ -3331,7 +3331,7 @@ ucnv_MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
                 break;
             } else if(action==MBCS_STATE_VALID_DIRECT_16) {
                 /* output BMP code point */
-                c=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                 break;
             } else if(action==MBCS_STATE_VALID_16_PAIR) {
                 offset+=MBCS_ENTRY_FINAL_VALUE_16(entry);
@@ -3360,7 +3360,7 @@ ucnv_MBCSSimpleGetNextUChar(UConverterSharedData *sharedData,
                     break;
                 }
                 /* output BMP code point */
-                c=(UChar)MBCS_ENTRY_FINAL_VALUE_16(entry);
+                c=(char16_t)MBCS_ENTRY_FINAL_VALUE_16(entry);
                 break;
             } else if(action==MBCS_STATE_FALLBACK_DIRECT_20) {
                 if(!TO_U_USE_FALLBACK(useFallback)) {
@@ -3406,7 +3406,7 @@ static void
 ucnv_MBCSDoubleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                                   UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
     int32_t *offsets;
@@ -3468,7 +3468,7 @@ ucnv_MBCSDoubleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
         if(targetCapacity>0) {
             /*
              * Get a correct Unicode code point:
-             * a single UChar for a BMP code point or
+             * a single char16_t for a BMP code point or
              * a matched surrogate pair for a "supplementary code point".
              */
             c=*source++;
@@ -3506,7 +3506,7 @@ ucnv_MBCSDoubleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 getTrail:
                         if(source<sourceLimit) {
                             /* test the following code unit */
-                            UChar trail=*source;
+                            char16_t trail=*source;
                             if(U16_IS_TRAIL(trail)) {
                                 ++source;
                                 ++nextSourceIndex;
@@ -3638,7 +3638,7 @@ static void
 ucnv_MBCSSingleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                                   UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
     int32_t *offsets;
@@ -3701,7 +3701,7 @@ ucnv_MBCSSingleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
         if(targetCapacity>0) {
             /*
              * Get a correct Unicode code point:
-             * a single UChar for a BMP code point or
+             * a single char16_t for a BMP code point or
              * a matched surrogate pair for a "supplementary code point".
              */
             c=*source++;
@@ -3711,7 +3711,7 @@ ucnv_MBCSSingleFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 getTrail:
                     if(source<sourceLimit) {
                         /* test the following code unit */
-                        UChar trail=*source;
+                        char16_t trail=*source;
                         if(U16_IS_TRAIL(trail)) {
                             ++source;
                             ++nextSourceIndex;
@@ -3814,7 +3814,7 @@ static void
 ucnv_MBCSSingleFromBMPWithOffsets(UConverterFromUnicodeArgs *pArgs,
                               UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit, *lastSource;
+    const char16_t *source, *sourceLimit, *lastSource;
     uint8_t *target;
     int32_t targetCapacity, length;
     int32_t *offsets;
@@ -3861,7 +3861,7 @@ ucnv_MBCSSingleFromBMPWithOffsets(UConverterFromUnicodeArgs *pArgs,
     lastSource=source;
 
     /*
-     * since the conversion here is 1:1 UChar:uint8_t, we need only one counter
+     * since the conversion here is 1:1 char16_t:uint8_t, we need only one counter
      * for the minimum of the sourceLength and targetCapacity
      */
     length=(int32_t)(sourceLimit-source);
@@ -3926,7 +3926,7 @@ unrolled:
     while(targetCapacity>0) {
         /*
          * Get a correct Unicode code point:
-         * a single UChar for a BMP code point or
+         * a single char16_t for a BMP code point or
          * a matched surrogate pair for a "supplementary code point".
          */
         c=*source++;
@@ -3960,7 +3960,7 @@ unrolled:
 getTrail:
             if(source<sourceLimit) {
                 /* test the following code unit */
-                UChar trail=*source;
+                char16_t trail=*source;
                 if(U16_IS_TRAIL(trail)) {
                     ++source;
                     c=U16_GET_SUPPLEMENTARY(c, trail);
@@ -4071,7 +4071,7 @@ U_CFUNC void
 ucnv_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                             UErrorCode *pErrorCode) {
     UConverter *cnv;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
     int32_t *offsets;
@@ -4197,7 +4197,7 @@ ucnv_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
         if(targetCapacity>0) {
             /*
              * Get a correct Unicode code point:
-             * a single UChar for a BMP code point or
+             * a single char16_t for a BMP code point or
              * a matched surrogate pair for a "supplementary code point".
              */
             c=*source++;
@@ -4390,7 +4390,7 @@ ucnv_MBCSFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 getTrail:
                         if(source<sourceLimit) {
                             /* test the following code unit */
-                            UChar trail=*source;
+                            char16_t trail=*source;
                             if(U16_IS_TRAIL(trail)) {
                                 ++source;
                                 ++nextSourceIndex;
@@ -5257,8 +5257,8 @@ moreBytes:
                  * If we have a partial match on c, we will return and revert
                  * to UTF-8->UTF-16->charset conversion.
                  */
-                static const UChar nul=0;
-                const UChar *noSource=&nul;
+                static const char16_t nul=0;
+                const char16_t *noSource=&nul;
                 c=_extFromU(cnv, cnv->sharedData,
                             c, &noSource, noSource,
                             &target, target+targetCapacity,
@@ -5560,8 +5560,8 @@ unassigned:
                  * If we have a partial match on c, we will return and revert
                  * to UTF-8->UTF-16->charset conversion.
                  */
-                static const UChar nul=0;
-                const UChar *noSource=&nul;
+                static const char16_t nul=0;
+                const char16_t *noSource=&nul;
                 c=_extFromU(cnv, cnv->sharedData,
                             c, &noSource, noSource,
                             &target, target+targetCapacity,
index 7faccd35baac018c22c1d5bf5bb7b3984150c041..fa963b04151ee8a394039c5a7fade44766063b0a 100644 (file)
@@ -234,8 +234,8 @@ _SCSUToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
     UConverter *cnv;
     SCSUData *scsu;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     int32_t *offsets;
     UBool isSingleByteMode;
     uint8_t state, byteOne;
@@ -294,7 +294,7 @@ fastSingle:
                 ++nextSourceIndex;
                 if(b<=0x7f) {
                     /* write US-ASCII graphic character or DEL */
-                    *target++=(UChar)b;
+                    *target++=(char16_t)b;
                     if(offsets!=nullptr) {
                         *offsets++=sourceIndex;
                     }
@@ -302,15 +302,15 @@ fastSingle:
                     /* write from dynamic window */
                     uint32_t c=scsu->toUDynamicOffsets[dynamicWindow]+(b&0x7f);
                     if(c<=0xffff) {
-                        *target++=(UChar)c;
+                        *target++=(char16_t)c;
                         if(offsets!=nullptr) {
                             *offsets++=sourceIndex;
                         }
                     } else {
                         /* output surrogate pair */
-                        *target++=(UChar)(0xd7c0+(c>>10));
+                        *target++=(char16_t)(0xd7c0+(c>>10));
                         if(target<targetLimit) {
-                            *target++=(UChar)(0xdc00|(c&0x3ff));
+                            *target++=(char16_t)(0xdc00|(c&0x3ff));
                             if(offsets!=nullptr) {
                                 *offsets++=sourceIndex;
                                 *offsets++=sourceIndex;
@@ -320,7 +320,7 @@ fastSingle:
                             if(offsets!=nullptr) {
                                 *offsets++=sourceIndex;
                             }
-                            cnv->UCharErrorBuffer[0]=(UChar)(0xdc00|(c&0x3ff));
+                            cnv->UCharErrorBuffer[0]=(char16_t)(0xdc00|(c&0x3ff));
                             cnv->UCharErrorBufferLength=1;
                             *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
                             goto endloop;
@@ -347,7 +347,7 @@ singleByteMode:
                 /* here: b<0x20 because otherwise we would be in fastSingle */
                 if((1UL<<b)&0x2601 /* binary 0010 0110 0000 0001, check for b==0xd || b==0xa || b==9 || b==0 */) {
                     /* CR/LF/TAB/NUL */
-                    *target++=(UChar)b;
+                    *target++=(char16_t)b;
                     if(offsets!=nullptr) {
                         *offsets++=sourceIndex;
                     }
@@ -392,7 +392,7 @@ singleByteMode:
                 state=quotePairTwo;
                 break;
             case quotePairTwo:
-                *target++=(UChar)((byteOne<<8)|b);
+                *target++=(char16_t)((byteOne<<8)|b);
                 if(offsets!=nullptr) {
                     *offsets++=sourceIndex;
                 }
@@ -402,7 +402,7 @@ singleByteMode:
             case quoteOne:
                 if(b<0x80) {
                     /* all static offsets are in the BMP */
-                    *target++=(UChar)(staticOffsets[quoteWindow]+b);
+                    *target++=(char16_t)(staticOffsets[quoteWindow]+b);
                     if(offsets!=nullptr) {
                         *offsets++=sourceIndex;
                     }
@@ -410,15 +410,15 @@ singleByteMode:
                     /* write from dynamic window */
                     uint32_t c=scsu->toUDynamicOffsets[quoteWindow]+(b&0x7f);
                     if(c<=0xffff) {
-                        *target++=(UChar)c;
+                        *target++=(char16_t)c;
                         if(offsets!=nullptr) {
                             *offsets++=sourceIndex;
                         }
                     } else {
                         /* output surrogate pair */
-                        *target++=(UChar)(0xd7c0+(c>>10));
+                        *target++=(char16_t)(0xd7c0+(c>>10));
                         if(target<targetLimit) {
-                            *target++=(UChar)(0xdc00|(c&0x3ff));
+                            *target++=(char16_t)(0xdc00|(c&0x3ff));
                             if(offsets!=nullptr) {
                                 *offsets++=sourceIndex;
                                 *offsets++=sourceIndex;
@@ -428,7 +428,7 @@ singleByteMode:
                             if(offsets!=nullptr) {
                                 *offsets++=sourceIndex;
                             }
-                            cnv->UCharErrorBuffer[0]=(UChar)(0xdc00|(c&0x3ff));
+                            cnv->UCharErrorBuffer[0]=(char16_t)(0xdc00|(c&0x3ff));
                             cnv->UCharErrorBufferLength=1;
                             *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
                             goto endloop;
@@ -478,7 +478,7 @@ singleByteMode:
         if(state==readCommand) {
 fastUnicode:
             while(source+1<sourceLimit && target<targetLimit && (uint8_t)((b=*source)-UC0)>(Urs-UC0)) {
-                *target++=(UChar)((b<<8)|source[1]);
+                *target++=(char16_t)((b<<8)|source[1]);
                 if(offsets!=nullptr) {
                     *offsets++=sourceIndex;
                 }
@@ -542,7 +542,7 @@ fastUnicode:
                 state=quotePairTwo;
                 break;
             case quotePairTwo:
-                *target++=(UChar)((byteOne<<8)|b);
+                *target++=(char16_t)((byteOne<<8)|b);
                 if(offsets!=nullptr) {
                     *offsets++=sourceIndex;
                 }
@@ -588,8 +588,8 @@ _SCSUToUnicode(UConverterToUnicodeArgs *pArgs,
     UConverter *cnv;
     SCSUData *scsu;
     const uint8_t *source, *sourceLimit;
-    UChar *target;
-    const UChar *targetLimit;
+    char16_t *target;
+    const char16_t *targetLimit;
     UBool isSingleByteMode;
     uint8_t state, byteOne;
     int8_t quoteWindow, dynamicWindow;
@@ -639,20 +639,20 @@ fastSingle:
                 ++source;
                 if(b<=0x7f) {
                     /* write US-ASCII graphic character or DEL */
-                    *target++=(UChar)b;
+                    *target++=(char16_t)b;
                 } else {
                     /* write from dynamic window */
                     uint32_t c=scsu->toUDynamicOffsets[dynamicWindow]+(b&0x7f);
                     if(c<=0xffff) {
-                        *target++=(UChar)c;
+                        *target++=(char16_t)c;
                     } else {
                         /* output surrogate pair */
-                        *target++=(UChar)(0xd7c0+(c>>10));
+                        *target++=(char16_t)(0xd7c0+(c>>10));
                         if(target<targetLimit) {
-                            *target++=(UChar)(0xdc00|(c&0x3ff));
+                            *target++=(char16_t)(0xdc00|(c&0x3ff));
                         } else {
                             /* target overflow */
-                            cnv->UCharErrorBuffer[0]=(UChar)(0xdc00|(c&0x3ff));
+                            cnv->UCharErrorBuffer[0]=(char16_t)(0xdc00|(c&0x3ff));
                             cnv->UCharErrorBufferLength=1;
                             *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
                             goto endloop;
@@ -677,7 +677,7 @@ singleByteMode:
                 /* here: b<0x20 because otherwise we would be in fastSingle */
                 if((1UL<<b)&0x2601 /* binary 0010 0110 0000 0001, check for b==0xd || b==0xa || b==9 || b==0 */) {
                     /* CR/LF/TAB/NUL */
-                    *target++=(UChar)b;
+                    *target++=(char16_t)b;
                     goto fastSingle;
                 } else if(SC0<=b) {
                     if(b<=SC7) {
@@ -716,26 +716,26 @@ singleByteMode:
                 state=quotePairTwo;
                 break;
             case quotePairTwo:
-                *target++=(UChar)((byteOne<<8)|b);
+                *target++=(char16_t)((byteOne<<8)|b);
                 state=readCommand;
                 goto fastSingle;
             case quoteOne:
                 if(b<0x80) {
                     /* all static offsets are in the BMP */
-                    *target++=(UChar)(staticOffsets[quoteWindow]+b);
+                    *target++=(char16_t)(staticOffsets[quoteWindow]+b);
                 } else {
                     /* write from dynamic window */
                     uint32_t c=scsu->toUDynamicOffsets[quoteWindow]+(b&0x7f);
                     if(c<=0xffff) {
-                        *target++=(UChar)c;
+                        *target++=(char16_t)c;
                     } else {
                         /* output surrogate pair */
-                        *target++=(UChar)(0xd7c0+(c>>10));
+                        *target++=(char16_t)(0xd7c0+(c>>10));
                         if(target<targetLimit) {
-                            *target++=(UChar)(0xdc00|(c&0x3ff));
+                            *target++=(char16_t)(0xdc00|(c&0x3ff));
                         } else {
                             /* target overflow */
-                            cnv->UCharErrorBuffer[0]=(UChar)(0xdc00|(c&0x3ff));
+                            cnv->UCharErrorBuffer[0]=(char16_t)(0xdc00|(c&0x3ff));
                             cnv->UCharErrorBufferLength=1;
                             *pErrorCode=U_BUFFER_OVERFLOW_ERROR;
                             goto endloop;
@@ -782,7 +782,7 @@ singleByteMode:
         if(state==readCommand) {
 fastUnicode:
             while(source+1<sourceLimit && target<targetLimit && (uint8_t)((b=*source)-UC0)>(Urs-UC0)) {
-                *target++=(UChar)((b<<8)|source[1]);
+                *target++=(char16_t)((b<<8)|source[1]);
                 source+=2;
             }
         }
@@ -839,7 +839,7 @@ fastUnicode:
                 state=quotePairTwo;
                 break;
             case quotePairTwo:
-                *target++=(UChar)((byteOne<<8)|b);
+                *target++=(char16_t)((byteOne<<8)|b);
                 state=readCommand;
                 goto fastUnicode;
             }
@@ -1012,7 +1012,7 @@ _SCSUFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
                             UErrorCode *pErrorCode) {
     UConverter *cnv;
     SCSUData *scsu;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
     int32_t *offsets;
@@ -1029,7 +1029,7 @@ _SCSUFromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
 
     /* variables for compression heuristics */
     uint32_t offset;
-    UChar lead, trail;
+    char16_t lead, trail;
     int code;
     int8_t window;
 
@@ -1104,7 +1104,7 @@ loop:
             } else if(U16_IS_SURROGATE(c)) {
                 if(U16_IS_SURROGATE_LEAD(c)) {
 getTrailSingle:
-                    lead=(UChar)c;
+                    lead=(char16_t)c;
                     if(source<sourceLimit) {
                         /* test the following code unit */
                         trail=*source;
@@ -1301,7 +1301,7 @@ getTrailSingle:
                 /* c is a surrogate */
                 if(U16_IS_SURROGATE_LEAD(c)) {
 getTrailUnicode:
-                    lead=(UChar)c;
+                    lead=(char16_t)c;
                     if(source<sourceLimit) {
                         /* test the following code unit */
                         trail=*source;
@@ -1520,7 +1520,7 @@ _SCSUFromUnicode(UConverterFromUnicodeArgs *pArgs,
                  UErrorCode *pErrorCode) {
     UConverter *cnv;
     SCSUData *scsu;
-    const UChar *source, *sourceLimit;
+    const char16_t *source, *sourceLimit;
     uint8_t *target;
     int32_t targetCapacity;
 
@@ -1534,7 +1534,7 @@ _SCSUFromUnicode(UConverterFromUnicodeArgs *pArgs,
 
     /* variables for compression heuristics */
     uint32_t offset;
-    UChar lead, trail;
+    char16_t lead, trail;
     int code;
     int8_t window;
 
@@ -1594,7 +1594,7 @@ loop:
             } else if(U16_IS_SURROGATE(c)) {
                 if(U16_IS_SURROGATE_LEAD(c)) {
 getTrailSingle:
-                    lead=(UChar)c;
+                    lead=(char16_t)c;
                     if(source<sourceLimit) {
                         /* test the following code unit */
                         trail=*source;
@@ -1778,7 +1778,7 @@ getTrailSingle:
                 /* c is a surrogate */
                 if(U16_IS_SURROGATE_LEAD(c)) {
 getTrailUnicode:
-                    lead=(UChar)c;
+                    lead=(char16_t)c;
                     if(source<sourceLimit) {
                         /* test the following code unit */
                         trail=*source;
@@ -2027,7 +2027,7 @@ static const UConverterStaticData _SCSUStaticData={
     "SCSU",
     1212, /* CCSID for SCSU */
     UCNV_IBM, UCNV_SCSU,
-    1, 3, /* one UChar generates at least 1 byte and at most 3 bytes */
+    1, 3, /* one char16_t generates at least 1 byte and at most 3 bytes */
     /*
      * The subchar here is ignored because _SCSUOpen() sets U+fffd as a Unicode
      * substitution string.
index 63b7a7cc60de9161d6dc0d8c43bab64591945802..a286646395b30f920ea93c6f8b429300db35a213 100644 (file)
@@ -741,7 +741,7 @@ static UEnumeration *selectForMask(const UConverterSelector* sel,
 /* check a string against the selector - UTF16 version */
 U_CAPI UEnumeration * U_EXPORT2
 ucnvsel_selectForString(const UConverterSelector* sel,
-                        const UChar *s, int32_t length, UErrorCode *status) {
+                        const char16_t *s, int32_t length, UErrorCode *status) {
   // check if already failed
   if (U_FAILURE(*status)) {
     return nullptr;
@@ -761,7 +761,7 @@ ucnvsel_selectForString(const UConverterSelector* sel,
   uprv_memset(mask, ~0, columns *4);
 
   if(s!=nullptr) {
-    const UChar *limit;
+    const char16_t *limit;
     if (length >= 0) {
       limit = s + length;
     } else {
index 83f54abba133ab06c1b302a15cebd5ff53291c26..28cf94ffc83617523bf8ed7c40101813fe7fcf33 100644 (file)
@@ -43,7 +43,7 @@ typedef struct {
       uint32_t magic;            /* magic number - lets us know whether reserved data is reset or junked */
       uint32_t mappingPosition;  /* const uint8_t *mappingPosition; */
       uint32_t expansion;        /* uint32_t *expansion;            */
-      uint32_t contractionIndex; /* UChar *contractionIndex;        */
+      uint32_t contractionIndex; /* char16_t *contractionIndex;        */
       uint32_t contractionCEs;   /* uint32_t *contractionCEs;       */
       uint32_t contractionSize;  /* needed for various closures */
       /*int32_t latinOneMapping;*/ /* this is now handled in the trie itself *//* fast track to latin1 chars      */
@@ -60,7 +60,7 @@ typedef struct {
                                     /*   in contractions.               */
 
       int32_t contractionUCACombosSize;     /* number of UCA contraction items. */
-                                            /*Length is contractionUCACombosSize*contractionUCACombosWidth*sizeof(UChar) */
+                                            /*Length is contractionUCACombosSize*contractionUCACombosWidth*sizeof(char16_t) */
       UBool jamoSpecial;                    /* is jamoSpecial */
       UBool isBigEndian;                    /* is this data big endian? from the UDataInfo header*/
       uint8_t charSetFamily;                /* what is the charset family of this data from the UDataInfo header*/
index 4b1a857fcfe9c2696ff01c62339d3f7f3c18f93b..324b257c474b7cb8d19f579d397965a4aaf10fe1 100644 (file)
@@ -204,7 +204,7 @@ swapFormatVersion3(const UDataSwapper *ds,
 
         /* swap the contractions */
         if(header.contractionSize!=0) {
-            /* contractionIndex: UChar[] */
+            /* contractionIndex: char16_t[] */
             ds->swapArray16(ds, inBytes+header.contractionIndex, header.contractionSize*2,
                                outBytes+header.contractionIndex, pErrorCode);
 
index cde8ec3ba7de7f8360a10484ed69fe1a32f4568e..9d79d4d9af026eec5f6bd6b0c5ccc915b876f55b 100644 (file)
@@ -49,7 +49,7 @@ using namespace icu;
 #endif
 
 typedef struct IsoCodeEntry {
-    const UChar *isoCode; /* const because it's a reference to a resource bundle string. */
+    const char16_t *isoCode; /* const because it's a reference to a resource bundle string. */
     UDate from;
     UDate to;
 } IsoCodeEntry;
@@ -272,11 +272,11 @@ deleteUnicode(void *obj) {
 }
 
 /**
- * Unfortunately, we have to convert the UChar* currency code to char*
+ * Unfortunately, we have to convert the char16_t* currency code to char*
  * to use it as a resource key.
  */
 static inline char*
-myUCharsToChars(char* resultOfLen4, const UChar* currency) {
+myUCharsToChars(char* resultOfLen4, const char16_t* currency) {
     u_UCharsToChars(currency, resultOfLen4, ISO_CURRENCY_CODE_LENGTH);
     resultOfLen4[ISO_CURRENCY_CODE_LENGTH] = 0;
     return resultOfLen4;
@@ -291,7 +291,7 @@ myUCharsToChars(char* resultOfLen4, const UChar* currency) {
  * and cashRounding ).
  */
 static const int32_t*
-_findMetaData(const UChar* currency, UErrorCode& ec) {
+_findMetaData(const char16_t* currency, UErrorCode& ec) {
 
     if (currency == 0 || *currency == 0) {
         if (U_SUCCESS(ec)) {
@@ -372,10 +372,10 @@ static CReg* gCRegHead = 0;
 
 struct CReg : public icu::UMemory {
     CReg *next;
-    UChar iso[ISO_CURRENCY_CODE_LENGTH+1];
+    char16_t iso[ISO_CURRENCY_CODE_LENGTH+1];
     char  id[ULOC_FULLNAME_CAPACITY];
 
-    CReg(const UChar* _iso, const char* _id)
+    CReg(const char16_t* _iso, const char* _id)
         : next(0)
     {
         int32_t len = (int32_t)uprv_strlen(_id);
@@ -388,7 +388,7 @@ struct CReg : public icu::UMemory {
         iso[ISO_CURRENCY_CODE_LENGTH] = 0;
     }
 
-    static UCurrRegistryKey reg(const UChar* _iso, const char* _id, UErrorCode* status)
+    static UCurrRegistryKey reg(const char16_t* _iso, const char* _id, UErrorCode* status)
     {
         if (status && U_SUCCESS(*status) && _iso && _id) {
             CReg* n = new CReg(_iso, _id);
@@ -427,8 +427,8 @@ struct CReg : public icu::UMemory {
         return found;
     }
 
-    static const UChar* get(const char* id) {
-        const UChar* result = nullptr;
+    static const char16_t* get(const char* id) {
+        const char16_t* result = nullptr;
         umtx_lock(&gCRegLock);
         CReg* p = gCRegHead;
 
@@ -458,7 +458,7 @@ struct CReg : public icu::UMemory {
 // -------------------------------------
 
 U_CAPI UCurrRegistryKey U_EXPORT2
-ucurr_register(const UChar* isoCode, const char* locale, UErrorCode *status)
+ucurr_register(const char16_t* isoCode, const char* locale, UErrorCode *status)
 {
     if (status && U_SUCCESS(*status)) {
         char id[ULOC_FULLNAME_CAPACITY];
@@ -511,7 +511,7 @@ U_CDECL_END
 
 U_CAPI int32_t U_EXPORT2
 ucurr_forLocale(const char* locale,
-                UChar* buff,
+                char16_t* buff,
                 int32_t buffCapacity,
                 UErrorCode* ec) {
     if (U_FAILURE(*ec)) { return 0; }
@@ -540,7 +540,7 @@ ucurr_forLocale(const char* locale,
     }
 
 #if !UCONFIG_NO_SERVICE
-    const UChar* result = CReg::get(id);
+    const char16_t* result = CReg::get(id);
     if (result) {
         if(buffCapacity > u_strlen(result)) {
             u_strcpy(buff, result);
@@ -555,7 +555,7 @@ ucurr_forLocale(const char* locale,
         idDelim[0] = 0;
     }
 
-    const UChar* s = nullptr;  // Currency code from data file.
+    const char16_t* s = nullptr;  // Currency code from data file.
     if (id[0] == 0) {
         // No point looking in the data for an empty string.
         // This is what we would get.
@@ -575,7 +575,7 @@ ucurr_forLocale(const char* locale,
                     ures_getByIndex(countryArray, i, nullptr, &localStatus));
                 // The currency is legal tender if it is *not* marked with tender{"false"}.
                 UErrorCode tenderStatus = localStatus;
-                const UChar *tender =
+                const char16_t *tender =
                     ures_getStringByKey(currencyReq.getAlias(), "tender", nullptr, &tenderStatus);
                 bool isTender = U_FAILURE(tenderStatus) || u_strcmp(tender, u"false") != 0;
                 if (!isTender && s != nullptr) {
@@ -650,8 +650,8 @@ static UBool fallback(char *loc) {
 }
 
 
-U_CAPI const UChar* U_EXPORT2
-ucurr_getName(const UChar* currency,
+U_CAPI const char16_t* U_EXPORT2
+ucurr_getName(const char16_t* currency,
               const char* locale,
               UCurrNameStyle nameStyle,
               UBool* isChoiceFormat, // fillin
@@ -705,7 +705,7 @@ ucurr_getName(const UChar* currency,
     /* Normalize the keyword value to uppercase */
     T_CString_toUpperCase(buf);
     
-    const UChar* s = nullptr;
+    const char16_t* s = nullptr;
     ec2 = U_ZERO_ERROR;
     LocalUResourceBundlePointer rb(ures_open(U_ICUDATA_CURR, loc, &ec2));
 
@@ -765,8 +765,8 @@ ucurr_getName(const UChar* currency,
     return currency;
 }
 
-U_CAPI const UChar* U_EXPORT2
-ucurr_getPluralName(const UChar* currency,
+U_CAPI const char16_t* U_EXPORT2
+ucurr_getPluralName(const char16_t* currency,
                     const char* locale,
                     UBool* isChoiceFormat,
                     const char* pluralCount,
@@ -801,7 +801,7 @@ ucurr_getPluralName(const UChar* currency,
     char buf[ISO_CURRENCY_CODE_LENGTH+1];
     myUCharsToChars(buf, currency);
 
-    const UChar* s = nullptr;
+    const char16_t* s = nullptr;
     ec2 = U_ZERO_ERROR;
     UResourceBundle* rb = ures_open(U_ICUDATA_CURR, loc, &ec2);
 
@@ -852,7 +852,7 @@ ucurr_getPluralName(const UChar* currency,
 
 typedef struct {
     const char* IsoCode;  // key
-    UChar* currencyName;  // value
+    char16_t* currencyName;  // value
     int32_t currencyNameLen;  // value length
     int32_t flag;  // flags
 } CurrencyNameStruct;
@@ -903,7 +903,7 @@ getCurrencyNameCount(const char* loc, int32_t* total_currency_name_count, int32_
     U_NAMESPACE_USE
     *total_currency_name_count = 0;
     *total_currency_symbol_count = 0;
-    const UChar* s = nullptr;
+    const char16_t* s = nullptr;
     char locale[ULOC_FULLNAME_CAPACITY] = "";
     uprv_strcpy(locale, loc);
     const icu::Hashtable *currencySymbolsEquiv = getCurrSymbolsEquiv();
@@ -945,14 +945,14 @@ getCurrencyNameCount(const char* loc, int32_t* total_currency_name_count, int32_
     }
 }
 
-static UChar* 
-toUpperCase(const UChar* source, int32_t len, const char* locale) {
-    UChar* dest = nullptr;
+static char16_t*
+toUpperCase(const char16_t* source, int32_t len, const char* locale) {
+    char16_t* dest = nullptr;
     UErrorCode ec = U_ZERO_ERROR;
     int32_t destLen = u_strToUpper(dest, 0, source, len, locale, &ec);
 
     ec = U_ZERO_ERROR;
-    dest = (UChar*)uprv_malloc(sizeof(UChar) * MAX(destLen, len));
+    dest = (char16_t*)uprv_malloc(sizeof(char16_t) * MAX(destLen, len));
     u_strToUpper(dest, destLen, source, len, locale, &ec);
     if (U_FAILURE(ec)) {
         u_memcpy(dest, source, len);
@@ -999,7 +999,7 @@ collectCurrencyNames(const char* locale,
 
     if (U_FAILURE(ec)) return;
 
-    const UChar* s = nullptr;  // currency name
+    const char16_t* s = nullptr;  // currency name
     char* iso = nullptr;  // currency ISO code
 
     *total_currency_name_count = 0;
@@ -1035,7 +1035,7 @@ collectCurrencyNames(const char* locale,
             }
             // Add currency symbol.
             (*currencySymbols)[*total_currency_symbol_count].IsoCode = iso;
-            (*currencySymbols)[*total_currency_symbol_count].currencyName = (UChar*)s;
+            (*currencySymbols)[*total_currency_symbol_count].currencyName = (char16_t*)s;
             (*currencySymbols)[*total_currency_symbol_count].flag = 0;
             (*currencySymbols)[(*total_currency_symbol_count)++].currencyNameLen = len;
             // Add equivalent symbols
@@ -1046,7 +1046,7 @@ collectCurrencyNames(const char* locale,
                 while ((symbol = iter.next()) != nullptr) {
                     (*currencySymbols)[*total_currency_symbol_count].IsoCode = iso;
                     (*currencySymbols)[*total_currency_symbol_count].currencyName =
-                        const_cast<UChar*>(symbol->getBuffer());
+                        const_cast<char16_t*>(symbol->getBuffer());
                     (*currencySymbols)[*total_currency_symbol_count].flag = 0;
                     (*currencySymbols)[(*total_currency_symbol_count)++].currencyNameLen = symbol->length();
                 }
@@ -1055,7 +1055,7 @@ collectCurrencyNames(const char* locale,
             // Add currency long name.
             s = ures_getStringByIndex(names, UCURR_LONG_NAME, &len, &ec2);
             (*currencyNames)[*total_currency_name_count].IsoCode = iso;
-            UChar* upperName = toUpperCase(s, len, locale);
+            char16_t* upperName = toUpperCase(s, len, locale);
             (*currencyNames)[*total_currency_name_count].currencyName = upperName;
             (*currencyNames)[*total_currency_name_count].flag = NEED_TO_BE_DELETED;
             (*currencyNames)[(*total_currency_name_count)++].currencyNameLen = len;
@@ -1063,7 +1063,7 @@ collectCurrencyNames(const char* locale,
             // put (iso, 3, and iso) in to array
             // Add currency ISO code.
             (*currencySymbols)[*total_currency_symbol_count].IsoCode = iso;
-            (*currencySymbols)[*total_currency_symbol_count].currencyName = (UChar*)uprv_malloc(sizeof(UChar)*3);
+            (*currencySymbols)[*total_currency_symbol_count].currencyName = (char16_t*)uprv_malloc(sizeof(char16_t)*3);
             // Must convert iso[] into Unicode
             u_charsToUChars(iso, (*currencySymbols)[*total_currency_symbol_count].currencyName, 3);
             (*currencySymbols)[*total_currency_symbol_count].flag = NEED_TO_BE_DELETED;
@@ -1097,7 +1097,7 @@ collectCurrencyNames(const char* locale,
                 // currency long name?
                 s = ures_getStringByIndex(names, j, &len, &ec5);
                 (*currencyNames)[*total_currency_name_count].IsoCode = iso;
-                UChar* upperName = toUpperCase(s, len, locale);
+                char16_t* upperName = toUpperCase(s, len, locale);
                 (*currencyNames)[*total_currency_name_count].currencyName = upperName;
                 (*currencyNames)[*total_currency_name_count].flag = NEED_TO_BE_DELETED;
                 (*currencyNames)[(*total_currency_name_count)++].currencyNameLen = len;
@@ -1164,7 +1164,7 @@ collectCurrencyNames(const char* locale,
 static int32_t
 binarySearch(const CurrencyNameStruct* currencyNames, 
              int32_t indexInCurrencyNames,
-             const UChar key,
+             const char16_t key,
              int32_t* begin, int32_t* end) {
 #ifdef UCURR_DEBUG
     printf("key = %x\n", key);
@@ -1278,14 +1278,14 @@ binarySearch(const CurrencyNameStruct* currencyNames,
 static void
 linearSearch(const CurrencyNameStruct* currencyNames, 
              int32_t begin, int32_t end,
-             const UChar* text, int32_t textLen,
+             const char16_t* text, int32_t textLen,
              int32_t *partialMatchLen,
              int32_t *maxMatchLen, int32_t* maxMatchIndex) {
     int32_t initialPartialMatchLen = *partialMatchLen;
     for (int32_t index = begin; index <= end; ++index) {
         int32_t len = currencyNames[index].currencyNameLen;
         if (len > *maxMatchLen && len <= textLen &&
-            uprv_memcmp(currencyNames[index].currencyName, text, len * sizeof(UChar)) == 0) {
+            uprv_memcmp(currencyNames[index].currencyName, text, len * sizeof(char16_t)) == 0) {
             *partialMatchLen = MAX(*partialMatchLen, len);
             *maxMatchIndex = index;
             *maxMatchLen = len;
@@ -1317,7 +1317,7 @@ linearSearch(const CurrencyNameStruct* currencyNames,
 static void
 searchCurrencyName(const CurrencyNameStruct* currencyNames, 
                    int32_t total_currency_count,
-                   const UChar* text, int32_t textLen,
+                   const char16_t* text, int32_t textLen,
                    int32_t *partialMatchLen,
                    int32_t* maxMatchLen, int32_t* maxMatchIndex) {
     *maxMatchIndex = -1;
@@ -1523,7 +1523,7 @@ uprv_parseCurrency(const char* locale,
                    icu::ParsePosition& pos,
                    int8_t type,
                    int32_t* partialMatchLen,
-                   UChar* result,
+                   char16_t* result,
                    UErrorCode& ec) {
     U_NAMESPACE_USE
     if (U_FAILURE(ec)) {
@@ -1541,8 +1541,8 @@ uprv_parseCurrency(const char* locale,
 
     int32_t start = pos.getIndex();
 
-    UChar inputText[MAX_CURRENCY_NAME_LEN];  
-    UChar upperText[MAX_CURRENCY_NAME_LEN];  
+    char16_t inputText[MAX_CURRENCY_NAME_LEN];
+    char16_t upperText[MAX_CURRENCY_NAME_LEN];
     int32_t textLen = MIN(MAX_CURRENCY_NAME_LEN, text.length() - start);
     text.extract(start, textLen, inputText);
     UErrorCode ec1 = U_ZERO_ERROR;
@@ -1630,13 +1630,13 @@ void uprv_currencyLeads(const char* locale, icu::UnicodeSet& result, UErrorCode&
  * DecimalFormat and DecimalFormatSymbols.
  */
 U_CAPI void
-uprv_getStaticCurrencyName(const UChar* iso, const char* loc,
+uprv_getStaticCurrencyName(const char16_t* iso, const char* loc,
                            icu::UnicodeString& result, UErrorCode& ec)
 {
     U_NAMESPACE_USE
 
     int32_t len;
-    const UChar* currname = ucurr_getName(iso, loc, UCURR_SYMBOL_NAME,
+    const char16_t* currname = ucurr_getName(iso, loc, UCURR_SYMBOL_NAME,
                                           nullptr /* isChoiceFormat */, &len, &ec);
     if (U_SUCCESS(ec)) {
         result.setTo(currname, len);
@@ -1644,12 +1644,12 @@ uprv_getStaticCurrencyName(const UChar* iso, const char* loc,
 }
 
 U_CAPI int32_t U_EXPORT2
-ucurr_getDefaultFractionDigits(const UChar* currency, UErrorCode* ec) {
+ucurr_getDefaultFractionDigits(const char16_t* currency, UErrorCode* ec) {
     return ucurr_getDefaultFractionDigitsForUsage(currency,UCURR_USAGE_STANDARD,ec);
 }
 
 U_CAPI int32_t U_EXPORT2
-ucurr_getDefaultFractionDigitsForUsage(const UChar* currency, const UCurrencyUsage usage, UErrorCode* ec) {
+ucurr_getDefaultFractionDigitsForUsage(const char16_t* currency, const UCurrencyUsage usage, UErrorCode* ec) {
     int32_t fracDigits = 0;
     if (U_SUCCESS(*ec)) {
         switch (usage) {
@@ -1667,12 +1667,12 @@ ucurr_getDefaultFractionDigitsForUsage(const UChar* currency, const UCurrencyUsa
 }
 
 U_CAPI double U_EXPORT2
-ucurr_getRoundingIncrement(const UChar* currency, UErrorCode* ec) {
+ucurr_getRoundingIncrement(const char16_t* currency, UErrorCode* ec) {
     return ucurr_getRoundingIncrementForUsage(currency, UCURR_USAGE_STANDARD, ec);
 }
 
 U_CAPI double U_EXPORT2
-ucurr_getRoundingIncrementForUsage(const UChar* currency, const UCurrencyUsage usage, UErrorCode* ec) {
+ucurr_getRoundingIncrementForUsage(const char16_t* currency, const UCurrencyUsage usage, UErrorCode* ec) {
     double result = 0.0;
 
     const int32_t *data = _findMetaData(currency, *ec);
@@ -2119,7 +2119,7 @@ ucurr_createCurrencyList(UHashtable *isoCodes, UErrorCode* status){
                     if (idRes == nullptr) {
                         continue;
                     }
-                    const UChar *isoCode = ures_getString(idRes, &isoLength, &localStatus);
+                    const char16_t *isoCode = ures_getString(idRes, &isoLength, &localStatus);
 
                     // get from date
                     UDate fromDate = U_DATE_MIN;
@@ -2156,7 +2156,7 @@ ucurr_createCurrencyList(UHashtable *isoCodes, UErrorCode* status){
                     entry->to = toDate;
 
                     localStatus = U_ZERO_ERROR;
-                    uhash_put(isoCodes, (UChar *)isoCode, entry, &localStatus);
+                    uhash_put(isoCodes, (char16_t *)isoCode, entry, &localStatus);
                 }
             } else {
                 *status = localStatus;
@@ -2242,7 +2242,7 @@ static void U_CALLCONV initCurrSymbolsEquiv() {
 }
 
 U_CAPI UBool U_EXPORT2
-ucurr_isAvailable(const UChar* isoCode, UDate from, UDate to, UErrorCode* eErrorCode) {
+ucurr_isAvailable(const char16_t* isoCode, UDate from, UDate to, UErrorCode* eErrorCode) {
     umtx_initOnce(gIsoCodesInitOnce, &initIsoCodes, *eErrorCode);
     if (U_FAILURE(*eErrorCode)) {
         return false;
@@ -2399,13 +2399,13 @@ U_CAPI int32_t U_EXPORT2
 ucurr_forLocaleAndDate(const char* locale, 
                 UDate date, 
                 int32_t index,
-                UChar* buff, 
+                char16_t* buff,
                 int32_t buffCapacity, 
                 UErrorCode* ec)
 {
     int32_t resLen = 0;
        int32_t currIndex = 0;
-    const UChar* s = nullptr;
+    const char16_t* s = nullptr;
 
     if (ec != nullptr && U_SUCCESS(*ec))
     {
@@ -2624,7 +2624,7 @@ U_CAPI UEnumeration *U_EXPORT2 ucurr_getKeywordValuesForLocale(const char *key,
             /* optimize - use the utf-8 string */
 #else
             {
-                       const UChar* defString = ures_getStringByKey(&curbndl, "id", &curIDLength, status);
+                       const char16_t* defString = ures_getStringByKey(&curbndl, "id", &curIDLength, status);
                        if(U_SUCCESS(*status)) {
                           if(curIDLength+1 > ULOC_KEYWORDS_CAPACITY) {
                                *status = U_BUFFER_OVERFLOW_ERROR;
@@ -2701,7 +2701,7 @@ U_CAPI UEnumeration *U_EXPORT2 ucurr_getKeywordValuesForLocale(const char *key,
 
 
 U_CAPI int32_t U_EXPORT2
-ucurr_getNumericCode(const UChar* currency) {
+ucurr_getNumericCode(const char16_t* currency) {
     int32_t code = 0;
     if (currency && u_strlen(currency) == ISO_CURRENCY_CODE_LENGTH) {
         UErrorCode status = U_ZERO_ERROR;
index 7f01fe394dbb9083beecd48a39760d753f037ef7..7aab58c44c7fdf7fced5e5e9c3dc5c73dc7ee7e3 100644 (file)
@@ -85,17 +85,17 @@ uenum_count(UEnumeration* en, UErrorCode* status)
 }
 
 /* Don't call this directly. Only uenum_unext should be calling this. */
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 uenum_unextDefault(UEnumeration* en,
             int32_t* resultLength,
             UErrorCode* status)
 {
-    UChar *ustr = nullptr;
+    char16_t *ustr = nullptr;
     int32_t len = 0;
     if (en->next != nullptr) {
         const char *cstr = en->next(en, &len, status);
         if (cstr != nullptr) {
-            ustr = (UChar*) _getBuffer(en, (len+1) * sizeof(UChar));
+            ustr = (char16_t*) _getBuffer(en, (len+1) * sizeof(char16_t));
             if (ustr == nullptr) {
                 *status = U_MEMORY_ALLOCATION_ERROR;
             } else {
@@ -119,7 +119,7 @@ uenum_nextDefault(UEnumeration* en,
 {
     if (en->uNext != nullptr) {
         char *tempCharVal;
-        const UChar *tempUCharVal = en->uNext(en, resultLength, status);
+        const char16_t *tempUCharVal = en->uNext(en, resultLength, status);
         if (tempUCharVal == nullptr) {
             return nullptr;
         }
@@ -137,7 +137,7 @@ uenum_nextDefault(UEnumeration* en,
     }
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 uenum_unext(UEnumeration* en,
             int32_t* resultLength,
             UErrorCode* status)
index d042a882190097dc6e643310fe42a829791e294f..4d92dfa93fe1cd162f60d93d37ed33c8c53715b0 100644 (file)
@@ -928,7 +928,7 @@ uhash_tokp(void* p) {
 
 U_CAPI int32_t U_EXPORT2
 uhash_hashUChars(const UHashTok key) {
-    const UChar *s = (const UChar *)key.pointer;
+    const char16_t *s = (const char16_t *)key.pointer;
     return s == nullptr ? 0 : ustr_hashUCharsN(s, u_strlen(s));
 }
 
@@ -1002,8 +1002,8 @@ uhash_equals(const UHashtable* hash1, const UHashtable* hash2){
 
 U_CAPI UBool U_EXPORT2
 uhash_compareUChars(const UHashTok key1, const UHashTok key2) {
-    const UChar *p1 = (const UChar*) key1.pointer;
-    const UChar *p2 = (const UChar*) key2.pointer;
+    const char16_t *p1 = (const char16_t*) key1.pointer;
+    const char16_t *p2 = (const char16_t*) key2.pointer;
     if (p1 == p2) {
         return true;
     }
index 26cbc3fe4cc970d56b9e887973557c256696431d..949d128f93c5335448238286f2098190dfa4b7b5 100644 (file)
@@ -30,7 +30,7 @@
 #include "sprpimpl.h"
 
 /* it is official IDNA ACE Prefix is "xn--" */
-static const UChar ACE_PREFIX[] ={ 0x0078,0x006E,0x002d,0x002d } ;
+static const char16_t ACE_PREFIX[] ={ 0x0078,0x006E,0x002d,0x002d } ;
 #define ACE_PREFIX_LENGTH 4
 
 #define MAX_LABEL_LENGTH 63
@@ -47,8 +47,8 @@ static const UChar ACE_PREFIX[] ={ 0x0078,0x006E,0x002d,0x002d } ;
 #define CAPITAL_A        0x0041
 #define CAPITAL_Z        0x005A
 
-inline static UChar 
-toASCIILower(UChar ch){
+inline static char16_t
+toASCIILower(char16_t ch){
     if(CAPITAL_A <= ch && ch <= CAPITAL_Z){
         return ch + LOWER_CASE_DELTA;
     }
@@ -56,7 +56,7 @@ toASCIILower(UChar ch){
 }
 
 inline static UBool 
-startsWithPrefix(const UChar* src , int32_t srcLength){
+startsWithPrefix(const char16_t* src , int32_t srcLength){
     if(srcLength < ACE_PREFIX_LENGTH){
         return false;
     }
@@ -71,8 +71,8 @@ startsWithPrefix(const UChar* src , int32_t srcLength){
 
 
 inline static int32_t
-compareCaseInsensitiveASCII(const UChar* s1, int32_t s1Len, 
-                            const UChar* s2, int32_t s2Len){
+compareCaseInsensitiveASCII(const char16_t* s1, int32_t s1Len,
+                            const char16_t* s2, int32_t s2Len){
     
     int32_t minLength;
     int32_t lengthResult;
@@ -92,7 +92,7 @@ compareCaseInsensitiveASCII(const UChar* s1, int32_t s1Len,
         lengthResult = 0;
     }
 
-    UChar c1,c2;
+    char16_t c1,c2;
     int32_t rc;
 
     for(int32_t i =0;/* no condition */;i++) {
@@ -126,7 +126,7 @@ compareCaseInsensitiveASCII(const UChar* s1, int32_t s1Len,
  * @return true if the char is a label separator
  * @stable ICU 2.8
  */
-static inline UBool isLabelSeparator(UChar ch){
+static inline UBool isLabelSeparator(char16_t ch){
     switch(ch){
         case 0x002e:
         case 0x3002:
@@ -142,8 +142,8 @@ static inline UBool isLabelSeparator(UChar ch){
 // if *limit == separator then the length returned does not include 
 // the separtor.
 static inline int32_t
-getNextSeparator(UChar *src, int32_t srcLength,
-                 UChar **limit, UBool *done){
+getNextSeparator(char16_t *src, int32_t srcLength,
+                 char16_t **limit, UBool *done){
     if(srcLength == -1){
         int32_t i;
         for(i=0 ; ;i++){
@@ -174,7 +174,7 @@ getNextSeparator(UChar *src, int32_t srcLength,
         return i;
     }
 }
-static inline UBool isLDHChar(UChar ch){
+static inline UBool isLDHChar(char16_t ch){
     // high runner case
     if(ch>0x007A){
         return false;
@@ -191,8 +191,8 @@ static inline UBool isLDHChar(UChar ch){
 }
 
 static int32_t 
-_internal_toASCII(const UChar* src, int32_t srcLength, 
-                  UChar* dest, int32_t destCapacity,
+_internal_toASCII(const char16_t* src, int32_t srcLength,
+                  char16_t* dest, int32_t destCapacity,
                   int32_t options,
                   UStringPrepProfile* nameprep,
                   UParseError* parseError,
@@ -200,9 +200,9 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
 {
 
     // TODO Revisit buffer handling. The label should not be over 63 ASCII characters. ICU4J may need to be updated too.
-    UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE];
+    char16_t b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE];
     //initialize pointers to stack buffers
-    UChar  *b1 = b1Stack, *b2 = b2Stack;
+    char16_t  *b1 = b1Stack, *b2 = b2Stack;
     int32_t b1Len=0, b2Len, 
             b1Capacity = MAX_LABEL_BUFFER_SIZE, 
             b2Capacity = MAX_LABEL_BUFFER_SIZE ,
@@ -228,7 +228,7 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
     }
     
     if(srcLength > b1Capacity){
-        b1 = (UChar*) uprv_malloc(srcLength * U_SIZEOF_UCHAR);
+        b1 = (char16_t*) uprv_malloc(srcLength * U_SIZEOF_UCHAR);
         if(b1==nullptr){
             *status = U_MEMORY_ALLOCATION_ERROR;
             goto CLEANUP;
@@ -256,7 +256,7 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
             if(b1 != b1Stack){
                 uprv_free(b1);
             }
-            b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+            b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
             if(b1==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -338,7 +338,7 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
             if(*status == U_BUFFER_OVERFLOW_ERROR){
                 // redo processing of string
                 /* we do not have enough room so grow the buffer*/
-                b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR); 
+                b2 = (char16_t*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
                 if(b2 == nullptr){
                     *status = U_MEMORY_ALLOCATION_ERROR;
                     goto CLEANUP;
@@ -391,8 +391,8 @@ CLEANUP:
 }
 
 static int32_t
-_internal_toUnicode(const UChar* src, int32_t srcLength,
-                    UChar* dest, int32_t destCapacity,
+_internal_toUnicode(const char16_t* src, int32_t srcLength,
+                    char16_t* dest, int32_t destCapacity,
                     int32_t options,
                     UStringPrepProfile* nameprep,
                     UParseError* parseError,
@@ -404,10 +404,10 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
     int32_t namePrepOptions = ((options & UIDNA_ALLOW_UNASSIGNED) != 0) ? USPREP_ALLOW_UNASSIGNED: 0; 
 
     // TODO Revisit buffer handling. The label should not be over 63 ASCII characters. ICU4J may need to be updated too.
-    UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stack[MAX_LABEL_BUFFER_SIZE];
+    char16_t b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stack[MAX_LABEL_BUFFER_SIZE];
 
     //initialize pointers to stack buffers
-    UChar  *b1 = b1Stack, *b2 = b2Stack, *b1Prime=nullptr, *b3=b3Stack;
+    char16_t  *b1 = b1Stack, *b2 = b2Stack, *b1Prime=nullptr, *b3=b3Stack;
     int32_t b1Len = 0, b2Len, b1PrimeLen, b3Len,
             b1Capacity = MAX_LABEL_BUFFER_SIZE, 
             b2Capacity = MAX_LABEL_BUFFER_SIZE,
@@ -458,7 +458,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+            b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
             if(b1==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -475,7 +475,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
     }else{
 
         //just point src to b1
-        b1 = (UChar*) src;
+        b1 = (char16_t*) src;
         b1Len = srcLength;
     }
 
@@ -498,7 +498,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
+            b2 = (char16_t*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
             if(b2==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -516,7 +516,7 @@ _internal_toUnicode(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b3 = (UChar*) uprv_malloc(b3Len * U_SIZEOF_UCHAR);
+            b3 = (char16_t*) uprv_malloc(b3Len * U_SIZEOF_UCHAR);
             if(b3==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -608,8 +608,8 @@ CLEANUP:
 }
 
 U_CAPI int32_t U_EXPORT2
-uidna_toASCII(const UChar* src, int32_t srcLength, 
-              UChar* dest, int32_t destCapacity,
+uidna_toASCII(const char16_t* src, int32_t srcLength,
+              char16_t* dest, int32_t destCapacity,
               int32_t options,
               UParseError* parseError,
               UErrorCode* status){
@@ -637,8 +637,8 @@ uidna_toASCII(const UChar* src, int32_t srcLength,
 }
 
 U_CAPI int32_t U_EXPORT2
-uidna_toUnicode(const UChar* src, int32_t srcLength,
-                UChar* dest, int32_t destCapacity,
+uidna_toUnicode(const char16_t* src, int32_t srcLength,
+                char16_t* dest, int32_t destCapacity,
                 int32_t options,
                 UParseError* parseError,
                 UErrorCode* status){
@@ -666,8 +666,8 @@ uidna_toUnicode(const UChar* src, int32_t srcLength,
 
 
 U_CAPI int32_t U_EXPORT2
-uidna_IDNToASCII(  const UChar *src, int32_t srcLength,
-                   UChar* dest, int32_t destCapacity,
+uidna_IDNToASCII(  const char16_t *src, int32_t srcLength,
+                   char16_t* dest, int32_t destCapacity,
                    int32_t options,
                    UParseError *parseError,
                    UErrorCode *status){
@@ -689,9 +689,9 @@ uidna_IDNToASCII(  const UChar *src, int32_t srcLength,
     }
 
     //initialize pointers 
-    UChar *delimiter = (UChar*)src;
-    UChar *labelStart = (UChar*)src;
-    UChar *currentDest = (UChar*) dest;
+    char16_t *delimiter = (char16_t*)src;
+    char16_t *labelStart = (char16_t*)src;
+    char16_t *currentDest = (char16_t*) dest;
     int32_t remainingLen = srcLength;
     int32_t remainingDestCapacity = destCapacity;
     int32_t labelLen = 0, labelReqLength = 0;
@@ -759,8 +759,8 @@ uidna_IDNToASCII(  const UChar *src, int32_t srcLength,
 }
 
 U_CAPI int32_t U_EXPORT2
-uidna_IDNToUnicode(  const UChar* src, int32_t srcLength,
-                     UChar* dest, int32_t destCapacity,
+uidna_IDNToUnicode(  const char16_t* src, int32_t srcLength,
+                     char16_t* dest, int32_t destCapacity,
                      int32_t options,
                      UParseError* parseError,
                      UErrorCode* status){
@@ -782,9 +782,9 @@ uidna_IDNToUnicode(  const UChar* src, int32_t srcLength,
     }
 
     //initialize pointers
-    UChar *delimiter = (UChar*)src;
-    UChar *labelStart = (UChar*)src;
-    UChar *currentDest = (UChar*) dest;
+    char16_t *delimiter = (char16_t*)src;
+    char16_t *labelStart = (char16_t*)src;
+    char16_t *currentDest = (char16_t*) dest;
     int32_t remainingLen = srcLength;
     int32_t remainingDestCapacity = destCapacity;
     int32_t labelLen = 0, labelReqLength = 0;
@@ -858,8 +858,8 @@ uidna_IDNToUnicode(  const UChar* src, int32_t srcLength,
 }
 
 U_CAPI int32_t U_EXPORT2
-uidna_compare(  const UChar *s1, int32_t length1,
-                const UChar *s2, int32_t length2,
+uidna_compare(  const char16_t *s1, int32_t length1,
+                const char16_t *s2, int32_t length2,
                 int32_t options,
                 UErrorCode* status){
 
@@ -867,8 +867,8 @@ uidna_compare(  const UChar *s1, int32_t length1,
         return -1;
     }
 
-    UChar b1Stack[MAX_IDN_BUFFER_SIZE], b2Stack[MAX_IDN_BUFFER_SIZE];
-    UChar *b1 = b1Stack, *b2 = b2Stack;
+    char16_t b1Stack[MAX_IDN_BUFFER_SIZE], b2Stack[MAX_IDN_BUFFER_SIZE];
+    char16_t *b1 = b1Stack, *b2 = b2Stack;
     int32_t b1Len, b2Len, b1Capacity = MAX_IDN_BUFFER_SIZE, b2Capacity = MAX_IDN_BUFFER_SIZE;
     int32_t result=-1;
     
@@ -877,7 +877,7 @@ uidna_compare(  const UChar *s1, int32_t length1,
     b1Len = uidna_IDNToASCII(s1, length1, b1, b1Capacity, options, &parseError, status);
     if(*status == U_BUFFER_OVERFLOW_ERROR){
         // redo processing of string
-        b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+        b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
         if(b1==nullptr){
             *status = U_MEMORY_ALLOCATION_ERROR;
             goto CLEANUP;
@@ -892,7 +892,7 @@ uidna_compare(  const UChar *s1, int32_t length1,
     b2Len = uidna_IDNToASCII(s2,length2, b2,b2Capacity, options, &parseError, status);
     if(*status == U_BUFFER_OVERFLOW_ERROR){
         // redo processing of string
-        b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
+        b2 = (char16_t*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
         if(b2==nullptr){
             *status = U_MEMORY_ALLOCATION_ERROR;
             goto CLEANUP;
index 3fe92a48cd52329b8224a56524edae220d3d35c4..096a8e28d117583440b5c515b4afa250adaee299 100644 (file)
@@ -182,8 +182,8 @@ static const uint32_t invariantChars[4]={
 
 
 U_CAPI void U_EXPORT2
-u_charsToUChars(const char *cs, UChar *us, int32_t length) {
-    UChar u;
+u_charsToUChars(const char *cs, char16_t *us, int32_t length) {
+    char16_t u;
     uint8_t c;
 
     /*
@@ -193,7 +193,7 @@ u_charsToUChars(const char *cs, UChar *us, int32_t length) {
      */
     while(length>0) {
         c=(uint8_t)(*cs++);
-        u=(UChar)CHAR_TO_UCHAR(c);
+        u=(char16_t)CHAR_TO_UCHAR(c);
         U_ASSERT((u!=0 || c==0)); /* only invariant chars converted? */
         *us++=u;
         --length;
@@ -201,8 +201,8 @@ u_charsToUChars(const char *cs, UChar *us, int32_t length) {
 }
 
 U_CAPI void U_EXPORT2
-u_UCharsToChars(const UChar *us, char *cs, int32_t length) {
-    UChar u;
+u_UCharsToChars(const char16_t *us, char *cs, int32_t length) {
+    char16_t u;
 
     while(length>0) {
         u=*us++;
@@ -260,8 +260,8 @@ uprv_isInvariantString(const char *s, int32_t length) {
 }
 
 U_CAPI UBool U_EXPORT2
-uprv_isInvariantUString(const UChar *s, int32_t length) {
-    UChar c;
+uprv_isInvariantUString(const char16_t *s, int32_t length) {
+    char16_t c;
 
     for(;;) {
         if(length<0) {
@@ -457,7 +457,7 @@ uprv_isEbcdicAtSign(char c) {
 U_CFUNC int32_t
 uprv_compareInvAscii(const UDataSwapper *ds,
                      const char *outString, int32_t outLength,
-                     const UChar *localString, int32_t localLength) {
+                     const char16_t *localString, int32_t localLength) {
     (void)ds;
     int32_t minLength;
     UChar32 c1, c2;
@@ -503,7 +503,7 @@ uprv_compareInvAscii(const UDataSwapper *ds,
 U_CFUNC int32_t
 uprv_compareInvEbcdic(const UDataSwapper *ds,
                       const char *outString, int32_t outLength,
-                      const UChar *localString, int32_t localLength) {
+                      const char16_t *localString, int32_t localLength) {
     (void)ds;
     int32_t minLength;
     UChar32 c1, c2;
index 4c2f4bdf49f97094fa49d31763ef4c71f55ad392..4c07b3de504f0f9e18b0048bc5e219dd04393f20 100644 (file)
@@ -82,8 +82,8 @@ static const UCharIterator noopIterator={
 /* UCharIterator implementation for simple strings -------------------------- */
 
 /*
- * This is an implementation of a code unit (UChar) iterator
- * for UChar * strings.
+ * This is an implementation of a code unit (char16_t) iterator
+ * for char16_t * strings.
  *
  * The UCharIterator.context field holds a pointer to the string.
  */
@@ -154,7 +154,7 @@ stringIteratorHasPrevious(UCharIterator *iter) {
 static UChar32 U_CALLCONV
 stringIteratorCurrent(UCharIterator *iter) {
     if(iter->index<iter->limit) {
-        return ((const UChar *)(iter->context))[iter->index];
+        return ((const char16_t *)(iter->context))[iter->index];
     } else {
         return U_SENTINEL;
     }
@@ -163,7 +163,7 @@ stringIteratorCurrent(UCharIterator *iter) {
 static UChar32 U_CALLCONV
 stringIteratorNext(UCharIterator *iter) {
     if(iter->index<iter->limit) {
-        return ((const UChar *)(iter->context))[iter->index++];
+        return ((const char16_t *)(iter->context))[iter->index++];
     } else {
         return U_SENTINEL;
     }
@@ -172,7 +172,7 @@ stringIteratorNext(UCharIterator *iter) {
 static UChar32 U_CALLCONV
 stringIteratorPrevious(UCharIterator *iter) {
     if(iter->index>iter->start) {
-        return ((const UChar *)(iter->context))[--iter->index];
+        return ((const char16_t *)(iter->context))[--iter->index];
     } else {
         return U_SENTINEL;
     }
@@ -211,7 +211,7 @@ static const UCharIterator stringIterator={
 };
 
 U_CAPI void U_EXPORT2
-uiter_setString(UCharIterator *iter, const UChar *s, int32_t length) {
+uiter_setString(UCharIterator *iter, const char16_t *s, int32_t length) {
     if(iter!=0) {
         if(s!=0 && length>=-1) {
             *iter=stringIterator;
@@ -231,12 +231,12 @@ uiter_setString(UCharIterator *iter, const UChar *s, int32_t length) {
 /* UCharIterator implementation for UTF-16BE strings ------------------------ */
 
 /*
- * This is an implementation of a code unit (UChar) iterator
+ * This is an implementation of a code unit (char16_t) iterator
  * for UTF-16BE strings, i.e., strings in byte-vectors where
- * each UChar is stored as a big-endian pair of bytes.
+ * each char16_t is stored as a big-endian pair of bytes.
  *
  * The UCharIterator.context field holds a pointer to the string.
- * Everything works just like with a normal UChar iterator (uiter_setString),
+ * Everything works just like with a normal char16_t iterator (uiter_setString),
  * except that UChars are assembled from byte pairs.
  */
 
@@ -244,7 +244,7 @@ uiter_setString(UCharIterator *iter, const UChar *s, int32_t length) {
 static inline UChar32
 utf16BEIteratorGet(UCharIterator *iter, int32_t index) {
     const uint8_t *p=(const uint8_t *)iter->context;
-    return ((UChar)p[2*index]<<8)|(UChar)p[2*index+1];
+    return ((char16_t)p[2*index]<<8)|(char16_t)p[2*index+1];
 }
 
 static UChar32 U_CALLCONV
@@ -297,7 +297,7 @@ static const UCharIterator utf16BEIterator={
 };
 
 /*
- * Count the number of UChars in a UTF-16BE string before a terminating UChar NUL,
+ * Count the number of UChars in a UTF-16BE string before a terminating char16_t NUL,
  * i.e., before a pair of 0 bytes where the first 0 byte is at an even
  * offset from s.
  */
@@ -306,10 +306,10 @@ utf16BE_strlen(const char *s) {
     if(IS_POINTER_EVEN(s)) {
         /*
          * even-aligned, call u_strlen(s)
-         * we are probably on a little-endian machine, but searching for UChar NUL
+         * we are probably on a little-endian machine, but searching for char16_t NUL
          * does not care about endianness
          */
-        return u_strlen((const UChar *)s);
+        return u_strlen((const char16_t *)s);
     } else {
         /* odd-aligned, search for pair of 0 bytes */
         const char *p=s;
@@ -330,8 +330,8 @@ uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length) {
             length>>=1;
 
             if(U_IS_BIG_ENDIAN && IS_POINTER_EVEN(s)) {
-                /* big-endian machine and 2-aligned UTF-16BE string: use normal UChar iterator */
-                uiter_setString(iter, (const UChar *)s, length);
+                /* big-endian machine and 2-aligned UTF-16BE string: use normal char16_t iterator */
+                uiter_setString(iter, (const char16_t *)s, length);
                 return;
             }
 
@@ -485,7 +485,7 @@ uiter_setCharacterIterator(UCharIterator *iter, CharacterIterator *charIter) {
 /* UCharIterator wrapper around Replaceable --------------------------------- */
 
 /*
- * This is an implementation of a code unit (UChar) iterator
+ * This is an implementation of a code unit (char16_t) iterator
  * based on a Replaceable object.
  *
  * The UCharIterator.context field holds a pointer to the Replaceable.
@@ -561,7 +561,7 @@ uiter_setReplaceable(UCharIterator *iter, const Replaceable *rep) {
 
 /*
  * Minimal implementation:
- * Maintain a single-UChar buffer for an additional surrogate.
+ * Maintain a single-char16_t buffer for an additional surrogate.
  * The caller must not modify start and limit because they are used internally.
  *
  * Use UCharIterator fields as follows:
@@ -873,7 +873,7 @@ utf8IteratorNext(UCharIterator *iter) {
     int32_t index;
 
     if(iter->reservedField!=0) {
-        UChar trail=U16_TRAIL(iter->reservedField);
+        char16_t trail=U16_TRAIL(iter->reservedField);
         iter->reservedField=0;
         if((index=iter->index)>=0) {
             iter->index=index+1;
@@ -908,7 +908,7 @@ utf8IteratorPrevious(UCharIterator *iter) {
     int32_t index;
 
     if(iter->reservedField!=0) {
-        UChar lead=U16_LEAD(iter->reservedField);
+        char16_t lead=U16_LEAD(iter->reservedField);
         iter->reservedField=0;
         iter->start-=4; /* we stayed behind the supplementary code point; go before it now */
         if((index=iter->index)>0) {
index 83785d336bc007360ccc5f48f535c90678c4b1c5..071d44d965f8be9b1f04c5bf8c7232ba5b173994 100644 (file)
@@ -269,7 +269,7 @@ initFromResourceBundle(UErrorCode& sts) {
                     while (ures_hasNext(typeAliasResByKey.getAlias()) && U_SUCCESS(sts)) {
                         int32_t toLen;
                         typeAliasDataEntry.adoptInstead(ures_getNextResource(typeAliasResByKey.getAlias(), typeAliasDataEntry.orphan(), &sts));
-                        const UChar* to = ures_getString(typeAliasDataEntry.getAlias(), &toLen, &sts);
+                        const char16_t* to = ures_getString(typeAliasDataEntry.getAlias(), &toLen, &sts);
                         if (U_FAILURE(sts)) {
                             break;
                         }
@@ -310,7 +310,7 @@ initFromResourceBundle(UErrorCode& sts) {
                     while (ures_hasNext(bcpTypeAliasResByKey.getAlias()) && U_SUCCESS(sts)) {
                         int32_t toLen;
                         bcpTypeAliasDataEntry.adoptInstead(ures_getNextResource(bcpTypeAliasResByKey.getAlias(), bcpTypeAliasDataEntry.orphan(), &sts));
-                        const UChar* to = ures_getString(bcpTypeAliasDataEntry.getAlias(), &toLen, &sts);
+                        const char16_t* to = ures_getString(bcpTypeAliasDataEntry.getAlias(), &toLen, &sts);
                         if (U_FAILURE(sts)) {
                             break;
                         }
index 885006977acbd9b76aecf9be2b941ea314b3cc06..faa6d807868885ea27e94a82f9c186d1f2e9ab56 100644 (file)
@@ -147,7 +147,7 @@ typedef HANDLE MemoryMap;
         // Convert from UTF-8 string to UTF-16 string.
         wchar_t utf16Path[MAX_PATH];
         int32_t pathUtf16Len = 0;
-        u_strFromUTF8(reinterpret_cast<UChar*>(utf16Path), static_cast<int32_t>(UPRV_LENGTHOF(utf16Path)), &pathUtf16Len, path, -1, status);
+        u_strFromUTF8(reinterpret_cast<char16_t*>(utf16Path), static_cast<int32_t>(UPRV_LENGTHOF(utf16Path)), &pathUtf16Len, path, -1, status);
 
         if (U_FAILURE(*status)) {
             return false;
index 69693089de7fdecf026609fbdc04c2f156a52132..89508433cfa4bc4dc4fa143146bb39146848ad4d 100644 (file)
@@ -1716,7 +1716,7 @@ uprv_getMaxCharNameLength() {
  */
 static void
 charSetToUSet(uint32_t cset[8], const USetAdder *sa) {
-    UChar us[256];
+    char16_t us[256];
     char cs[256];
 
     int32_t i, length;
@@ -1736,12 +1736,12 @@ charSetToUSet(uint32_t cset[8], const USetAdder *sa) {
         }
     }
 
-    /* convert the char string to a UChar string */
+    /* convert the char string to a char16_t string */
     u_charsToUChars(cs, us, length);
 
-    /* add each UChar to the USet */
+    /* add each char16_t to the USet */
     for(i=0; i<length; ++i) {
-        if(us[i]!=0 || cs[i]==0) { /* non-invariant chars become (UChar)0 */
+        if(us[i]!=0 || cs[i]==0) { /* non-invariant chars become (char16_t)0 */
             sa->add(sa->set, us[i]);
         }
     }
index a6c43f9537a55e79af4d5bd1f96bd44e8fcf9554..cc25b6e49cd104a538f44427ec4fe3ff2e76dfe8 100644 (file)
@@ -812,7 +812,7 @@ inline UnicodeString
 ures_getUnicodeString(const UResourceBundle *resB, UErrorCode* status) {
     UnicodeString result;
     int32_t len = 0;
-    const UChar *r = ures_getString(resB, &len, status);
+    const char16_t *r = ures_getString(resB, &len, status);
     if(U_SUCCESS(*status)) {
         result.setTo(true, r, len);
     } else {
@@ -837,7 +837,7 @@ inline UnicodeString
 ures_getNextUnicodeString(UResourceBundle *resB, const char ** key, UErrorCode* status) {
     UnicodeString result;
     int32_t len = 0;
-    const UChar* r = ures_getNextString(resB, &len, key, status);
+    const char16_t* r = ures_getNextString(resB, &len, key, status);
     if(U_SUCCESS(*status)) {
         result.setTo(true, r, len);
     } else {
@@ -859,7 +859,7 @@ inline UnicodeString
 ures_getUnicodeStringByIndex(const UResourceBundle *resB, int32_t indexS, UErrorCode* status) {
     UnicodeString result;
     int32_t len = 0;
-    const UChar* r = ures_getStringByIndex(resB, indexS, &len, status);
+    const char16_t* r = ures_getStringByIndex(resB, indexS, &len, status);
     if(U_SUCCESS(*status)) {
         result.setTo(true, r, len);
     } else {
@@ -882,7 +882,7 @@ inline UnicodeString
 ures_getUnicodeStringByKey(const UResourceBundle *resB, const char* key, UErrorCode* status) {
     UnicodeString result;
     int32_t len = 0;
-    const UChar* r = ures_getStringByKey(resB, key, &len, status);
+    const char16_t* r = ures_getStringByKey(resB, key, &len, status);
     if(U_SUCCESS(*status)) {
         result.setTo(true, r, len);
     } else {
index 613e9665e91f12e8dbfcecb67231303665d634e1..24fefea63f0c640f618322b56dce644b41a73141 100644 (file)
@@ -582,7 +582,7 @@ UMatchDegree UnicodeSet::matches(const Replaceable& text,
             // firstChar is the leftmost char to match in the
             // forward direction or the rightmost char to match in
             // the reverse direction.
-            UChar firstChar = text.charAt(offset);
+            char16_t firstChar = text.charAt(offset);
 
             // If there are multiple strings that can match we
             // return the longest match.
@@ -594,7 +594,7 @@ UMatchDegree UnicodeSet::matches(const Replaceable& text,
                     continue;  // skip the empty string
                 }
 
-                UChar c = trial.charAt(forward ? 0 : trial.length() - 1);
+                char16_t c = trial.charAt(forward ? 0 : trial.length() - 1);
 
                 // Strings are sorted, so we can optimize in the
                 // forward direction.
@@ -2161,7 +2161,7 @@ void UnicodeSet::releasePattern() {
 */
 void UnicodeSet::setPattern(const char16_t *newPat, int32_t newPatLen) {
     releasePattern();
-    pat = (UChar *)uprv_malloc((newPatLen + 1) * sizeof(UChar));
+    pat = (char16_t *)uprv_malloc((newPatLen + 1) * sizeof(char16_t));
     if (pat) {
         patLen = newPatLen;
         u_memcpy(pat, newPat, patLen);
@@ -2202,7 +2202,7 @@ UnicodeSet *UnicodeSet::freeze() {
     return this;
 }
 
-int32_t UnicodeSet::span(const UChar *s, int32_t length, USetSpanCondition spanCondition) const {
+int32_t UnicodeSet::span(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const {
     if(length>0 && bmpSet!=nullptr) {
         return (int32_t)(bmpSet->span(s, s+length, spanCondition)-s);
     }
@@ -2239,7 +2239,7 @@ int32_t UnicodeSet::span(const UChar *s, int32_t length, USetSpanCondition spanC
     return prev;
 }
 
-int32_t UnicodeSet::spanBack(const UChar *s, int32_t length, USetSpanCondition spanCondition) const {
+int32_t UnicodeSet::spanBack(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const {
     if(length>0 && bmpSet!=nullptr) {
         return (int32_t)(bmpSet->spanBack(s, s+length, spanCondition)-s);
     }
index 84791e701012604ce01689cd7556d95e383ebf09..1f1fbcf9f8e1118cca45f6183ecb97cdd1ee63a5 100644 (file)
@@ -123,7 +123,7 @@ _set_addRange(USet *set, UChar32 start, UChar32 end) {
 }
 
 static void U_CALLCONV
-_set_addString(USet *set, const UChar *str, int32_t length) {
+_set_addString(USet *set, const char16_t *str, int32_t length) {
     ((UnicodeSet *)set)->add(UnicodeString((UBool)(length<0), str, length));
 }
 
@@ -134,7 +134,7 @@ _set_addString(USet *set, const UChar *str, int32_t length) {
 // add the result of a full case mapping to the set
 // use str as a temporary string to avoid constructing one
 static inline void
-addCaseMapping(UnicodeSet &set, int32_t result, const UChar *full, UnicodeString &str) {
+addCaseMapping(UnicodeSet &set, int32_t result, const char16_t *full, UnicodeString &str) {
     if(result >= 0) {
         if(result > UCASE_MAX_STRING_LENGTH) {
             // add a single-code point case mapping
@@ -175,7 +175,7 @@ UnicodeSet& UnicodeSet::closeOver(int32_t attribute) {
 
             int32_t n = getRangeCount();
             UChar32 result;
-            const UChar *full;
+            const char16_t *full;
 
             for (int32_t i=0; i<n; ++i) {
                 UChar32 start = getRangeStart(i);
index 78fdbb37d7d72dad6af3061d89a29a7c7698ae5e..3f6a154f80272c295d7c08cafc9ffcd8cc6d3673 100644 (file)
@@ -108,7 +108,7 @@ uniset_getUnicode32Instance(UErrorCode &errorCode) {
 
 static inline UBool
 isPerlOpen(const UnicodeString &pattern, int32_t pos) {
-    UChar c;
+    char16_t c;
     return pattern.charAt(pos)==u'\\' && ((c=pattern.charAt(pos+1))==u'p' || c==u'P');
 }
 
@@ -209,7 +209,7 @@ UnicodeSet::applyPatternIgnoreSpace(const UnicodeString& pattern,
  */
 UBool UnicodeSet::resemblesPattern(const UnicodeString& pattern, int32_t pos) {
     return ((pos+1) < pattern.length() &&
-            pattern.charAt(pos) == (UChar)91/*[*/) ||
+            pattern.charAt(pos) == (char16_t)91/*[*/) ||
         resemblesPropertyPattern(pattern, pos);
 }
 
@@ -287,7 +287,7 @@ void UnicodeSet::applyPattern(RuleCharacterIterator& chars,
     // lastItem: 0=none, 1=char, 2=set
     int8_t lastItem = 0, mode = 0;
     UChar32 lastChar = 0;
-    UChar op = 0;
+    char16_t op = 0;
 
     UBool invert = false;
 
@@ -471,7 +471,7 @@ void UnicodeSet::applyPattern(RuleCharacterIterator& chars,
             case u'-':
                 if (op == 0) {
                     if (lastItem != 0) {
-                        op = (UChar) c;
+                        op = (char16_t) c;
                         continue;
                     } else {
                         // Treat final trailing '-' as a literal
@@ -490,7 +490,7 @@ void UnicodeSet::applyPattern(RuleCharacterIterator& chars,
                 return;
             case u'&':
                 if (lastItem == 2 && op == 0) {
-                    op = (UChar) c;
+                    op = (char16_t) c;
                     continue;
                 }
                 // syntaxError(chars, "'&' not after set");
@@ -561,7 +561,7 @@ void UnicodeSet::applyPattern(RuleCharacterIterator& chars,
                         }
                         add(U_ETHER);
                         usePat = true;
-                        patLocal.append((UChar) SymbolTable::SYMBOL_REF);
+                        patLocal.append((char16_t) SymbolTable::SYMBOL_REF);
                         patLocal.append(u']');
                         mode = 2;
                         continue;
@@ -1044,7 +1044,7 @@ UnicodeSet& UnicodeSet::applyPropertyPattern(const UnicodeString& pattern,
             invert = true;
         }
     } else if (isPerlOpen(pattern, pos) || isNameOpen(pattern, pos)) {
-        UChar c = pattern.charAt(pos+1);
+        char16_t c = pattern.charAt(pos+1);
         invert = (c == u'P');
         isName = (c == u'N');
         pos += 2;
index 14cef120fdf6a38087a4b0aaf974a53334cb8b1f..b7256d8fd1646d784927429d43a0182e50e0fd12 100644 (file)
@@ -165,7 +165,7 @@ private:
 
 // Get the number of UTF-8 bytes for a UTF-16 (sub)string.
 static int32_t
-getUTF8Length(const UChar *s, int32_t length) {
+getUTF8Length(const char16_t *s, int32_t length) {
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length8=0;
     u_strToUTF8(nullptr, 0, &length8, s, length, &errorCode);
@@ -180,7 +180,7 @@ getUTF8Length(const UChar *s, int32_t length) {
 
 // Append the UTF-8 version of the string to t and return the appended UTF-8 length.
 static int32_t
-appendUTF8(const UChar *s, int32_t length, uint8_t *t, int32_t capacity) {
+appendUTF8(const char16_t *s, int32_t length, uint8_t *t, int32_t capacity) {
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length8=0;
     u_strToUTF8((char *)t, capacity, &length8, s, length, &errorCode);
@@ -229,7 +229,7 @@ UnicodeSetStringSpan::UnicodeSetStringSpan(const UnicodeSet &set,
     UBool someRelevant=false;
     for(i=0; i<stringsLength; ++i) {
         const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-        const UChar *s16=string.getBuffer();
+        const char16_t *s16=string.getBuffer();
         int32_t length16=string.length();
         if (length16==0) {
             continue;  // skip the empty string
@@ -312,7 +312,7 @@ UnicodeSetStringSpan::UnicodeSetStringSpan(const UnicodeSet &set,
 
     for(i=0; i<stringsLength; ++i) {
         const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-        const UChar *s16=string.getBuffer();
+        const char16_t *s16=string.getBuffer();
         int32_t length16=string.length();
         spanLength=spanSet.span(s16, length16, USET_SPAN_CONTAINED);
         if(spanLength<length16 && length16>0) {  // Relevant string.
@@ -451,7 +451,7 @@ void UnicodeSetStringSpan::addToSpanNotSet(UChar32 c) {
 
 // Compare strings without any argument checks. Requires length>0.
 static inline UBool
-matches16(const UChar *s, const UChar *t, int32_t length) {
+matches16(const char16_t *s, const char16_t *t, int32_t length) {
     do {
         if(*s++!=*t++) {
             return false;
@@ -474,7 +474,7 @@ matches8(const uint8_t *s, const uint8_t *t, int32_t length) {
 // at code point boundaries.
 // That is, each edge of a match must not be in the middle of a surrogate pair.
 static inline UBool
-matches16CPB(const UChar *s, int32_t start, int32_t limit, const UChar *t, int32_t length) {
+matches16CPB(const char16_t *s, int32_t start, int32_t limit, const char16_t *t, int32_t length) {
     s+=start;
     limit-=start;
     return matches16(s, t, length) &&
@@ -485,8 +485,8 @@ matches16CPB(const UChar *s, int32_t start, int32_t limit, const UChar *t, int32
 // Does the set contain the next code point?
 // If so, return its length; otherwise return its negative length.
 static inline int32_t
-spanOne(const UnicodeSet &set, const UChar *s, int32_t length) {
-    UChar c=*s, c2;
+spanOne(const UnicodeSet &set, const char16_t *s, int32_t length) {
+    char16_t c=*s, c2;
     if(c>=0xd800 && c<=0xdbff && length>=2 && U16_IS_TRAIL(c2=s[1])) {
         return set.contains(U16_GET_SUPPLEMENTARY(c, c2)) ? 2 : -2;
     }
@@ -494,8 +494,8 @@ spanOne(const UnicodeSet &set, const UChar *s, int32_t length) {
 }
 
 static inline int32_t
-spanOneBack(const UnicodeSet &set, const UChar *s, int32_t length) {
-    UChar c=s[length-1], c2;
+spanOneBack(const UnicodeSet &set, const char16_t *s, int32_t length) {
+    char16_t c=s[length-1], c2;
     if(c>=0xdc00 && c<=0xdfff && length>=2 && U16_IS_LEAD(c2=s[length-2])) {
         return set.contains(U16_GET_SUPPLEMENTARY(c2, c)) ? 2 : -2;
     }
@@ -634,7 +634,7 @@ spanOneBackUTF8(const UnicodeSet &set, const uint8_t *s, int32_t length) {
  *     Stop if spanLength==0, otherwise continue the loop.
  */
 
-int32_t UnicodeSetStringSpan::span(const UChar *s, int32_t length, USetSpanCondition spanCondition) const {
+int32_t UnicodeSetStringSpan::span(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const {
     if(spanCondition==USET_SPAN_NOT_CONTAINED) {
         return spanNot(s, length);
     }
@@ -659,7 +659,7 @@ int32_t UnicodeSetStringSpan::span(const UChar *s, int32_t length, USetSpanCondi
                     continue;  // Irrelevant string. (Also the empty string.)
                 }
                 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-                const UChar *s16=string.getBuffer();
+                const char16_t *s16=string.getBuffer();
                 int32_t length16=string.length();
                 U_ASSERT(length>0);
 
@@ -699,7 +699,7 @@ int32_t UnicodeSetStringSpan::span(const UChar *s, int32_t length, USetSpanCondi
                 // to find the match from the earliest start.
 
                 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-                const UChar *s16=string.getBuffer();
+                const char16_t *s16=string.getBuffer();
                 int32_t length16=string.length();
                 if (length16==0) {
                     continue;  // skip the empty string
@@ -798,7 +798,7 @@ int32_t UnicodeSetStringSpan::span(const UChar *s, int32_t length, USetSpanCondi
     }
 }
 
-int32_t UnicodeSetStringSpan::spanBack(const UChar *s, int32_t length, USetSpanCondition spanCondition) const {
+int32_t UnicodeSetStringSpan::spanBack(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const {
     if(spanCondition==USET_SPAN_NOT_CONTAINED) {
         return spanNotBack(s, length);
     }
@@ -827,7 +827,7 @@ int32_t UnicodeSetStringSpan::spanBack(const UChar *s, int32_t length, USetSpanC
                     continue;  // Irrelevant string. (Also the empty string.)
                 }
                 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-                const UChar *s16=string.getBuffer();
+                const char16_t *s16=string.getBuffer();
                 int32_t length16=string.length();
                 U_ASSERT(length>0);
 
@@ -869,7 +869,7 @@ int32_t UnicodeSetStringSpan::spanBack(const UChar *s, int32_t length, USetSpanC
                 // to find the match from the latest end.
 
                 const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-                const UChar *s16=string.getBuffer();
+                const char16_t *s16=string.getBuffer();
                 int32_t length16=string.length();
                 if (length16==0) {
                     continue;  // skip the empty string
@@ -1346,7 +1346,7 @@ int32_t UnicodeSetStringSpan::spanBackUTF8(const uint8_t *s, int32_t length, USe
  *     when there is not actually a match for such a set string.
  */
 
-int32_t UnicodeSetStringSpan::spanNot(const UChar *s, int32_t length) const {
+int32_t UnicodeSetStringSpan::spanNot(const char16_t *s, int32_t length) const {
     int32_t pos=0, rest=length;
     int32_t i, stringsLength=strings.size();
     do {
@@ -1372,7 +1372,7 @@ int32_t UnicodeSetStringSpan::spanNot(const UChar *s, int32_t length) const {
                 continue;  // Irrelevant string. (Also the empty string.)
             }
             const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-            const UChar *s16=string.getBuffer();
+            const char16_t *s16=string.getBuffer();
             int32_t length16=string.length();
             U_ASSERT(length>0);
             if(length16<=rest && matches16CPB(s, pos, length, s16, length16)) {
@@ -1389,7 +1389,7 @@ int32_t UnicodeSetStringSpan::spanNot(const UChar *s, int32_t length) const {
     return length;  // Reached the end of the string.
 }
 
-int32_t UnicodeSetStringSpan::spanNotBack(const UChar *s, int32_t length) const {
+int32_t UnicodeSetStringSpan::spanNotBack(const char16_t *s, int32_t length) const {
     int32_t pos=length;
     int32_t i, stringsLength=strings.size();
     do {
@@ -1416,7 +1416,7 @@ int32_t UnicodeSetStringSpan::spanNotBack(const UChar *s, int32_t length) const
                 continue;  // Irrelevant string. (Also the empty string.)
             }
             const UnicodeString &string=*(const UnicodeString *)strings.elementAt(i);
-            const UChar *s16=string.getBuffer();
+            const char16_t *s16=string.getBuffer();
             int32_t length16=string.length();
             U_ASSERT(length>0);
             if(length16<=pos && matches16CPB(s, pos-length16, length, s16, length16)) {
index 9a1307a9078aab4bc62e118ca5297ad4db943049..f1dc8e6f743a0df5a1ce191f86bda447cb0443ff 100644 (file)
@@ -74,9 +74,9 @@ public:
     // For fast UnicodeSet::contains(c).
     inline UBool contains(UChar32 c) const;
 
-    int32_t span(const UChar *s, int32_t length, USetSpanCondition spanCondition) const;
+    int32_t span(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const;
 
-    int32_t spanBack(const UChar *s, int32_t length, USetSpanCondition spanCondition) const;
+    int32_t spanBack(const char16_t *s, int32_t length, USetSpanCondition spanCondition) const;
 
     int32_t spanUTF8(const uint8_t *s, int32_t length, USetSpanCondition spanCondition) const;
 
@@ -95,8 +95,8 @@ private:
     // so that a character span ends before any string.
     void addToSpanNotSet(UChar32 c);
 
-    int32_t spanNot(const UChar *s, int32_t length) const;
-    int32_t spanNotBack(const UChar *s, int32_t length) const;
+    int32_t spanNot(const char16_t *s, int32_t length) const;
+    int32_t spanNotBack(const char16_t *s, int32_t length) const;
     int32_t spanNotUTF8(const uint8_t *s, int32_t length) const;
     int32_t spanNotBackUTF8(const uint8_t *s, int32_t length) const;
 
index 62164f3bf4ecaa3517ae7d9a9864a46b7d189acd..f05a6c68081557692b0af284c849993e8b488bb2 100644 (file)
@@ -44,7 +44,7 @@ void
 print(const UnicodeString& s,
       const char *name)
 {
-  UChar c;
+  char16_t c;
   cout << name << ":|";
   for(int i = 0; i < s.length(); ++i) {
     c = s[i];
@@ -57,11 +57,11 @@ print(const UnicodeString& s,
 }
 
 void
-print(const UChar *s,
+print(const char16_t *s,
       int32_t len,
       const char *name)
 {
-  UChar c;
+  char16_t c;
   cout << name << ":|";
   for(int i = 0; i < len; ++i) {
     c = s[i];
@@ -80,17 +80,17 @@ print(const UChar *s,
 // need to copy areas that may overlap
 static
 inline void
-us_arrayCopy(const UChar *src, int32_t srcStart,
-         UChar *dst, int32_t dstStart, int32_t count)
+us_arrayCopy(const char16_t *src, int32_t srcStart,
+         char16_t *dst, int32_t dstStart, int32_t count)
 {
   if(count>0) {
     uprv_memmove(dst+dstStart, src+srcStart, (size_t)count*sizeof(*src));
   }
 }
 
-// u_unescapeAt() callback to get a UChar from a UnicodeString
+// u_unescapeAt() callback to get a char16_t from a UnicodeString
 U_CDECL_BEGIN
-static UChar U_CALLCONV
+static char16_t U_CALLCONV
 UnicodeString_charAt(int32_t offset, void *context) {
     return ((icu::UnicodeString*) context)->charAt(offset);
 }
@@ -159,8 +159,8 @@ UnicodeString::UnicodeString(int32_t capacity, UChar32 c, int32_t count) {
       capacity = length;
     }
     if(allocate(capacity)) {
-      UChar *array = getArrayStart();
-      UChar unit = (UChar)c;
+      char16_t *array = getArrayStart();
+      char16_t unit = (char16_t)c;
       for(int32_t i = 0; i < length; ++i) {
         array[i] = unit;
       }
@@ -177,9 +177,9 @@ UnicodeString::UnicodeString(int32_t capacity, UChar32 c, int32_t count) {
       capacity = length;
     }
     if(allocate(capacity)) {
-      UChar *array = getArrayStart();
-      UChar lead = U16_LEAD(c);
-      UChar trail = U16_TRAIL(c);
+      char16_t *array = getArrayStart();
+      char16_t lead = U16_LEAD(c);
+      char16_t trail = U16_TRAIL(c);
       for(int32_t i = 0; i < length; i += 2) {
         array[i] = lead;
         array[i + 1] = trail;
@@ -189,7 +189,7 @@ UnicodeString::UnicodeString(int32_t capacity, UChar32 c, int32_t count) {
   }
 }
 
-UnicodeString::UnicodeString(UChar ch) {
+UnicodeString::UnicodeString(char16_t ch) {
   fUnion.fFields.fLengthAndFlags = kLength1 | kShortString;
   fUnion.fStackFields.fBuffer[0] = ch;
 }
@@ -206,12 +206,12 @@ UnicodeString::UnicodeString(UChar32 ch) {
   }
 }
 
-UnicodeString::UnicodeString(const UChar *text) {
+UnicodeString::UnicodeString(const char16_t *text) {
   fUnion.fFields.fLengthAndFlags = kShortString;
   doAppend(text, 0, -1);
 }
 
-UnicodeString::UnicodeString(const UChar *text,
+UnicodeString::UnicodeString(const char16_t *text,
                              int32_t textLength) {
   fUnion.fFields.fLengthAndFlags = kShortString;
   doAppend(text, 0, textLength);
@@ -221,7 +221,7 @@ UnicodeString::UnicodeString(UBool isTerminated,
                              ConstChar16Ptr textPtr,
                              int32_t textLength) {
   fUnion.fFields.fLengthAndFlags = kReadonlyAlias;
-  const UChar *text = textPtr;
+  const char16_t *text = textPtr;
   if(text == nullptr) {
     // treat as an empty string, do not alias
     setToEmpty();
@@ -235,12 +235,12 @@ UnicodeString::UnicodeString(UBool isTerminated,
       // text is terminated, or else it would have failed the above test
       textLength = u_strlen(text);
     }
-    setArray(const_cast<UChar *>(text), textLength,
+    setArray(const_cast<char16_t *>(text), textLength,
              isTerminated ? textLength + 1 : textLength);
   }
 }
 
-UnicodeString::UnicodeString(UChar *buff,
+UnicodeString::UnicodeString(char16_t *buff,
                              int32_t buffLength,
                              int32_t buffCapacity) {
   fUnion.fFields.fLengthAndFlags = kWritableAlias;
@@ -252,7 +252,7 @@ UnicodeString::UnicodeString(UChar *buff,
   } else {
     if(buffLength == -1) {
       // fLength = u_strlen(buff); but do not look beyond buffCapacity
-      const UChar *p = buff, *limit = buff + buffCapacity;
+      const char16_t *p = buff, *limit = buff + buffCapacity;
       while(p != limit && *p != 0) {
         ++p;
       }
@@ -385,8 +385,8 @@ UnicodeString::allocate(int32_t capacity) {
       *array++ = 1;
       numBytes -= sizeof(int32_t);
 
-      // have fArray point to the first UChar
-      fUnion.fFields.fArray = (UChar *)array;
+      // have fArray point to the first char16_t
+      fUnion.fFields.fArray = (char16_t *)array;
       fUnion.fFields.fCapacity = (int32_t)(numBytes / U_SIZEOF_UCHAR);
       fUnion.fFields.fLengthAndFlags = kLongString;
       return true;
@@ -460,7 +460,7 @@ UnicodeString UnicodeString::fromUTF32(const UChar32 *utf32, int32_t length) {
     capacity = length + (length >> 4) + 4;
   }
   do {
-    UChar *utf16 = result.getBuffer(capacity);
+    char16_t *utf16 = result.getBuffer(capacity);
     int32_t length16;
     UErrorCode errorCode = U_ZERO_ERROR;
     u_strFromUTF32WithSub(utf16, result.getCapacity(), &length16,
@@ -626,7 +626,7 @@ UnicodeString UnicodeString::unescape() const {
     if (result.isBogus()) {
         return result;
     }
-    const UChar *array = getBuffer();
+    const char16_t *array = getBuffer();
     int32_t len = length();
     int32_t prev = 0;
     for (int32_t i=0;;) {
@@ -665,7 +665,7 @@ UnicodeString::doEquals(const UnicodeString &text, int32_t len) const {
 int8_t
 UnicodeString::doCompare( int32_t start,
               int32_t length,
-              const UChar *srcChars,
+              const char16_t *srcChars,
               int32_t srcStart,
               int32_t srcLength) const
 {
@@ -678,12 +678,12 @@ UnicodeString::doCompare( int32_t start,
   pinIndices(start, length);
 
   if(srcChars == nullptr) {
-    // treat const UChar *srcChars==nullptr as an empty string
+    // treat const char16_t *srcChars==nullptr as an empty string
     return length == 0 ? 0 : 1;
   }
 
   // get the correct pointer
-  const UChar *chars = getArrayStart();
+  const char16_t *chars = getArrayStart();
 
   chars += start;
   srcChars += srcStart;
@@ -723,12 +723,12 @@ UnicodeString::doCompare( int32_t start,
 
 #   if U_IS_BIG_ENDIAN 
       // big-endian: byte comparison works
-      result = uprv_memcmp(chars, srcChars, minLength * sizeof(UChar));
+      result = uprv_memcmp(chars, srcChars, minLength * sizeof(char16_t));
       if(result != 0) {
         return (int8_t)(result >> 15 | 1);
       }
 #   else
-      // little-endian: compare UChar units
+      // little-endian: compare char16_t units
       do {
         result = ((int32_t)*(chars++) - (int32_t)*(srcChars++));
         if(result != 0) {
@@ -744,12 +744,12 @@ UnicodeString::doCompare( int32_t start,
 int8_t
 UnicodeString::doCompareCodePointOrder(int32_t start,
                                        int32_t length,
-                                       const UChar *srcChars,
+                                       const char16_t *srcChars,
                                        int32_t srcStart,
                                        int32_t srcLength) const
 {
   // compare illegal string values
-  // treat const UChar *srcChars==nullptr as an empty string
+  // treat const char16_t *srcChars==nullptr as an empty string
   if(isBogus()) {
     return -1;
   }
@@ -775,7 +775,7 @@ UnicodeString::getLength() const {
     return length();
 }
 
-UChar
+char16_t
 UnicodeString::getCharAt(int32_t offset) const {
   return charAt(offset);
 }
@@ -790,7 +790,7 @@ UnicodeString::char32At(int32_t offset) const
 {
   int32_t len = length();
   if((uint32_t)offset < (uint32_t)len) {
-    const UChar *array = getArrayStart();
+    const char16_t *array = getArrayStart();
     UChar32 c;
     U16_GET(array, 0, offset, len, c);
     return c;
@@ -802,7 +802,7 @@ UnicodeString::char32At(int32_t offset) const
 int32_t
 UnicodeString::getChar32Start(int32_t offset) const {
   if((uint32_t)offset < (uint32_t)length()) {
-    const UChar *array = getArrayStart();
+    const char16_t *array = getArrayStart();
     U16_SET_CP_START(array, 0, offset);
     return offset;
   } else {
@@ -814,7 +814,7 @@ int32_t
 UnicodeString::getChar32Limit(int32_t offset) const {
   int32_t len = length();
   if((uint32_t)offset < (uint32_t)len) {
-    const UChar *array = getArrayStart();
+    const char16_t *array = getArrayStart();
     U16_SET_CP_LIMIT(array, 0, offset, len);
     return offset;
   } else {
@@ -846,7 +846,7 @@ UnicodeString::moveIndex32(int32_t index, int32_t delta) const {
     index=len;
   }
 
-  const UChar *array = getArrayStart();
+  const char16_t *array = getArrayStart();
   if(delta>0) {
     U16_FWD_N(array, index, len, delta);
   } else {
@@ -859,14 +859,14 @@ UnicodeString::moveIndex32(int32_t index, int32_t delta) const {
 void
 UnicodeString::doExtract(int32_t start,
              int32_t length,
-             UChar *dst,
+             char16_t *dst,
              int32_t dstStart) const
 {
   // pin indices to legal values
   pinIndices(start, length);
 
   // do not copy anything if we alias dst itself
-  const UChar *array = getArrayStart();
+  const char16_t *array = getArrayStart();
   if(array + start != dst + dstStart) {
     us_arrayCopy(array, start, dst, dstStart, length);
   }
@@ -880,7 +880,7 @@ UnicodeString::extract(Char16Ptr dest, int32_t destCapacity,
     if(isBogus() || destCapacity<0 || (destCapacity>0 && dest==0)) {
       errorCode=U_ILLEGAL_ARGUMENT_ERROR;
     } else {
-      const UChar *array = getArrayStart();
+      const char16_t *array = getArrayStart();
       if(len>0 && len<=destCapacity && array!=dest) {
         u_memcpy(dest, array, len);
       }
@@ -916,7 +916,7 @@ UnicodeString::extract(int32_t start,
 UnicodeString
 UnicodeString::tempSubString(int32_t start, int32_t len) const {
   pinIndices(start, len);
-  const UChar *array = getBuffer();  // not getArrayStart() to check kIsBogus & kOpenGetBuffer
+  const char16_t *array = getBuffer();  // not getArrayStart() to check kIsBogus & kOpenGetBuffer
   if(array==nullptr) {
     array=fUnion.fStackFields.fBuffer;  // anything not nullptr because that would make an empty string
     len=-2;  // bogus result string
@@ -1023,7 +1023,7 @@ UnicodeString::toUTF32(UChar32 *utf32, int32_t capacity, UErrorCode &errorCode)
 }
 
 int32_t 
-UnicodeString::indexOf(const UChar *srcChars,
+UnicodeString::indexOf(const char16_t *srcChars,
                int32_t srcStart,
                int32_t srcLength,
                int32_t start,
@@ -1042,8 +1042,8 @@ UnicodeString::indexOf(const UChar *srcChars,
   pinIndices(start, length);
 
   // find the first occurrence of the substring
-  const UChar *array = getArrayStart();
-  const UChar *match = u_strFindFirst(array + start, length, srcChars + srcStart, srcLength);
+  const char16_t *array = getArrayStart();
+  const char16_t *match = u_strFindFirst(array + start, length, srcChars + srcStart, srcLength);
   if(match == nullptr) {
     return -1;
   } else {
@@ -1052,7 +1052,7 @@ UnicodeString::indexOf(const UChar *srcChars,
 }
 
 int32_t
-UnicodeString::doIndexOf(UChar c,
+UnicodeString::doIndexOf(char16_t c,
              int32_t start,
              int32_t length) const
 {
@@ -1060,8 +1060,8 @@ UnicodeString::doIndexOf(UChar c,
   pinIndices(start, length);
 
   // find the first occurrence of c
-  const UChar *array = getArrayStart();
-  const UChar *match = u_memchr(array + start, c, length);
+  const char16_t *array = getArrayStart();
+  const char16_t *match = u_memchr(array + start, c, length);
   if(match == nullptr) {
     return -1;
   } else {
@@ -1077,8 +1077,8 @@ UnicodeString::doIndexOf(UChar32 c,
   pinIndices(start, length);
 
   // find the first occurrence of c
-  const UChar *array = getArrayStart();
-  const UChar *match = u_memchr32(array + start, c, length);
+  const char16_t *array = getArrayStart();
+  const char16_t *match = u_memchr32(array + start, c, length);
   if(match == nullptr) {
     return -1;
   } else {
@@ -1087,7 +1087,7 @@ UnicodeString::doIndexOf(UChar32 c,
 }
 
 int32_t 
-UnicodeString::lastIndexOf(const UChar *srcChars,
+UnicodeString::lastIndexOf(const char16_t *srcChars,
                int32_t srcStart,
                int32_t srcLength,
                int32_t start,
@@ -1106,8 +1106,8 @@ UnicodeString::lastIndexOf(const UChar *srcChars,
   pinIndices(start, length);
 
   // find the last occurrence of the substring
-  const UChar *array = getArrayStart();
-  const UChar *match = u_strFindLast(array + start, length, srcChars + srcStart, srcLength);
+  const char16_t *array = getArrayStart();
+  const char16_t *match = u_strFindLast(array + start, length, srcChars + srcStart, srcLength);
   if(match == nullptr) {
     return -1;
   } else {
@@ -1116,7 +1116,7 @@ UnicodeString::lastIndexOf(const UChar *srcChars,
 }
 
 int32_t
-UnicodeString::doLastIndexOf(UChar c,
+UnicodeString::doLastIndexOf(char16_t c,
                  int32_t start,
                  int32_t length) const
 {
@@ -1128,8 +1128,8 @@ UnicodeString::doLastIndexOf(UChar c,
   pinIndices(start, length);
 
   // find the last occurrence of c
-  const UChar *array = getArrayStart();
-  const UChar *match = u_memrchr(array + start, c, length);
+  const char16_t *array = getArrayStart();
+  const char16_t *match = u_memrchr(array + start, c, length);
   if(match == nullptr) {
     return -1;
   } else {
@@ -1145,8 +1145,8 @@ UnicodeString::doLastIndexOf(UChar32 c,
   pinIndices(start, length);
 
   // find the last occurrence of c
-  const UChar *array = getArrayStart();
-  const UChar *match = u_memrchr32(array + start, c, length);
+  const char16_t *array = getArrayStart();
+  const char16_t *match = u_memrchr32(array + start, c, length);
   if(match == nullptr) {
     return -1;
   } else {
@@ -1220,7 +1220,7 @@ UnicodeString::getTerminatedBuffer() {
   if(!isWritable()) {
     return nullptr;
   }
-  UChar *array = getArrayStart();
+  char16_t *array = getArrayStart();
   int32_t len = length();
   if(len < getCapacity()) {
     if(fUnion.fFields.fLengthAndFlags & kBufferIsReadonly) {
@@ -1264,7 +1264,7 @@ UnicodeString::setTo(UBool isTerminated,
     return *this;
   }
 
-  const UChar *text = textPtr;
+  const char16_t *text = textPtr;
   if(text == nullptr) {
     // treat as an empty string, do not alias
     releaseArray();
@@ -1287,13 +1287,13 @@ UnicodeString::setTo(UBool isTerminated,
     textLength = u_strlen(text);
   }
   fUnion.fFields.fLengthAndFlags = kReadonlyAlias;
-  setArray((UChar *)text, textLength, isTerminated ? textLength + 1 : textLength);
+  setArray((char16_t *)text, textLength, isTerminated ? textLength + 1 : textLength);
   return *this;
 }
 
 // setTo() analogous to the writable-aliasing constructor with the same signature
 UnicodeString &
-UnicodeString::setTo(UChar *buffer,
+UnicodeString::setTo(char16_t *buffer,
                      int32_t buffLength,
                      int32_t buffCapacity) {
   if(fUnion.fFields.fLengthAndFlags & kOpenGetBuffer) {
@@ -1313,7 +1313,7 @@ UnicodeString::setTo(UChar *buffer,
     return *this;
   } else if(buffLength == -1) {
     // buffLength = u_strlen(buff); but do not look beyond buffCapacity
-    const UChar *p = buffer, *limit = buffer + buffCapacity;
+    const char16_t *p = buffer, *limit = buffer + buffCapacity;
     while(p != limit && *p != 0) {
       ++p;
     }
@@ -1337,7 +1337,7 @@ UnicodeString &UnicodeString::setToUTF8(StringPiece utf8) {
   } else {
     capacity = length + 1;  // +1 for the terminating NUL.
   }
-  UChar *utf16 = getBuffer(capacity);
+  char16_t *utf16 = getBuffer(capacity);
   int32_t length16;
   UErrorCode errorCode = U_ZERO_ERROR;
   u_strFromUTF8WithSub(utf16, getCapacity(), &length16,
@@ -1354,7 +1354,7 @@ UnicodeString &UnicodeString::setToUTF8(StringPiece utf8) {
 
 UnicodeString&
 UnicodeString::setCharAt(int32_t offset,
-             UChar c)
+             char16_t c)
 {
   int32_t len = length();
   if(cloneArrayIfNeeded() && len > 0) {
@@ -1373,7 +1373,7 @@ UnicodeString&
 UnicodeString::replace(int32_t start,
                int32_t _length,
                UChar32 srcChar) {
-  UChar buffer[U16_MAX_LENGTH];
+  char16_t buffer[U16_MAX_LENGTH];
   int32_t count = 0;
   UBool isError = false;
   U16_APPEND(buffer, count, U16_MAX_LENGTH, srcChar, isError);
@@ -1385,7 +1385,7 @@ UnicodeString::replace(int32_t start,
 
 UnicodeString&
 UnicodeString::append(UChar32 srcChar) {
-  UChar buffer[U16_MAX_LENGTH];
+  char16_t buffer[U16_MAX_LENGTH];
   int32_t _length = 0;
   UBool isError = false;
   U16_APPEND(buffer, _length, U16_MAX_LENGTH, srcChar, isError);
@@ -1412,7 +1412,7 @@ UnicodeString::doReplace( int32_t start,
 UnicodeString&
 UnicodeString::doReplace(int32_t start,
              int32_t length,
-             const UChar *srcChars,
+             const char16_t *srcChars,
              int32_t srcStart,
              int32_t srcLength)
 {
@@ -1471,7 +1471,7 @@ UnicodeString::doReplace(int32_t start,
   newLength += srcLength;
 
   // Check for insertion into ourself
-  const UChar *oldArray = getArrayStart();
+  const char16_t *oldArray = getArrayStart();
   if (isBufferWritable() &&
       oldArray < srcChars + srcLength &&
       srcChars < oldArray + oldLength) {
@@ -1486,7 +1486,7 @@ UnicodeString::doReplace(int32_t start,
 
   // cloneArrayIfNeeded(doCopyArray=false) may change fArray but will not copy the current contents;
   // therefore we need to keep the current fArray
-  UChar oldStackBuffer[US_STACKBUF_SIZE];
+  char16_t oldStackBuffer[US_STACKBUF_SIZE];
   if((fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) && (newLength > US_STACKBUF_SIZE)) {
     // copy the stack buffer contents because it will be overwritten with
     // fUnion.fFields values
@@ -1504,7 +1504,7 @@ UnicodeString::doReplace(int32_t start,
 
   // now do the replace
 
-  UChar *newArray = getArrayStart();
+  char16_t *newArray = getArrayStart();
   if(newArray != oldArray) {
     // if fArray changed, then we need to copy everything except what will change
     us_arrayCopy(oldArray, 0, newArray, 0, start);
@@ -1547,7 +1547,7 @@ UnicodeString::doAppend(const UnicodeString& src, int32_t srcStart, int32_t srcL
 }
 
 UnicodeString&
-UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength) {
+UnicodeString::doAppend(const char16_t *srcChars, int32_t srcStart, int32_t srcLength) {
   if(!isWritable() || srcLength == 0 || srcChars == nullptr) {
     return *this;
   }
@@ -1571,7 +1571,7 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
   }
 
   // Check for append onto ourself
-  const UChar* oldArray = getArrayStart();
+  const char16_t* oldArray = getArrayStart();
   if (isBufferWritable() &&
       oldArray < srcChars + srcLength &&
       srcChars < oldArray + oldLength) {
@@ -1587,9 +1587,9 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
   // optimize append() onto a large-enough, owned string
   if((newLength <= getCapacity() && isBufferWritable()) ||
       cloneArrayIfNeeded(newLength, getGrowCapacity(newLength))) {
-    UChar *newArray = getArrayStart();
+    char16_t *newArray = getArrayStart();
     // Do not copy characters when
-    //   UChar *buffer=str.getAppendBuffer(...);
+    //   char16_t *buffer=str.getAppendBuffer(...);
     // is followed by
     //   str.append(buffer, length);
     // or
@@ -1621,7 +1621,7 @@ UnicodeString::copy(int32_t start, int32_t limit, int32_t dest) {
     if (limit <= start) {
         return; // Nothing to do; avoid bogus malloc call
     }
-    UChar* text = (UChar*) uprv_malloc( sizeof(UChar) * (limit - start) );
+    char16_t* text = (char16_t*) uprv_malloc( sizeof(char16_t) * (limit - start) );
     // Check to make sure text is not null.
     if (text != nullptr) {
            extractBetween(start, limit, text, 0);
@@ -1659,9 +1659,9 @@ UnicodeString::doReverse(int32_t start, int32_t length) {
     return *this;
   }
 
-  UChar *left = getArrayStart() + start;
-  UChar *right = left + length - 1;  // -1 for inclusive boundary (length>=2)
-  UChar swap;
+  char16_t *left = getArrayStart() + start;
+  char16_t *right = left + length - 1;  // -1 for inclusive boundary (length>=2)
+  char16_t swap;
   UBool hasSupplementary = false;
 
   // Before the loop we know left<right because length>=2.
@@ -1676,7 +1676,7 @@ UnicodeString::doReverse(int32_t start, int32_t length) {
 
   /* if there are supplementary code points in the reversed range, then re-swap their surrogates */
   if(hasSupplementary) {
-    UChar swap2;
+    char16_t swap2;
 
     left = getArrayStart() + start;
     right = left + length - 1; // -1 so that we can look at *(left+1) if left<right
@@ -1695,14 +1695,14 @@ UnicodeString::doReverse(int32_t start, int32_t length) {
 
 UBool 
 UnicodeString::padLeading(int32_t targetLength,
-                          UChar padChar)
+                          char16_t padChar)
 {
   int32_t oldLength = length();
   if(oldLength >= targetLength || !cloneArrayIfNeeded(targetLength)) {
     return false;
   } else {
     // move contents up by padding width
-    UChar *array = getArrayStart();
+    char16_t *array = getArrayStart();
     int32_t start = targetLength - oldLength;
     us_arrayCopy(array, 0, array, start, oldLength);
 
@@ -1717,14 +1717,14 @@ UnicodeString::padLeading(int32_t targetLength,
 
 UBool 
 UnicodeString::padTrailing(int32_t targetLength,
-                           UChar padChar)
+                           char16_t padChar)
 {
   int32_t oldLength = length();
   if(oldLength >= targetLength || !cloneArrayIfNeeded(targetLength)) {
     return false;
   } else {
     // fill in padding character
-    UChar *array = getArrayStart();
+    char16_t *array = getArrayStart();
     int32_t length = targetLength;
     while(--length >= oldLength) {
       array[length] = padChar;
@@ -1741,7 +1741,7 @@ int32_t
 UnicodeString::doHashCode() const
 {
     /* Delegate hash computation to uhash.  This makes UnicodeString
-     * hashing consistent with UChar* hashing.  */
+     * hashing consistent with char16_t* hashing.  */
     int32_t hashCode = ustr_hashUCharsN(getArrayStart(), length());
     if (hashCode == kInvalidHashCode) {
         hashCode = kEmptyHashCode;
@@ -1771,7 +1771,7 @@ UnicodeString::releaseBuffer(int32_t newLength) {
     int32_t capacity=getCapacity();
     if(newLength==-1) {
       // the new length is the string length, capped by fCapacity
-      const UChar *array=getArrayStart(), *p=array, *limit=array+capacity;
+      const char16_t *array=getArrayStart(), *p=array, *limit=array+capacity;
       while(p<limit && *p!=0) {
         ++p;
       }
@@ -1826,8 +1826,8 @@ UnicodeString::cloneArrayIfNeeded(int32_t newCapacity,
     }
 
     // save old values
-    UChar oldStackBuffer[US_STACKBUF_SIZE];
-    UChar *oldArray;
+    char16_t oldStackBuffer[US_STACKBUF_SIZE];
+    char16_t *oldArray;
     int32_t oldLength = length();
     int16_t flags = fUnion.fFields.fLengthAndFlags;
 
@@ -1901,13 +1901,13 @@ UnicodeString::cloneArrayIfNeeded(int32_t newCapacity,
 UnicodeStringAppendable::~UnicodeStringAppendable() {}
 
 UBool
-UnicodeStringAppendable::appendCodeUnit(UChar c) {
+UnicodeStringAppendable::appendCodeUnit(char16_t c) {
   return str.doAppend(&c, 0, 1).isWritable();
 }
 
 UBool
 UnicodeStringAppendable::appendCodePoint(UChar32 c) {
-  UChar buffer[U16_MAX_LENGTH];
+  char16_t buffer[U16_MAX_LENGTH];
   int32_t cLength = 0;
   UBool isError = false;
   U16_APPEND(buffer, cLength, U16_MAX_LENGTH, c, isError);
@@ -1915,7 +1915,7 @@ UnicodeStringAppendable::appendCodePoint(UChar32 c) {
 }
 
 UBool
-UnicodeStringAppendable::appendString(const UChar *s, int32_t length) {
+UnicodeStringAppendable::appendString(const char16_t *s, int32_t length) {
   return str.doAppend(s, 0, length).isWritable();
 }
 
@@ -1924,10 +1924,10 @@ UnicodeStringAppendable::reserveAppendCapacity(int32_t appendCapacity) {
   return str.cloneArrayIfNeeded(str.length() + appendCapacity);
 }
 
-UChar *
+char16_t *
 UnicodeStringAppendable::getAppendBuffer(int32_t minCapacity,
                                          int32_t desiredCapacityHint,
-                                         UChar *scratch, int32_t scratchCapacity,
+                                         char16_t *scratch, int32_t scratchCapacity,
                                          int32_t *resultCapacity) {
   if(minCapacity < 1 || scratchCapacity < minCapacity) {
     *resultCapacity = 0;
index efd956d703239b187d7fc7f8392265f3f9b7068d..57f307c203a5115bbe5c9d9279a399d3580a8796 100644 (file)
@@ -41,13 +41,13 @@ U_NAMESPACE_BEGIN
 int8_t
 UnicodeString::doCaseCompare(int32_t start,
                              int32_t length,
-                             const UChar *srcChars,
+                             const char16_t *srcChars,
                              int32_t srcStart,
                              int32_t srcLength,
                              uint32_t options) const
 {
   // compare illegal string values
-  // treat const UChar *srcChars==nullptr as an empty string
+  // treat const char16_t *srcChars==nullptr as an empty string
   if(isBogus()) {
     return -1;
   }
@@ -60,7 +60,7 @@ UnicodeString::doCaseCompare(int32_t start,
   }
 
   // get the correct pointer
-  const UChar *chars = getArrayStart();
+  const char16_t *chars = getArrayStart();
 
   chars += start;
   if(srcStart!=0) {
@@ -98,8 +98,8 @@ UnicodeString::caseMap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITER
     return *this;
   }
 
-  UChar oldBuffer[2 * US_STACKBUF_SIZE];
-  UChar *oldArray;
+  char16_t oldBuffer[2 * US_STACKBUF_SIZE];
+  char16_t *oldArray;
   int32_t oldLength = length();
   int32_t newLength;
   UBool writable = isBufferWritable();
@@ -115,7 +115,7 @@ UnicodeString::caseMap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITER
   if (writable ? oldLength <= UPRV_LENGTHOF(oldBuffer) : oldLength < US_STACKBUF_SIZE) {
     // Short string: Copy the contents into a temporary buffer and
     // case-map back into the current array, or into the stack buffer.
-    UChar *buffer = getArrayStart();
+    char16_t *buffer = getArrayStart();
     int32_t capacity;
     oldArray = oldBuffer;
     u_memcpy(oldBuffer, buffer, oldLength);
@@ -155,7 +155,7 @@ UnicodeString::caseMap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITER
     // and often does not change its length.
     oldArray = getArrayStart();
     Edits edits;
-    UChar replacementChars[200];
+    char16_t replacementChars[200];
 #if !UCONFIG_NO_BREAK_ITERATION
     if (iter != nullptr) {
       oldString.setTo(false, oldArray, oldLength);
index afaf5f085f59bb757988c9c30b9befdee4c795cf..2d649b2d511d6a0f7abd89b85a49279c5c7463d6 100644 (file)
@@ -259,7 +259,7 @@ UnicodeString::doExtract(int32_t start, int32_t length,
         return 0;
     }
 
-    const UChar *src=getArrayStart()+start, *srcLimit=src+length;
+    const char16_t *src=getArrayStart()+start, *srcLimit=src+length;
     char *originalDest=dest;
     const char *destLimit;
 
@@ -366,7 +366,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
     // set up the conversion parameters
     const char *mySource     = codepageData;
     const char *mySourceEnd  = mySource + dataLength;
-    UChar *array, *myTarget;
+    char16_t *array, *myTarget;
 
     // estimate the size needed:
     int32_t arraySize;
@@ -374,7 +374,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
         // try to use the stack buffer
         arraySize = US_STACKBUF_SIZE;
     } else {
-        // 1.25 UChar's per source byte should cover most cases
+        // 1.25 char16_t's per source byte should cover most cases
         arraySize = dataLength + (dataLength >> 2);
     }
 
@@ -404,7 +404,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
             doCopyArray = true;
 
             // estimate the new size needed, larger than before
-            // try 2 UChar's per remaining source byte
+            // try 2 char16_t's per remaining source byte
             arraySize = (int32_t)(length() + 2 * (mySourceEnd - mySource));
         } else {
             break;
index 40064757902ca8cac079153d8886293080694a9a..3d05233bb9a0830ca6418e8395963ef01fa05cd7 100644 (file)
@@ -32,7 +32,7 @@ UnicodeString::trim()
     return *this;
   }
 
-  UChar *array = getArrayStart();
+  char16_t *array = getArrayStart();
   UChar32 c;
   int32_t oldLength = this->length();
   int32_t i = oldLength, length;
index 75fcb9e775f1ebcace578d4add7ebe26267040d8..ac49b5f2f96965af7227f54bc56ca2da6e0e764e 100644 (file)
@@ -31,7 +31,7 @@ U_NAMESPACE_BEGIN
  * {
  *     UnicodeStringAppender appender(astring);
  *     for (int32_t i = 0; i < 100; ++i) {
- *        appender.append((UChar) i);
+ *        appender.append((char16_t) i);
  *     }
  *     // appender flushed automatically when it goes out of scope.
  * }
@@ -45,7 +45,7 @@ public:
      */
     UnicodeStringAppender(UnicodeString &dest) : fDest(&dest), fIdx(0) { }
 
-    inline void append(UChar x) {
+    inline void append(char16_t x) {
         if (fIdx == UPRV_LENGTHOF(fBuffer)) {
             fDest->append(fBuffer, 0, fIdx);
             fIdx = 0;
@@ -80,7 +80,7 @@ public:
 private:
     UnicodeString *fDest;
     int32_t fIdx;
-    UChar fBuffer[32];
+    char16_t fBuffer[32];
     UnicodeStringAppender(const UnicodeStringAppender &other);
     UnicodeStringAppender &operator=(const UnicodeStringAppender &other);
 };
index edb394c3be131c8fc76b8ecd5faada541c9fc1c3..f2ef7fa66489d7f2786ee0d533dda17fe5975270 100644 (file)
@@ -44,7 +44,7 @@ U_NAMESPACE_USE
 /* quick check functions ---------------------------------------------------- */
 
 U_CAPI UNormalizationCheckResult U_EXPORT2
-unorm_quickCheck(const UChar *src,
+unorm_quickCheck(const char16_t *src,
                  int32_t srcLength, 
                  UNormalizationMode mode,
                  UErrorCode *pErrorCode) {
@@ -53,7 +53,7 @@ unorm_quickCheck(const UChar *src,
 }
 
 U_CAPI UNormalizationCheckResult U_EXPORT2
-unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength, 
+unorm_quickCheckWithOptions(const char16_t *src, int32_t srcLength,
                             UNormalizationMode mode, int32_t options,
                             UErrorCode *pErrorCode) {
     const Normalizer2 *n2=Normalizer2Factory::getInstance(mode, *pErrorCode);
@@ -68,7 +68,7 @@ unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength,
 }
 
 U_CAPI UBool U_EXPORT2
-unorm_isNormalized(const UChar *src, int32_t srcLength,
+unorm_isNormalized(const char16_t *src, int32_t srcLength,
                    UNormalizationMode mode,
                    UErrorCode *pErrorCode) {
     const Normalizer2 *n2=Normalizer2Factory::getInstance(mode, *pErrorCode);
@@ -76,7 +76,7 @@ unorm_isNormalized(const UChar *src, int32_t srcLength,
 }
 
 U_CAPI UBool U_EXPORT2
-unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
+unorm_isNormalizedWithOptions(const char16_t *src, int32_t srcLength,
                               UNormalizationMode mode, int32_t options,
                               UErrorCode *pErrorCode) {
     const Normalizer2 *n2=Normalizer2Factory::getInstance(mode, *pErrorCode);
@@ -94,9 +94,9 @@ unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength,
 
 /** Public API for normalizing. */
 U_CAPI int32_t U_EXPORT2
-unorm_normalize(const UChar *src, int32_t srcLength,
+unorm_normalize(const char16_t *src, int32_t srcLength,
                 UNormalizationMode mode, int32_t options,
-                UChar *dest, int32_t destCapacity,
+                char16_t *dest, int32_t destCapacity,
                 UErrorCode *pErrorCode) {
     const Normalizer2 *n2=Normalizer2Factory::getInstance(mode, *pErrorCode);
     if(options&UNORM_UNICODE_3_2) {
@@ -115,7 +115,7 @@ unorm_normalize(const UChar *src, int32_t srcLength,
 
 static int32_t
 _iterate(UCharIterator *src, UBool forward,
-              UChar *dest, int32_t destCapacity,
+              char16_t *dest, int32_t destCapacity,
               const Normalizer2 *n2,
               UBool doNormalize, UBool *pNeededToNormalize,
               UErrorCode *pErrorCode) {
@@ -175,7 +175,7 @@ _iterate(UCharIterator *src, UBool forward,
 
 static int32_t
 unorm_iterate(UCharIterator *src, UBool forward,
-              UChar *dest, int32_t destCapacity,
+              char16_t *dest, int32_t destCapacity,
               UNormalizationMode mode, int32_t options,
               UBool doNormalize, UBool *pNeededToNormalize,
               UErrorCode *pErrorCode) {
@@ -195,7 +195,7 @@ unorm_iterate(UCharIterator *src, UBool forward,
 
 U_CAPI int32_t U_EXPORT2
 unorm_previous(UCharIterator *src,
-               UChar *dest, int32_t destCapacity,
+               char16_t *dest, int32_t destCapacity,
                UNormalizationMode mode, int32_t options,
                UBool doNormalize, UBool *pNeededToNormalize,
                UErrorCode *pErrorCode) {
@@ -208,7 +208,7 @@ unorm_previous(UCharIterator *src,
 
 U_CAPI int32_t U_EXPORT2
 unorm_next(UCharIterator *src,
-           UChar *dest, int32_t destCapacity,
+           char16_t *dest, int32_t destCapacity,
            UNormalizationMode mode, int32_t options,
            UBool doNormalize, UBool *pNeededToNormalize,
            UErrorCode *pErrorCode) {
@@ -222,9 +222,9 @@ unorm_next(UCharIterator *src,
 /* Concatenation of normalized strings -------------------------------------- */
 
 static int32_t
-_concatenate(const UChar *left, int32_t leftLength,
-                  const UChar *right, int32_t rightLength,
-                  UChar *dest, int32_t destCapacity,
+_concatenate(const char16_t *left, int32_t leftLength,
+                  const char16_t *right, int32_t rightLength,
+                  char16_t *dest, int32_t destCapacity,
                   const Normalizer2 *n2,
                   UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
@@ -258,9 +258,9 @@ _concatenate(const UChar *left, int32_t leftLength,
 }
 
 U_CAPI int32_t U_EXPORT2
-unorm_concatenate(const UChar *left, int32_t leftLength,
-                  const UChar *right, int32_t rightLength,
-                  UChar *dest, int32_t destCapacity,
+unorm_concatenate(const char16_t *left, int32_t leftLength,
+                  const char16_t *right, int32_t rightLength,
+                  char16_t *dest, int32_t destCapacity,
                   UNormalizationMode mode, int32_t options,
                   UErrorCode *pErrorCode) {
     const Normalizer2 *n2=Normalizer2Factory::getInstance(mode, *pErrorCode);
index 29eb5aa42654d1169f5130a874f0c6e3d80263a2..e11e716c8db6dde6126875a8bbc54b3872f88777 100644 (file)
@@ -128,7 +128,7 @@ U_NAMESPACE_USE
 
 /* stack element for previous-level source/decomposition pointers */
 struct CmpEquivLevel {
-    const UChar *start, *s, *limit;
+    const char16_t *start, *s, *limit;
 };
 typedef struct CmpEquivLevel CmpEquivLevel;
 
@@ -140,27 +140,27 @@ typedef struct CmpEquivLevel CmpEquivLevel;
 
 /* internal function */
 static int32_t
-unorm_cmpEquivFold(const UChar *s1, int32_t length1,
-                   const UChar *s2, int32_t length2,
+unorm_cmpEquivFold(const char16_t *s1, int32_t length1,
+                   const char16_t *s2, int32_t length2,
                    uint32_t options,
                    UErrorCode *pErrorCode) {
     const Normalizer2Impl *nfcImpl;
 
     /* current-level start/limit - s1/s2 as current */
-    const UChar *start1, *start2, *limit1, *limit2;
+    const char16_t *start1, *start2, *limit1, *limit2;
 
     /* decomposition and case folding variables */
-    const UChar *p;
+    const char16_t *p;
     int32_t length;
 
     /* stacks of previous-level start/current/limit */
     CmpEquivLevel stack1[2], stack2[2];
 
     /* buffers for algorithmic decompositions */
-    UChar decomp1[4], decomp2[4];
+    char16_t decomp1[4], decomp2[4];
 
     /* case folding buffers, only use current-level start/limit */
-    UChar fold1[UCASE_MAX_STRING_LENGTH+1], fold2[UCASE_MAX_STRING_LENGTH+1];
+    char16_t fold1[UCASE_MAX_STRING_LENGTH+1], fold2[UCASE_MAX_STRING_LENGTH+1];
 
     /* track which is the current level per string */
     int32_t level1, level2;
@@ -277,7 +277,7 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1,
         /* get complete code points for c1, c2 for lookups if either is a surrogate */
         cp1=c1;
         if(U_IS_SURROGATE(c1)) {
-            UChar c;
+            char16_t c;
 
             if(U_IS_SURROGATE_LEAD(c1)) {
                 if(s1!=limit1 && U16_IS_TRAIL(c=*s1)) {
@@ -293,7 +293,7 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1,
 
         cp2=c2;
         if(U_IS_SURROGATE(c2)) {
-            UChar c;
+            char16_t c;
 
             if(U_IS_SURROGATE_LEAD(c2)) {
                 if(s2!=limit2 && U16_IS_TRAIL(c=*s2)) {
@@ -529,7 +529,7 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1,
 }
 
 static
-UBool _normalize(const Normalizer2 *n2, const UChar *s, int32_t length,
+UBool _normalize(const Normalizer2 *n2, const char16_t *s, int32_t length,
                 UnicodeString &normalized, UErrorCode *pErrorCode) {
     UnicodeString str(length<0, s, length);
 
@@ -558,8 +558,8 @@ UBool _normalize(const Normalizer2 *n2, const UChar *s, int32_t length,
 }
 
 U_CAPI int32_t U_EXPORT2
-unorm_compare(const UChar *s1, int32_t length1,
-              const UChar *s2, int32_t length2,
+unorm_compare(const char16_t *s1, int32_t length1,
+              const char16_t *s2, int32_t length2,
               uint32_t options,
               UErrorCode *pErrorCode) {
     /* argument checking */
index d2604adb4a91fa47a79e6dbe5fe01730398553e4..f107eac67f11751dfa7a6b74dd236be5e30cddb3 100644 (file)
@@ -388,7 +388,7 @@ enum {
  *
  * Strings are either stored as a single code unit or as the length
  * followed by that many units.
- *   const UChar *s=extraData+(index from auxTrie data bits 9..0);
+ *   const char16_t *s=extraData+(index from auxTrie data bits 9..0);
  *   int32_t length;
  *   if(*s<0xff00) {
  *     // s points to the single-unit string
index 2bdb22ac050ca902563ef6021f716a003805771d..28540186c6633ed789a51d0bd8126e34199fdde9 100644 (file)
@@ -241,11 +241,11 @@ static UBool changesWhenCasefolded(const BinaryProperty &/*prop*/, UChar32 c, UP
     }
     if(c>=0) {
         /* single code point */
-        const UChar *resultString;
+        const char16_t *resultString;
         return (UBool)(ucase_toFullFolding(c, &resultString, U_FOLD_CASE_DEFAULT)>=0);
     } else {
         /* guess some large but stack-friendly capacity */
-        UChar dest[2*UCASE_MAX_STRING_LENGTH];
+        char16_t dest[2*UCASE_MAX_STRING_LENGTH];
         int32_t destLength;
         destLength=u_strFoldCase(dest, UPRV_LENGTHOF(dest),
                                   nfd.getBuffer(), nfd.length(),
@@ -276,7 +276,7 @@ static UBool changesWhenNFKC_Casefolded(const BinaryProperty &/*prop*/, UChar32
         ReorderingBuffer buffer(*kcf, dest);
         // Small destCapacity for NFKC_CF(c).
         if(buffer.init(5, errorCode)) {
-            const UChar *srcArray=src.getBuffer();
+            const char16_t *srcArray=src.getBuffer();
             kcf->compose(srcArray, srcArray+src.length(), false,
                           true, buffer, errorCode);
         }
@@ -437,7 +437,7 @@ u_isIDPart(UChar32 c) {
 }
 
 U_CAPI UBool U_EXPORT2
-u_stringHasBinaryProperty(const UChar *s, int32_t length, UProperty which) {
+u_stringHasBinaryProperty(const char16_t *s, int32_t length, UProperty which) {
     if (s == nullptr && length != 0) { return false; }
     if (length == 1) {
         return u_hasBinaryProperty(s[0], which);  // single code point
@@ -793,7 +793,7 @@ uprops_addPropertyStarts(UPropertySource src, const USetAdder *sa, UErrorCode *p
 #if !UCONFIG_NO_NORMALIZATION
 
 U_CAPI int32_t U_EXPORT2
-u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode) {
+u_getFC_NFKC_Closure(UChar32 c, char16_t *dest, int32_t destCapacity, UErrorCode *pErrorCode) {
     if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) {
         return 0;
     }
@@ -813,7 +813,7 @@ u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *p
     }
     // first: b = NFKC(Fold(a))
     UnicodeString folded1String;
-    const UChar *folded1;
+    const char16_t *folded1;
     int32_t folded1Length=ucase_toFullFolding(c, &folded1, U_FOLD_CASE_DEFAULT);
     if(folded1Length<0) {
         const Normalizer2Impl *nfkcImpl=Normalizer2Factory::getImpl(nfkc);
index 90b0a22d01a9d4eee6f6e4d4647f196cb2b44c49..0a2b1e912c6cb8d8e2413b343585e9e1c2b1b645 100644 (file)
@@ -27,7 +27,7 @@
 #include "ustr_cnv.h"
 
 U_CAPI UResourceBundle * U_EXPORT2
-ures_openU(const UChar *myPath, 
+ures_openU(const char16_t *myPath,
            const char *localeID, 
            UErrorCode *status)
 {
index 646c173bef972becc47f7b3e03fa96cafd4a40f8..543420672272e377484355edb2f4b014914cafc1 100644 (file)
@@ -602,7 +602,7 @@ static UResourceDataEntry *init_entry(const char *localeID, const char *path, UE
                 aliasres = res_getResource(&(r->fData), "%%ALIAS");
                 if (aliasres != RES_BOGUS) {
                     // No tracing: called during initial data loading
-                    const UChar *alias = res_getStringNoTrace(&(r->fData), aliasres, &aliasLen);
+                    const char16_t *alias = res_getStringNoTrace(&(r->fData), aliasres, &aliasLen);
                     if(alias != nullptr && aliasLen > 0) { /* if there is actual alias - unload and load new data */
                         u_UCharsToChars(alias, aliasName, aliasLen+1);
                         r->fAlias = init_entry(aliasName, path, status);
@@ -751,7 +751,7 @@ loadParentsExceptRoot(UResourceDataEntry *&t1,
         if (parentRes != RES_BOGUS) {  // An explicit parent was found.
             int32_t parentLocaleLen = 0;
             // No tracing: called during initial data loading
-            const UChar *parentLocaleName = res_getStringNoTrace(&(t1->fData), parentRes, &parentLocaleLen);
+            const char16_t *parentLocaleName = res_getStringNoTrace(&(t1->fData), parentRes, &parentLocaleLen);
             if(parentLocaleName != nullptr && 0 < parentLocaleLen && parentLocaleLen < nameCapacity) {
                 u_UCharsToChars(parentLocaleName, name, parentLocaleLen + 1);
                 if (uprv_strcmp(name, kRootLocaleName) == 0) {
@@ -1167,7 +1167,7 @@ UResourceBundle *getAliasTargetAsResourceBundle(
     if (U_FAILURE(*status)) { return resB; }
     U_ASSERT(RES_GET_TYPE(r) == URES_ALIAS);
     int32_t len = 0;
-    const UChar *alias = res_getAlias(&resData, r, &len);
+    const char16_t *alias = res_getAlias(&resData, r, &len);
     if(len <= 0) {
         // bad alias
         *status = U_ILLEGAL_ARGUMENT_ERROR;
@@ -1520,8 +1520,8 @@ UResourceBundle *ures_copyResb(UResourceBundle *r, const UResourceBundle *origin
  * Functions to retrieve data from resource bundles.
  */
 
-U_CAPI const UChar* U_EXPORT2 ures_getString(const UResourceBundle* resB, int32_t* len, UErrorCode* status) {
-    const UChar *s;
+U_CAPI const char16_t* U_EXPORT2 ures_getString(const UResourceBundle* resB, int32_t* len, UErrorCode* status) {
+    const char16_t *s;
     if (status==nullptr || U_FAILURE(*status)) {
         return nullptr;
     }
@@ -1537,7 +1537,7 @@ U_CAPI const UChar* U_EXPORT2 ures_getString(const UResourceBundle* resB, int32_
 }
 
 static const char *
-ures_toUTF8String(const UChar *s16, int32_t length16,
+ures_toUTF8String(const char16_t *s16, int32_t length16,
                   char *dest, int32_t *pLength,
                   UBool forceCopy,
                   UErrorCode *status) {
@@ -1575,7 +1575,7 @@ ures_toUTF8String(const UChar *s16, int32_t length16,
         }
         if (!forceCopy && (length16 <= 0x2aaaaaaa)) {
             /*
-             * We know the string will fit into dest because each UChar turns
+             * We know the string will fit into dest because each char16_t turns
              * into at most three UTF-8 bytes. Fill the latter part of dest
              * so that callers do not expect to use dest as a string pointer,
              * hopefully leading to more robust code for when resource bundles
@@ -1604,7 +1604,7 @@ ures_getUTF8String(const UResourceBundle *resB,
                    UBool forceCopy,
                    UErrorCode *status) {
     int32_t length16;
-    const UChar *s16 = ures_getString(resB, &length16, status);
+    const char16_t *s16 = ures_getString(resB, &length16, status);
     return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
 }
 
@@ -1705,9 +1705,9 @@ U_CAPI int32_t U_EXPORT2 ures_getSize(const UResourceBundle *resB) {
   return resB->fSize;
 }
 
-static const UChar* ures_getStringWithAlias(const UResourceBundle *resB, Resource r, int32_t sIndex, int32_t *len, UErrorCode *status) {
+static const char16_t* ures_getStringWithAlias(const UResourceBundle *resB, Resource r, int32_t sIndex, int32_t *len, UErrorCode *status) {
   if(RES_GET_TYPE(r) == URES_ALIAS) {
-    const UChar* result = 0;
+    const char16_t* result = 0;
     UResourceBundle *tempRes = ures_getByIndex(resB, sIndex, nullptr, status);
     result = ures_getString(tempRes, len, status);
     ures_close(tempRes);
@@ -1731,7 +1731,7 @@ U_CAPI UBool U_EXPORT2 ures_hasNext(const UResourceBundle *resB) {
   return (UBool)(resB->fIndex < resB->fSize-1);
 }
 
-U_CAPI const UChar* U_EXPORT2 ures_getNextString(UResourceBundle *resB, int32_t* len, const char ** key, UErrorCode *status) {
+U_CAPI const char16_t* U_EXPORT2 ures_getNextString(UResourceBundle *resB, int32_t* len, const char ** key, UErrorCode *status) {
   Resource r = RES_BOGUS;
   
   if (status==nullptr || U_FAILURE(*status)) {
@@ -1878,7 +1878,7 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_getByIndex(const UResourceBundle *resB, i
     return fillIn;
 }
 
-U_CAPI const UChar* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resB, int32_t indexS, int32_t* len, UErrorCode *status) {
+U_CAPI const char16_t* U_EXPORT2 ures_getStringByIndex(const UResourceBundle *resB, int32_t indexS, int32_t* len, UErrorCode *status) {
     const char* key = nullptr;
     Resource r = RES_BOGUS;
 
@@ -1935,7 +1935,7 @@ ures_getUTF8StringByIndex(const UResourceBundle *resB,
                           UBool forceCopy,
                           UErrorCode *status) {
     int32_t length16;
-    const UChar *s16 = ures_getStringByIndex(resB, idx, &length16, status);
+    const char16_t *s16 = ures_getStringByIndex(resB, idx, &length16, status);
     return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
 }
 
@@ -2025,14 +2025,14 @@ ures_findSubResource(const UResourceBundle *resB, char* path, UResourceBundle *f
 
   return result;
 }
-U_CAPI const UChar* U_EXPORT2 
+U_CAPI const char16_t* U_EXPORT2
 ures_getStringByKeyWithFallback(const UResourceBundle *resB, 
                                 const char* inKey, 
                                 int32_t* len,
                                 UErrorCode *status) {
 
     UResourceBundle stack;
-    const UChar* retVal = nullptr;
+    const char16_t* retVal = nullptr;
     ures_initStackObject(&stack);
     ures_getByKeyWithFallback(resB, inKey, &stack, status);
     int32_t length;
@@ -2483,7 +2483,7 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_getByKey(const UResourceBundle *resB, con
     return fillIn;
 }
 
-U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, const char* inKey, int32_t* len, UErrorCode *status) {
+U_CAPI const char16_t* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, const char* inKey, int32_t* len, UErrorCode *status) {
     Resource res = RES_BOGUS;
     UResourceDataEntry *dataEntry = nullptr;
     const char* key = inKey;
@@ -2513,7 +2513,7 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
                         return res_getString({resB, key}, &dataEntry->fData, res, len);
                     case URES_ALIAS:
                       {
-                        const UChar* result = 0;
+                        const char16_t* result = 0;
                         UResourceBundle *tempRes = ures_getByKey(resB, inKey, nullptr, status);
                         result = ures_getString(tempRes, len, status);
                         ures_close(tempRes);
@@ -2535,7 +2535,7 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
                 return res_getString({resB, key}, &resB->getResData(), res, len);
             case URES_ALIAS:
               {
-                const UChar* result = 0;
+                const char16_t* result = 0;
                 UResourceBundle *tempRes = ures_getByKey(resB, inKey, nullptr, status);
                 result = ures_getString(tempRes, len, status);
                 ures_close(tempRes);
@@ -2573,7 +2573,7 @@ ures_getUTF8StringByKey(const UResourceBundle *resB,
                         UBool forceCopy,
                         UErrorCode *status) {
     int32_t length16;
-    const UChar *s16 = ures_getStringByKey(resB, key, &length16, status);
+    const char16_t *s16 = ures_getStringByKey(resB, key, &length16, status);
     return ures_toUTF8String(s16, length16, dest, pLength, forceCopy, status);
 }
 
@@ -2805,7 +2805,7 @@ ures_getVersionNumberInternal(const UResourceBundle *resourceBundle)
         int32_t minor_len = 0;
         int32_t len;
 
-        const UChar* minor_version = ures_getStringByKey(resourceBundle, kVersionTag, &minor_len, &status);
+        const char16_t* minor_version = ures_getStringByKey(resourceBundle, kVersionTag, &minor_len, &status);
         
         /* Determine the length of of the final version string.  This is */
         /* the length of the major part + the length of the separator */
@@ -3039,7 +3039,7 @@ ures_getFunctionalEquivalent(char *result, int32_t resultCapacity,
         } else if(subStatus == U_ZERO_ERROR) {
             ures_getByKey(res,resName,&bund1, &subStatus);
             if(subStatus == U_ZERO_ERROR) {
-                const UChar *defUstr;
+                const char16_t *defUstr;
                 int32_t defLen;
                 /* look for default item */
 #if defined(URES_TREE_DEBUG)
@@ -3114,7 +3114,7 @@ ures_getFunctionalEquivalent(char *result, int32_t resultCapacity,
                     }
                         /* now, recalculate default kw if need be */
                         if(uprv_strlen(defLoc) > uprv_strlen(full)) {
-                          const UChar *defUstr;
+                          const char16_t *defUstr;
                           int32_t defLen;
                           /* look for default item */
 #if defined(URES_TREE_DEBUG)
@@ -3190,7 +3190,7 @@ ures_getFunctionalEquivalent(char *result, int32_t resultCapacity,
                         
                         /* now, recalculate default kw if need be */
                         if(uprv_strlen(defLoc) > uprv_strlen(full)) {
-                          const UChar *defUstr;
+                          const char16_t *defUstr;
                           int32_t defLen;
                           /* look for default item */
 #if defined(URES_TREE_DEBUG)
@@ -3451,7 +3451,7 @@ ures_getParentBundle(const UResourceBundle* res){
 
 U_CAPI void U_EXPORT2
 ures_getVersionByKey(const UResourceBundle* res, const char *key, UVersionInfo ver, UErrorCode *status) {
-  const UChar *str;
+  const char16_t *str;
   int32_t len;
   str = ures_getStringByKey(res, key, &len, status);
   if(U_SUCCESS(*status)) {
index 30f05fbb2b19f67619425d01e2cabe108cb507bc..b219e40e218539dda9a0378c5a483cac28e632f9 100644 (file)
@@ -62,8 +62,8 @@ static const struct {
 
 static const struct {
     int32_t length;
-    UChar nul;
-    UChar pad;
+    char16_t nul;
+    char16_t pad;
 } gEmptyString={ 0, 0, 0 };
 
 /*
@@ -307,17 +307,17 @@ res_getPublicType(Resource res) {
     return (UResType)gPublicTypes[RES_GET_TYPE(res)];
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 res_getStringNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength) {
-    const UChar *p;
+    const char16_t *p;
     uint32_t offset=RES_GET_OFFSET(res);
     int32_t length;
     if(RES_GET_TYPE(res)==URES_STRING_V2) {
         int32_t first;
         if((int32_t)offset<pResData->poolStringIndexLimit) {
-            p=(const UChar *)pResData->poolBundleStrings+offset;
+            p=(const char16_t *)pResData->poolBundleStrings+offset;
         } else {
-            p=(const UChar *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit);
+            p=(const char16_t *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit);
         }
         first=*p;
         if(!U16_IS_TRAIL(first)) {
@@ -335,7 +335,7 @@ res_getStringNoTrace(const ResourceData *pResData, Resource res, int32_t *pLengt
     } else if(res==offset) /* RES_GET_TYPE(res)==URES_STRING */ {
         const int32_t *p32= res==0 ? &gEmptyString.length : pResData->pRoot+res;
         length=*p32++;
-        p=(const UChar *)p32;
+        p=(const char16_t *)p32;
     } else {
         p=nullptr;
         length=0;
@@ -361,14 +361,14 @@ UBool isNoInheritanceMarker(const ResourceData *pResData, Resource res) {
     } else if (res == offset) {
         const int32_t *p32=pResData->pRoot+res;
         int32_t length=*p32;
-        const UChar *p=(const UChar *)p32;
+        const char16_t *p=(const char16_t *)p32;
         return length == 3 && p[2] == 0x2205 && p[3] == 0x2205 && p[4] == 0x2205;
     } else if (RES_GET_TYPE(res) == URES_STRING_V2) {
-        const UChar *p;
+        const char16_t *p;
         if((int32_t)offset<pResData->poolStringIndexLimit) {
-            p=(const UChar *)pResData->poolBundleStrings+offset;
+            p=(const char16_t *)pResData->poolBundleStrings+offset;
         } else {
-            p=(const UChar *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit);
+            p=(const char16_t *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit);
         }
         int32_t first=*p;
         if (first == 0x2205) {  // implicit length
@@ -404,7 +404,7 @@ int32_t getStringArray(const ResourceData *pResData, const icu::ResourceArray &a
     for(int32_t i = 0; i < length; ++i) {
         int32_t sLength;
         // No tracing: handled by the caller
-        const UChar *s = res_getStringNoTrace(pResData, array.internalGetResource(pResData, i), &sLength);
+        const char16_t *s = res_getStringNoTrace(pResData, array.internalGetResource(pResData, i), &sLength);
         if(s == nullptr) {
             errorCode = U_RESOURCE_TYPE_MISMATCH;
             return 0;
@@ -416,15 +416,15 @@ int32_t getStringArray(const ResourceData *pResData, const icu::ResourceArray &a
 
 }  // namespace
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 res_getAlias(const ResourceData *pResData, Resource res, int32_t *pLength) {
-    const UChar *p;
+    const char16_t *p;
     uint32_t offset=RES_GET_OFFSET(res);
     int32_t length;
     if(RES_GET_TYPE(res)==URES_ALIAS) {
         const int32_t *p32= offset==0 ? &gEmptyString.length : pResData->pRoot+offset;
         length=*p32++;
-        p=(const UChar *)p32;
+        p=(const char16_t *)p32;
     } else {
         p=nullptr;
         length=0;
@@ -505,22 +505,22 @@ UResType ResourceDataValue::getType() const {
     return res_getPublicType(res);
 }
 
-const UChar *ResourceDataValue::getString(int32_t &length, UErrorCode &errorCode) const {
+const char16_t *ResourceDataValue::getString(int32_t &length, UErrorCode &errorCode) const {
     if(U_FAILURE(errorCode)) {
         return nullptr;
     }
-    const UChar *s = res_getString(fTraceInfo, &getData(), res, &length);
+    const char16_t *s = res_getString(fTraceInfo, &getData(), res, &length);
     if(s == nullptr) {
         errorCode = U_RESOURCE_TYPE_MISMATCH;
     }
     return s;
 }
 
-const UChar *ResourceDataValue::getAliasString(int32_t &length, UErrorCode &errorCode) const {
+const char16_t *ResourceDataValue::getAliasString(int32_t &length, UErrorCode &errorCode) const {
     if(U_FAILURE(errorCode)) {
         return nullptr;
     }
-    const UChar *s = res_getAlias(&getData(), res, &length);
+    const char16_t *s = res_getAlias(&getData(), res, &length);
     if(s == nullptr) {
         errorCode = U_RESOURCE_TYPE_MISMATCH;
     }
@@ -658,7 +658,7 @@ int32_t ResourceDataValue::getStringArrayOrStringAsArray(UnicodeString *dest, in
         return 1;
     }
     int32_t sLength;
-    const UChar *s = res_getString(fTraceInfo, &getData(), res, &sLength);
+    const char16_t *s = res_getString(fTraceInfo, &getData(), res, &sLength);
     if(s != nullptr) {
         dest[0].setTo(true, s, sLength);
         return 1;
@@ -673,7 +673,7 @@ UnicodeString ResourceDataValue::getStringOrFirstOfArray(UErrorCode &errorCode)
         return us;
     }
     int32_t sLength;
-    const UChar *s = res_getString(fTraceInfo, &getData(), res, &sLength);
+    const char16_t *s = res_getString(fTraceInfo, &getData(), res, &sLength);
     if(s != nullptr) {
         us.setTo(true, s, sLength);
         return us;
@@ -1041,7 +1041,7 @@ enum {
 static const char *const gUnknownKey="";
 
 /* resource table key for collation binaries: "%%CollationBin" */
-static const UChar gCollationBinKey[]={
+static const char16_t gCollationBinKey[]={
     0x25, 0x25,
     0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
     0x42, 0x69, 0x6e,
@@ -1098,7 +1098,7 @@ ures_swapResource(const UDataSwapper *ds,
         count=udata_readInt32(ds, (int32_t)*p);
         /* swap length */
         ds->swapArray32(ds, p, 4, q, pErrorCode);
-        /* swap each UChar (the terminating NUL would not change) */
+        /* swap each char16_t (the terminating NUL would not change) */
         ds->swapArray16(ds, p+1, 2*count, q+1, pErrorCode);
         break;
     case URES_BINARY:
index b8a3adba63489dd3dc03d4987b8065b93eac6d67..171189051f106d09e47b240832f3f38595a8a65c 100644 (file)
@@ -482,7 +482,7 @@ U_CFUNC Resource res_findResource(const ResourceData *pResData, Resource r,
 
 U_NAMESPACE_BEGIN
 
-inline const UChar* res_getString(const ResourceTracer& traceInfo,
+inline const char16_t* res_getString(const ResourceTracer& traceInfo,
         const ResourceData *pResData, Resource res, int32_t *pLength) {
     traceInfo.trace("string");
     return res_getStringNoTrace(pResData, res, pLength);
@@ -536,8 +536,8 @@ public:
     UResourceDataEntry *getValidLocaleDataEntry() const { return validLocaleDataEntry; }
     Resource getResource() const { return res; }
     virtual UResType getType() const override;
-    virtual const UChar *getString(int32_t &length, UErrorCode &errorCode) const override;
-    virtual const UChar *getAliasString(int32_t &length, UErrorCode &errorCode) const override;
+    virtual const char16_t *getString(int32_t &length, UErrorCode &errorCode) const override;
+    virtual const char16_t *getAliasString(int32_t &length, UErrorCode &errorCode) const override;
     virtual int32_t getInt(UErrorCode &errorCode) const override;
     virtual uint32_t getUInt(UErrorCode &errorCode) const override;
     virtual const int32_t *getIntVector(int32_t &length, UErrorCode &errorCode) const override;
index 7f15d84890a21fc0327aac1341dc01dd5c74cd37..cd5a4e5b8dbe87cf3c2249482f53a6b2dc51dd46 100644 (file)
@@ -41,7 +41,7 @@ struct ParenStackEntry
 struct UScriptRun
 {
     int32_t textLength;
-    const UChar *textArray;
+    const char16_t *textArray;
 
     int32_t scriptStart;
     int32_t scriptLimit;
@@ -189,7 +189,7 @@ sameScript(UScriptCode scriptOne, UScriptCode scriptTwo)
 }
 
 U_CAPI UScriptRun * U_EXPORT2
-uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode)
+uscript_openRun(const char16_t *src, int32_t length, UErrorCode *pErrorCode)
 {
     UScriptRun *result = nullptr;
 
@@ -237,7 +237,7 @@ uscript_resetRun(UScriptRun *scriptRun)
 }
 
 U_CAPI void U_EXPORT2
-uscript_setRunText(UScriptRun *scriptRun, const UChar *src, int32_t length, UErrorCode *pErrorCode)
+uscript_setRunText(UScriptRun *scriptRun, const char16_t *src, int32_t length, UErrorCode *pErrorCode)
 {
     if (pErrorCode == nullptr || U_FAILURE(*pErrorCode)) {
         return;
@@ -268,8 +268,8 @@ uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, U
     scriptRun->scriptCode = USCRIPT_COMMON;
 
     for (scriptRun->scriptStart = scriptRun->scriptLimit; scriptRun->scriptLimit < scriptRun->textLength; scriptRun->scriptLimit += 1) {
-        UChar   high = scriptRun->textArray[scriptRun->scriptLimit];
-        UChar32 ch   = high;
+        char16_t high = scriptRun->textArray[scriptRun->scriptLimit];
+        UChar32  ch   = high;
         UScriptCode sc;
         int32_t pairIndex;
 
@@ -278,7 +278,7 @@ uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, U
          * in the text, see if it's followed by a low surrogate
          */
         if (high >= 0xD800 && high <= 0xDBFF && scriptRun->scriptLimit < scriptRun->textLength - 1) {
-            UChar low = scriptRun->textArray[scriptRun->scriptLimit + 1];
+            char16_t low = scriptRun->textArray[scriptRun->scriptLimit + 1];
 
             /*
              * if it is followed by a low surrogate,
index d4ff95b21890470239f3a56f1a871571475492c6..b26164408a42a4a0e0a7c09376cdfce8ab705673 100644 (file)
@@ -258,7 +258,7 @@ int32_t getScriptProps(UScriptCode script) {
 }  // namespace
 
 U_CAPI int32_t U_EXPORT2
-uscript_getSampleString(UScriptCode script, UChar *dest, int32_t capacity, UErrorCode *pErrorCode) {
+uscript_getSampleString(UScriptCode script, char16_t *dest, int32_t capacity, UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) { return 0; }
     if(capacity < 0 || (capacity > 0 && dest == nullptr)) {
         *pErrorCode = U_ILLEGAL_ARGUMENT_ERROR;
index f90a391b8ac3482799955541666e6eda077b7582..b2d0b91d4b6a46df0ab4f8d87245fa1cdc125b7e 100644 (file)
@@ -87,14 +87,14 @@ uset_addRange(USet* set, UChar32 start, UChar32 end) {
 }
 
 U_CAPI void U_EXPORT2
-uset_addString(USet* set, const UChar* str, int32_t strLen) {
+uset_addString(USet* set, const char16_t* str, int32_t strLen) {
     // UnicodeString handles -1 for strLen
     UnicodeString s(strLen<0, str, strLen);
     ((UnicodeSet*) set)->UnicodeSet::add(s);
 }
 
 U_CAPI void U_EXPORT2
-uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen) {
+uset_addAllCodePoints(USet* set, const char16_t *str, int32_t strLen) {
     // UnicodeString handles -1 for strLen
     UnicodeString s(str, strLen);
     ((UnicodeSet*) set)->UnicodeSet::addAll(s);
@@ -111,13 +111,13 @@ uset_removeRange(USet* set, UChar32 start, UChar32 end) {
 }
 
 U_CAPI void U_EXPORT2
-uset_removeString(USet* set, const UChar* str, int32_t strLen) {
+uset_removeString(USet* set, const char16_t* str, int32_t strLen) {
     UnicodeString s(strLen==-1, str, strLen);
     ((UnicodeSet*) set)->UnicodeSet::remove(s);
 }
 
 U_CAPI void U_EXPORT2
-uset_removeAllCodePoints(USet *set, const UChar *str, int32_t length) {
+uset_removeAllCodePoints(USet *set, const char16_t *str, int32_t length) {
     UnicodeString s(length==-1, str, length);
     ((UnicodeSet*) set)->UnicodeSet::removeAll(s);
 }
@@ -133,13 +133,13 @@ uset_retain(USet* set, UChar32 start, UChar32 end) {
 }
 
 U_CAPI void U_EXPORT2
-uset_retainString(USet *set, const UChar *str, int32_t length) {
+uset_retainString(USet *set, const char16_t *str, int32_t length) {
     UnicodeString s(length==-1, str, length);
     ((UnicodeSet*) set)->UnicodeSet::retain(s);
 }
 
 U_CAPI void U_EXPORT2
-uset_retainAllCodePoints(USet *set, const UChar *str, int32_t length) {
+uset_retainAllCodePoints(USet *set, const char16_t *str, int32_t length) {
     UnicodeString s(length==-1, str, length);
     ((UnicodeSet*) set)->UnicodeSet::retainAll(s);
 }
@@ -165,13 +165,13 @@ uset_complementRange(USet *set, UChar32 start, UChar32 end) {
 }
 
 U_CAPI void U_EXPORT2
-uset_complementString(USet *set, const UChar *str, int32_t length) {
+uset_complementString(USet *set, const char16_t *str, int32_t length) {
     UnicodeString s(length==-1, str, length);
     ((UnicodeSet*) set)->UnicodeSet::complement(s);
 }
 
 U_CAPI void U_EXPORT2
-uset_complementAllCodePoints(USet *set, const UChar *str, int32_t length) {
+uset_complementAllCodePoints(USet *set, const char16_t *str, int32_t length) {
     UnicodeString s(length==-1, str, length);
     ((UnicodeSet*) set)->UnicodeSet::complementAll(s);
 }
@@ -212,7 +212,7 @@ uset_containsRange(const USet* set, UChar32 start, UChar32 end) {
 }
 
 U_CAPI UBool U_EXPORT2
-uset_containsString(const USet* set, const UChar* str, int32_t strLen) {
+uset_containsString(const USet* set, const char16_t* str, int32_t strLen) {
     UnicodeString s(strLen==-1, str, strLen);
     return ((const UnicodeSet*) set)->UnicodeSet::contains(s);
 }
@@ -223,7 +223,7 @@ uset_containsAll(const USet* set1, const USet* set2) {
 }
 
 U_CAPI UBool U_EXPORT2
-uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen) {
+uset_containsAllCodePoints(const USet* set, const char16_t *str, int32_t strLen) {
     // Create a string alias, since nothing is being added to the set.
     UnicodeString s(strLen==-1, str, strLen);
     return ((const UnicodeSet*) set)->UnicodeSet::containsAll(s);
@@ -240,12 +240,12 @@ uset_containsSome(const USet* set1, const USet* set2) {
 }
 
 U_CAPI int32_t U_EXPORT2
-uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition) {
+uset_span(const USet *set, const char16_t *s, int32_t length, USetSpanCondition spanCondition) {
     return ((UnicodeSet*) set)->UnicodeSet::span(s, length, spanCondition);
 }
 
 U_CAPI int32_t U_EXPORT2
-uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition) {
+uset_spanBack(const USet *set, const char16_t *s, int32_t length, USetSpanCondition spanCondition) {
     return ((UnicodeSet*) set)->UnicodeSet::spanBack(s, length, spanCondition);
 }
 
@@ -315,7 +315,7 @@ uset_getItemCount(const USet* uset) {
 U_CAPI int32_t U_EXPORT2
 uset_getItem(const USet* uset, int32_t itemIndex,
              UChar32* start, UChar32* end,
-             UChar* str, int32_t strCapacity,
+             char16_t* str, int32_t strCapacity,
              UErrorCode* ec) {
     if (U_FAILURE(*ec)) return 0;
     const UnicodeSet& set = *(const UnicodeSet*)uset;
index 3b00e24f6c3d01908ce669584c06f55f9cb6c408..6f6e0c550f93663decbafe2ccb4bfcc10f2c809a 100644 (file)
@@ -30,7 +30,7 @@
 U_NAMESPACE_USE
 
 U_CAPI USet* U_EXPORT2
-uset_openPattern(const UChar* pattern, int32_t patternLength,
+uset_openPattern(const char16_t* pattern, int32_t patternLength,
                  UErrorCode* ec)
 {
     UnicodeString pat(patternLength==-1, pattern, patternLength);
@@ -49,7 +49,7 @@ uset_openPattern(const UChar* pattern, int32_t patternLength,
 }
 
 U_CAPI USet* U_EXPORT2
-uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
+uset_openPatternOptions(const char16_t* pattern, int32_t patternLength,
                  uint32_t options,
                  UErrorCode* ec)
 {
@@ -71,7 +71,7 @@ uset_openPatternOptions(const UChar* pattern, int32_t patternLength,
 
 U_CAPI int32_t U_EXPORT2 
 uset_applyPattern(USet *set,
-                  const UChar *pattern, int32_t patternLength,
+                  const char16_t *pattern, int32_t patternLength,
                   uint32_t options,
                   UErrorCode *status){
 
@@ -106,8 +106,8 @@ uset_applyIntPropertyValue(USet* set,
 
 U_CAPI void U_EXPORT2
 uset_applyPropertyAlias(USet* set,
-                        const UChar *prop, int32_t propLength,
-                        const UChar *value, int32_t valueLength,
+                        const char16_t *prop, int32_t propLength,
+                        const char16_t *value, int32_t valueLength,
             UErrorCode* ec) {
 
     UnicodeString p(prop, propLength);
@@ -117,19 +117,19 @@ uset_applyPropertyAlias(USet* set,
 }
 
 U_CAPI UBool U_EXPORT2
-uset_resemblesPattern(const UChar *pattern, int32_t patternLength,
+uset_resemblesPattern(const char16_t *pattern, int32_t patternLength,
                       int32_t pos) {
 
     UnicodeString pat(pattern, patternLength);
 
     return ((pos+1) < pat.length() &&
-            pat.charAt(pos) == (UChar)91/*[*/) ||
+            pat.charAt(pos) == (char16_t)91/*[*/) ||
             UnicodeSet::resemblesPattern(pat, pos);
 }
 
 U_CAPI int32_t U_EXPORT2
 uset_toPattern(const USet* set,
-               UChar* result, int32_t resultCapacity,
+               char16_t* result, int32_t resultCapacity,
                UBool escapeUnprintable,
                UErrorCode* ec) {
     UnicodeString pat;
index 894dc983c3fb60770af24b8c980a5bea1491699a..d0ac95e0b2349683fdb460faf90572ff2e202108 100644 (file)
@@ -31,7 +31,7 @@
 /*
  * This implementation is designed for 16-bit Unicode strings.
  * The main assumption is that the Arabic characters and their
- * presentation forms each fit into a single UChar.
+ * presentation forms each fit into a single char16_t.
  * With UTF-8, they occupy 2 or 3 bytes, and more than the ASCII
  * characters.
  */
@@ -78,7 +78,7 @@
 #define DESHAPE_MODE 1
 
 struct uShapeVariables {
-     UChar tailChar;
+     char16_t tailChar;
      uint32_t uShapeLamalefBegin;
      uint32_t uShapeLamalefEnd;
      uint32_t uShapeTashkeelBegin;
@@ -122,7 +122,7 @@ static const uint8_t tashkeelMedial[] = {
     /* FE7F */ 1
 };
 
-static const UChar yehHamzaToYeh[] =
+static const char16_t yehHamzaToYeh[] =
 {
 /* isolated*/ 0xFEEF,
 /* final   */ 0xFEF0
@@ -134,7 +134,7 @@ static const uint8_t IrrelevantPos[] = {
 };
 
 
-static const UChar convertLamAlef[] =
+static const char16_t convertLamAlef[] =
 {
 /*FEF5*/    0x0622,
 /*FEF6*/    0x0622,
@@ -146,7 +146,7 @@ static const UChar convertLamAlef[] =
 /*FEFC*/    0x0627
 };
 
-static const UChar araLink[178]=
+static const char16_t araLink[178]=
 {
   1           + 32 + 256 * 0x11,/*0x0622*/
   1           + 32 + 256 * 0x13,/*0x0623*/
@@ -294,7 +294,7 @@ static const uint8_t presBLink[]=
 /*FEF*/    1,    0,    1,    2,1 + 2,    0,    1,    0,    1,    0,    1,    0,    1,    0,    0,    0
 };
 
-static const UChar convertFBto06[] =
+static const char16_t convertFBto06[] =
 {
 /***********0******1******2******3******4******5******6******7******8******9******A******B******C******D******E******F***/
 /*FB5*/   0x671, 0x671, 0x67B, 0x67B, 0x67B, 0x67B, 0x67E, 0x67E, 0x67E, 0x67E,     0,     0,     0,     0, 0x67A, 0x67A,
@@ -310,7 +310,7 @@ static const UChar convertFBto06[] =
 /*FBF*/       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,     0, 0x6CC, 0x6CC, 0x6CC, 0x6CC
 };
 
-static const UChar convertFEto06[] =
+static const char16_t convertFEto06[] =
 {
 /***********0******1******2******3******4******5******6******7******8******9******A******B******C******D******E******F***/
 /*FE7*/   0x64B, 0x64B, 0x64C, 0x64C, 0x64D, 0x64D, 0x64E, 0x64E, 0x64F, 0x64F, 0x650, 0x650, 0x651, 0x651, 0x652, 0x652,
@@ -339,11 +339,11 @@ static const uint8_t shapeTable[4][4][4]=
  * we can safely just work with code units (again, at least UTF-16).
  */
 static void
-_shapeToArabicDigitsWithContext(UChar *s, int32_t length,
-                                UChar digitBase,
+_shapeToArabicDigitsWithContext(char16_t *s, int32_t length,
+                                char16_t digitBase,
                                 UBool isLogical, UBool lastStrongWasAL) {
     int32_t i;
-    UChar c;
+    char16_t c;
 
     digitBase-=0x30;
 
@@ -361,7 +361,7 @@ _shapeToArabicDigitsWithContext(UChar *s, int32_t length,
                 break;
             case U_EUROPEAN_NUMBER: /* EN */
                 if(lastStrongWasAL && (uint32_t)(c-0x30)<10) {
-                    s[i]=(UChar)(digitBase+c); /* digitBase+(c-0x30) - digitBase was modified above */
+                    s[i]=(char16_t)(digitBase+c); /* digitBase+(c-0x30) - digitBase was modified above */
                 }
                 break;
             default :
@@ -381,7 +381,7 @@ _shapeToArabicDigitsWithContext(UChar *s, int32_t length,
                 break;
             case U_EUROPEAN_NUMBER: /* EN */
                 if(lastStrongWasAL && (uint32_t)(c-0x30)<10) {
-                    s[i]=(UChar)(digitBase+c); /* digitBase+(c-0x30) - digitBase was modified above */
+                    s[i]=(char16_t)(digitBase+c); /* digitBase+(c-0x30) - digitBase was modified above */
                 }
                 break;
             default :
@@ -398,8 +398,8 @@ _shapeToArabicDigitsWithContext(UChar *s, int32_t length,
  *           U_SHAPE_TEXT_DIRECTION_LOGICAL
  */
 static void
-invertBuffer(UChar *buffer, int32_t size, uint32_t /*options*/, int32_t lowlimit, int32_t highlimit) {
-    UChar temp;
+invertBuffer(char16_t *buffer, int32_t size, uint32_t /*options*/, int32_t lowlimit, int32_t highlimit) {
+    char16_t temp;
     int32_t i=0,j=0;
     for(i=lowlimit,j=size-highlimit-1;i<j;i++,j--) {
         temp = buffer[i];
@@ -416,8 +416,8 @@ invertBuffer(UChar *buffer, int32_t size, uint32_t /*options*/, int32_t lowlimit
  *           later it'll be converted into the 0xFExx LamAlefs
  *           in the shaping function.
  */
-static inline UChar
-changeLamAlef(UChar ch) {
+static inline char16_t
+changeLamAlef(char16_t ch) {
     switch(ch) {
     case 0x0622 :
         return 0x065C;
@@ -437,8 +437,8 @@ changeLamAlef(UChar ch) {
  *           Arabic characters have four forms :
  *           Isolated, Initial, Middle and Final Form
  */
-static UChar
-getLink(UChar ch) {
+static char16_t
+getLink(char16_t ch) {
     if(ch >= 0x0622 && ch <= 0x06D3) {
         return(araLink[ch-0x0622]);
     } else if(ch == 0x200D) {
@@ -460,7 +460,7 @@ getLink(UChar ch) {
  *           at each end of the logical buffer
  */
 static void
-countSpaces(UChar *dest, int32_t size, uint32_t /*options*/, int32_t *spacesCountl, int32_t *spacesCountr) {
+countSpaces(char16_t *dest, int32_t size, uint32_t /*options*/, int32_t *spacesCountl, int32_t *spacesCountr) {
     int32_t i = 0;
     int32_t countl = 0,countr = 0;
     while((dest[i] == SPACE_CHAR) && (countl < size)) {
@@ -482,7 +482,7 @@ countSpaces(UChar *dest, int32_t size, uint32_t /*options*/, int32_t *spacesCoun
  *Function : Returns 1 for Tashkeel characters in 06 range else return 0
  */
 static inline int32_t
-isTashkeelChar(UChar ch) {
+isTashkeelChar(char16_t ch) {
     return (int32_t)( ch>=0x064B && ch<= 0x0652 );
 }
 
@@ -491,7 +491,7 @@ isTashkeelChar(UChar ch) {
  *Function : Returns 1 for Tashkeel characters in FE range else return 0
  */
 static inline int32_t
-isTashkeelCharFE(UChar ch) {
+isTashkeelCharFE(char16_t ch) {
     return (int32_t)( ch>=0xFE70 && ch<= 0xFE7F );
 }
 
@@ -500,7 +500,7 @@ isTashkeelCharFE(UChar ch) {
  *Function : Returns 1 for Alef characters else return 0
  */
 static inline int32_t
-isAlefChar(UChar ch) {
+isAlefChar(char16_t ch) {
     return (int32_t)( (ch==0x0622)||(ch==0x0623)||(ch==0x0625)||(ch==0x0627) );
 }
 
@@ -509,7 +509,7 @@ isAlefChar(UChar ch) {
  *Function : Returns 1 for LamAlef characters else return 0
  */
 static inline int32_t
-isLamAlefChar(UChar ch) {
+isLamAlefChar(char16_t ch) {
     return (int32_t)((ch>=0xFEF5)&&(ch<=0xFEFC) );
 }
 
@@ -519,7 +519,7 @@ isLamAlefChar(UChar ch) {
  */
 
 static inline int32_t
-isTailChar(UChar ch) {
+isTailChar(char16_t ch) {
     if(ch == OLD_TAIL_CHAR || ch == NEW_TAIL_CHAR){
             return 1;
     }else{
@@ -534,7 +534,7 @@ isTailChar(UChar ch) {
  */
 
 static inline int32_t
-isSeenTailFamilyChar(UChar ch) {
+isSeenTailFamilyChar(char16_t ch) {
     if(ch >= 0xfeb1 && ch < 0xfebf){
             return tailFamilyIsolatedFinal [ch - 0xFEB1];
     }else{
@@ -548,7 +548,7 @@ isSeenTailFamilyChar(UChar ch) {
  */
 
 static inline int32_t
-isSeenFamilyChar(UChar  ch){
+isSeenFamilyChar(char16_t  ch){
     if(ch >= 0x633 && ch <= 0x636){
         return 1;
     }else {
@@ -563,7 +563,7 @@ isSeenFamilyChar(UChar  ch){
  *           otherwise returns 0
  */
 static inline int32_t
-isAlefMaksouraChar(UChar ch) {
+isAlefMaksouraChar(char16_t ch) {
     return (int32_t)( (ch == 0xFEEF) || ( ch == 0xFEF0) || (ch == 0x0649));
 }
 
@@ -573,7 +573,7 @@ isAlefMaksouraChar(UChar ch) {
  *            final is found otherwise returns 0
  */
 static inline int32_t
-isYehHamzaChar(UChar ch) {
+isYehHamzaChar(char16_t ch) {
     if((ch==0xFE89)||(ch==0xFE8A)){
         return 1;
     }else{
@@ -589,7 +589,7 @@ isYehHamzaChar(UChar ch) {
  *           returns 0
  */
 static inline int32_t
-isTashkeelOnTatweelChar(UChar ch){
+isTashkeelOnTatweelChar(char16_t ch){
     if(ch >= 0xfe70 && ch <= 0xfe7f && ch != NEW_TAIL_CHAR && ch != 0xFE75 && ch != SHADDA_TATWEEL_CHAR)
     {
         return tashkeelMedial [ch - 0xFE70];
@@ -608,7 +608,7 @@ isTashkeelOnTatweelChar(UChar ch){
  *           returns 2 otherwise returns 0
  */
 static inline int32_t
-isIsolatedTashkeelChar(UChar ch){
+isIsolatedTashkeelChar(char16_t ch){
     if(ch >= 0xfe70 && ch <= 0xfe7f && ch != NEW_TAIL_CHAR && ch != 0xFE75){
         return (1 - tashkeelMedial [ch - 0xFE70]);
     }else if(ch >= 0xfc5e && ch <= 0xfc63){
@@ -630,7 +630,7 @@ isIsolatedTashkeelChar(UChar ch){
  */
 
 static int32_t
-calculateSize(const UChar *source, int32_t sourceLength,
+calculateSize(const char16_t *source, int32_t sourceLength,
 int32_t destSize,uint32_t options) {
     int32_t i = 0;
 
@@ -687,7 +687,7 @@ int32_t destSize,uint32_t options) {
  *
  */
 static int32_t
-handleTashkeelWithTatweel(UChar *dest, int32_t sourceLength,
+handleTashkeelWithTatweel(char16_t *dest, int32_t sourceLength,
              int32_t /*destSize*/, uint32_t /*options*/,
              UErrorCode * /*pErrorCode*/) {
                  int i;
@@ -725,14 +725,14 @@ handleTashkeelWithTatweel(UChar *dest, int32_t sourceLength,
  */
 
 static int32_t
-handleGeneratedSpaces(UChar *dest, int32_t sourceLength,
+handleGeneratedSpaces(char16_t *dest, int32_t sourceLength,
                     int32_t destSize,
                     uint32_t options,
                     UErrorCode *pErrorCode,struct uShapeVariables shapeVars ) {
 
     int32_t i = 0, j = 0;
     int32_t count = 0;
-    UChar *tempbuffer=nullptr;
+    char16_t *tempbuffer=nullptr;
 
     int lamAlefOption = 0;
     int tashkeelOption = 0;
@@ -747,7 +747,7 @@ handleGeneratedSpaces(UChar *dest, int32_t sourceLength,
         }
     }
 
-    tempbuffer = (UChar *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR);
+    tempbuffer = (char16_t *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR);
     /* Test for nullptr */
     if(tempbuffer == nullptr) {
         *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
@@ -900,12 +900,12 @@ handleGeneratedSpaces(UChar *dest, int32_t sourceLength,
  */
 
 static int32_t
-expandCompositCharAtBegin(UChar *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode) {
+expandCompositCharAtBegin(char16_t *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode) {
     int32_t      i = 0,j = 0;
     int32_t      countl = 0;
-    UChar    *tempbuffer=nullptr;
+    char16_t *tempbuffer=nullptr;
 
-    tempbuffer = (UChar *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR);
+    tempbuffer = (char16_t *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR);
 
     /* Test for nullptr */
     if(tempbuffer == nullptr) {
@@ -960,14 +960,14 @@ expandCompositCharAtBegin(UChar *dest, int32_t sourceLength, int32_t destSize,UE
  */
 
 static int32_t
-expandCompositCharAtEnd(UChar *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode) {
+expandCompositCharAtEnd(char16_t *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode) {
     int32_t      i = 0,j = 0;
 
     int32_t      countr = 0;
     int32_t  inpsize = sourceLength;
 
-    UChar    *tempbuffer=nullptr;
-    tempbuffer = (UChar *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR);
+    char16_t *tempbuffer=nullptr;
+    tempbuffer = (char16_t *)uprv_malloc((sourceLength+1)*U_SIZEOF_UCHAR);
 
     /* Test for nullptr */
     if(tempbuffer == nullptr) {
@@ -1027,12 +1027,12 @@ expandCompositCharAtEnd(UChar *dest, int32_t sourceLength, int32_t destSize,UErr
  */
 
 static int32_t
-expandCompositCharAtNear(UChar *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode,
+expandCompositCharAtNear(char16_t *dest, int32_t sourceLength, int32_t destSize,UErrorCode *pErrorCode,
                          int yehHamzaOption, int seenTailOption, int lamAlefOption, struct uShapeVariables shapeVars) {
     int32_t      i = 0;
 
 
-    UChar    lamalefChar, yehhamzaChar;
+    char16_t lamalefChar, yehhamzaChar;
 
     for(i = 0 ;i<=sourceLength-1;i++) {
             if (seenTailOption && isSeenTailFamilyChar(dest[i])) {
@@ -1080,13 +1080,13 @@ expandCompositCharAtNear(UChar *dest, int32_t sourceLength, int32_t destSize,UEr
  */
 
 static int32_t
-expandCompositChar(UChar *dest, int32_t sourceLength,
+expandCompositChar(char16_t *dest, int32_t sourceLength,
               int32_t destSize,uint32_t options,
               UErrorCode *pErrorCode, int shapingMode,struct uShapeVariables shapeVars) {
 
     int32_t      i = 0,j = 0;
 
-    UChar    *tempbuffer=nullptr;
+    char16_t *tempbuffer=nullptr;
     int yehHamzaOption = 0;
     int seenTailOption = 0;
     int lamAlefOption = 0;
@@ -1154,7 +1154,7 @@ expandCompositChar(UChar *dest, int32_t sourceLength,
     if (shapingMode == 1){
         if ( (options&U_SHAPE_LAMALEF_MASK) == U_SHAPE_LAMALEF_RESIZE){
             destSize = calculateSize(dest,sourceLength,destSize,options);
-            tempbuffer = (UChar *)uprv_malloc((destSize+1)*U_SIZEOF_UCHAR);
+            tempbuffer = (char16_t *)uprv_malloc((destSize+1)*U_SIZEOF_UCHAR);
 
             /* Test for nullptr */
             if(tempbuffer == nullptr) {
@@ -1193,7 +1193,7 @@ expandCompositChar(UChar *dest, int32_t sourceLength,
  *           arabic Unicode buffer in FExx Range
  */
 static int32_t
-shapeUnicode(UChar *dest, int32_t sourceLength,
+shapeUnicode(char16_t *dest, int32_t sourceLength,
              int32_t destSize,uint32_t options,
              UErrorCode *pErrorCode,
              int tashkeelFlag, struct uShapeVariables shapeVars) {
@@ -1204,8 +1204,8 @@ shapeUnicode(UChar *dest, int32_t sourceLength,
     unsigned int     Shape;
     int32_t          lamalef_found = 0;
     int32_t seenfamFound = 0, yehhamzaFound =0, tashkeelFound  = 0;
-    UChar            prevLink = 0, lastLink = 0, currLink, nextLink = 0;
-    UChar            wLamalef;
+    char16_t         prevLink = 0, lastLink = 0, currLink, nextLink = 0;
+    char16_t         wLamalef;
 
     /*
      * Converts the input buffer from FExx Range into 06xx Range
@@ -1215,9 +1215,9 @@ shapeUnicode(UChar *dest, int32_t sourceLength,
      */
     if ((options & U_SHAPE_PRESERVE_PRESENTATION_MASK)  == U_SHAPE_PRESERVE_PRESENTATION_NOOP) {
         for (i = 0; i < sourceLength; i++) {
-            UChar inputChar  = dest[i];
+            char16_t inputChar  = dest[i];
             if ( (inputChar >= 0xFB50) && (inputChar <= 0xFBFF)) {
-                UChar c = convertFBto06 [ (inputChar - 0xFB50) ];
+                char16_t c = convertFBto06 [ (inputChar - 0xFB50) ];
                 if (c != 0)
                     dest[i] = c;
             } else if ( (inputChar >= 0xFE70) && (inputChar <= 0xFEFC)) {
@@ -1323,12 +1323,12 @@ shapeUnicode(UChar *dest, int32_t sourceLength,
                         /* to ensure the array index is within the range */
                         U_ASSERT(dest[i] >= 0x064Bu
                             && dest[i]-0x064Bu < UPRV_LENGTHOF(IrrelevantPos));
-                        dest[i] =  0xFE70 + IrrelevantPos[(dest[i] - 0x064B)] + static_cast<UChar>(Shape);
+                        dest[i] =  0xFE70 + IrrelevantPos[(dest[i] - 0x064B)] + static_cast<char16_t>(Shape);
                     }
                 }else if ((currLink & APRESENT) > 0) {
-                    dest[i] = (UChar)(0xFB50 + (currLink >> 8) + Shape);
+                    dest[i] = (char16_t)(0xFB50 + (currLink >> 8) + Shape);
                 }else if ((currLink >> 8) > 0 && (currLink & IRRELEVANT) == 0) {
-                    dest[i] = (UChar)(0xFE70 + (currLink >> 8) + Shape);
+                    dest[i] = (char16_t)(0xFE70 + (currLink >> 8) + Shape);
                 }
             }
         }
@@ -1365,7 +1365,7 @@ shapeUnicode(UChar *dest, int32_t sourceLength,
  *           arabic Unicode buffer in 06xx Range
  */
 static int32_t
-deShapeUnicode(UChar *dest, int32_t sourceLength,
+deShapeUnicode(char16_t *dest, int32_t sourceLength,
                int32_t destSize,uint32_t options,
                UErrorCode *pErrorCode, struct uShapeVariables shapeVars) {
     int32_t i = 0;
@@ -1382,9 +1382,9 @@ deShapeUnicode(UChar *dest, int32_t sourceLength,
      */
 
     for(i = 0; i < sourceLength; i++) {
-        UChar  inputChar = dest[i];
+        char16_t  inputChar = dest[i];
         if ( (inputChar >= 0xFB50) && (inputChar <= 0xFBFF)) { /* FBxx Arabic range */
-            UChar c = convertFBto06 [ (inputChar - 0xFB50) ];
+            char16_t c = convertFBto06 [ (inputChar - 0xFB50) ];
             if (c != 0)
                 dest[i] = c;
         } else if( (yehHamzaComposeEnabled == 1) && ((inputChar == HAMZA06_CHAR) || (inputChar == HAMZAFE_CHAR))
@@ -1418,8 +1418,8 @@ deShapeUnicode(UChar *dest, int32_t sourceLength,
  */
 
 U_CAPI int32_t U_EXPORT2
-u_shapeArabic(const UChar *source, int32_t sourceLength,
-              UChar *dest, int32_t destCapacity,
+u_shapeArabic(const char16_t *source, int32_t sourceLength,
+              char16_t *dest, int32_t destCapacity,
               uint32_t options,
               UErrorCode *pErrorCode) {
 
@@ -1493,8 +1493,8 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
     }
 
     if((options&U_SHAPE_LETTERS_MASK)!=U_SHAPE_LETTERS_NOOP) {
-        UChar buffer[300];
-        UChar *tempbuffer, *tempsource = nullptr;
+        char16_t buffer[300];
+        char16_t *tempbuffer, *tempsource = nullptr;
         int32_t outputSize, spacesCountl=0, spacesCountr=0;
 
         if((options&U_SHAPE_AGGREGATE_TASHKEEL_MASK)>0) {
@@ -1507,10 +1507,10 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
             int i=logical_order?-1:sourceLength;
             int end=logical_order?sourceLength:-1;
             int aggregation_possible = 1;
-            UChar prev = 0;
-            UChar prevLink, currLink = 0;
+            char16_t prev = 0;
+            char16_t prevLink, currLink = 0;
             int newSourceLength = 0;
-            tempsource = (UChar *)uprv_malloc(2*sourceLength*U_SIZEOF_UCHAR);
+            tempsource = (char16_t *)uprv_malloc(2*sourceLength*U_SIZEOF_UCHAR);
             if(tempsource == nullptr) {
                 *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
                 return 0;
@@ -1562,7 +1562,7 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
             outputSize=UPRV_LENGTHOF(buffer);
             tempbuffer=buffer;
         } else {
-            tempbuffer = (UChar *)uprv_malloc(outputSize*U_SIZEOF_UCHAR);
+            tempbuffer = (char16_t *)uprv_malloc(outputSize*U_SIZEOF_UCHAR);
 
             /*Test for nullptr*/
             if(tempbuffer == nullptr) {
@@ -1670,7 +1670,7 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
      * "shape" the digits in-place.
      */
     if((options&U_SHAPE_DIGITS_MASK)!=U_SHAPE_DIGITS_NOOP) {
-        UChar digitBase;
+        char16_t digitBase;
         int32_t i;
 
         /* select the requested digit group */
index da1d2861e207a71b92e85373f5bb5549aa7816d5..ba448d3b6114ec6643f91a8ade4840638a9195c4 100644 (file)
@@ -431,7 +431,7 @@ usprep_close(UStringPrepProfile* profile){
 }
 
 U_CFUNC void 
-uprv_syntaxError(const UChar* rules, 
+uprv_syntaxError(const char16_t* rules,
                  int32_t pos,
                  int32_t rulesLen,
                  UParseError* parseError){
@@ -502,11 +502,11 @@ getValues(uint16_t trieWord, int16_t& value, UBool& isIndex){
     return type;
 }
 
-// TODO: change to writing to UnicodeString not UChar *
+// TODO: change to writing to UnicodeString not char16_t *
 static int32_t 
 usprep_map(  const UStringPrepProfile* profile, 
-             const UChar* src, int32_t srcLength, 
-             UChar* dest, int32_t destCapacity,
+             const char16_t* src, int32_t srcLength,
+             char16_t* dest, int32_t destCapacity,
              int32_t options,
              UParseError* parseError,
              UErrorCode* status ){
@@ -581,7 +581,7 @@ usprep_map(  const UStringPrepProfile* profile,
         //copy the code point into destination
         if(ch <= 0xFFFF){
             if(destIndex < destCapacity ){
-                dest[destIndex] = (UChar)ch;
+                dest[destIndex] = (char16_t)ch;
             }
             destIndex++;
         }else{
@@ -637,8 +637,8 @@ usprep_map(  const UStringPrepProfile* profile,
 */
 U_CAPI int32_t U_EXPORT2
 usprep_prepare(   const UStringPrepProfile* profile,
-                  const UChar* src, int32_t srcLength, 
-                  UChar* dest, int32_t destCapacity,
+                  const char16_t* src, int32_t srcLength,
+                  char16_t* dest, int32_t destCapacity,
                   int32_t options,
                   UParseError* parseError,
                   UErrorCode* status ){
@@ -662,7 +662,7 @@ usprep_prepare(   const UStringPrepProfile* profile,
     }
     // map
     UnicodeString s1;
-    UChar *b1 = s1.getBuffer(srcLength);
+    char16_t *b1 = s1.getBuffer(srcLength);
     if(b1==nullptr){
         *status = U_MEMORY_ALLOCATION_ERROR;
         return 0;
@@ -706,7 +706,7 @@ usprep_prepare(   const UStringPrepProfile* profile,
     }
 
     // Prohibit and checkBiDi in one pass
-    const UChar *b2 = s2.getBuffer();
+    const char16_t *b2 = s2.getBuffer();
     int32_t b2Len = s2.length();
     UCharDirection direction=U_CHAR_DIRECTION_COUNT, firstCharDir=U_CHAR_DIRECTION_COUNT;
     UBool leftToRight=false, rightToLeft=false;
index 3dafd8d642320f132454014c70a2a553cb3cccae..abcc12f6837a863715ef49d27e0604d47bb4b487 100644 (file)
@@ -106,7 +106,7 @@ u_flushDefaultConverter()
 }
 
 
-/* conversions between char* and UChar* ------------------------------------- */
+/* conversions between char* and char16_t* ------------------------------------- */
 
 /* maximum string length for u_uastrcpy() and u_austrcpy() implementations */
 #define MAX_STRLEN 0x0FFFFFFF
@@ -128,12 +128,12 @@ static int32_t u_astrnlen(const char *s1, int32_t n)
     return len;
 }
 
-U_CAPI UChar*  U_EXPORT2
-u_uastrncpy(UChar *ucs1,
+U_CAPI char16_t*  U_EXPORT2
+u_uastrncpy(char16_t *ucs1,
            const char *s2,
            int32_t n)
 {
-  UChar *target = ucs1;
+  char16_t *target = ucs1;
   UErrorCode err = U_ZERO_ERROR;
   UConverter *cnv = u_getDefaultConverter(&err);
   if(U_SUCCESS(err) && cnv != nullptr) {
@@ -160,8 +160,8 @@ u_uastrncpy(UChar *ucs1,
   return ucs1;
 }
 
-U_CAPI UChar*  U_EXPORT2
-u_uastrcpy(UChar *ucs1,
+U_CAPI char16_t*  U_EXPORT2
+u_uastrcpy(char16_t *ucs1,
           const char *s2 )
 {
   UErrorCode err = U_ZERO_ERROR;
@@ -186,7 +186,7 @@ u_uastrcpy(UChar *ucs1,
 /*
  returns the minimum of (the length of the null-terminated string) and n.
 */
-static int32_t u_ustrnlen(const UChar *ucs1, int32_t n)
+static int32_t u_ustrnlen(const char16_t *ucs1, int32_t n)
 {
     int32_t len = 0;
 
@@ -202,7 +202,7 @@ static int32_t u_ustrnlen(const UChar *ucs1, int32_t n)
 
 U_CAPI char*  U_EXPORT2
 u_austrncpy(char *s1,
-        const UChar *ucs2,
+        const char16_t *ucs2,
         int32_t n)
 {
   char *target = s1;
@@ -234,7 +234,7 @@ u_austrncpy(char *s1,
 
 U_CAPI char*  U_EXPORT2
 u_austrcpy(char *s1,
-         const UChar *ucs2 )
+         const char16_t *ucs2 )
 {
   UErrorCode err = U_ZERO_ERROR;
   UConverter *cnv = u_getDefaultConverter(&err);
index d6722bfaa308796e193945503e819c0ffeb67ebe..aeeffbffa5f7630aeed09cb4b86e089d9ce1bb08 100644 (file)
@@ -165,8 +165,8 @@ BreakIterator *ustrcase_getTitleBreakIterator(
 
 int32_t CaseMap::toTitle(
         const char *locale, uint32_t options, BreakIterator *iter,
-        const UChar *src, int32_t srcLength,
-        UChar *dest, int32_t destCapacity, Edits *edits,
+        const char16_t *src, int32_t srcLength,
+        char16_t *dest, int32_t destCapacity, Edits *edits,
         UErrorCode &errorCode) {
     LocalPointer<BreakIterator> ownedIter;
     iter = ustrcase_getTitleBreakIterator(nullptr, locale, options, iter, ownedIter, errorCode);
@@ -187,8 +187,8 @@ U_NAMESPACE_END
 U_NAMESPACE_USE
 
 U_CAPI int32_t U_EXPORT2
-u_strToTitle(UChar *dest, int32_t destCapacity,
-             const UChar *src, int32_t srcLength,
+u_strToTitle(char16_t *dest, int32_t destCapacity,
+             const char16_t *src, int32_t srcLength,
              UBreakIterator *titleIter,
              const char *locale,
              UErrorCode *pErrorCode) {
@@ -210,8 +210,8 @@ u_strToTitle(UChar *dest, int32_t destCapacity,
 
 U_CAPI int32_t U_EXPORT2
 ucasemap_toTitle(UCaseMap *csm,
-                 UChar *dest, int32_t destCapacity,
-                 const UChar *src, int32_t srcLength,
+                 char16_t *dest, int32_t destCapacity,
+                 const char16_t *src, int32_t srcLength,
                  UErrorCode *pErrorCode) {
     if (U_FAILURE(*pErrorCode)) {
         return 0;
index d298615d4141e36eecc345c80d2329bd4017942e..efbbbc2f18784e4b6cd5c3b9fdb703e72d68ae88 100644 (file)
@@ -33,7 +33,7 @@
 #define _BUFFER_CAPACITY_MULTIPLIER 2
 
 #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
-// TODO: We should use CharString for char buffers and UnicodeString for UChar buffers.
+// TODO: We should use CharString for char buffers and UnicodeString for char16_t buffers.
 // Then we could change this to work only with wchar_t buffers.
 static inline UBool 
 u_growAnyBufferFromStatic(void *context,
@@ -65,7 +65,7 @@ static wchar_t*
 _strToWCS(wchar_t *dest, 
            int32_t destCapacity,
            int32_t *pDestLength,
-           const UChar *src, 
+           const char16_t *src,
            int32_t srcLength,
            UErrorCode *pErrorCode){
 
@@ -79,8 +79,8 @@ _strToWCS(wchar_t *dest,
     int32_t intTargetCapacity=0;
     int count=0,retVal=0;
     
-    const UChar *pSrcLimit =nullptr;
-    const UChar *pSrc = src;
+    const char16_t *pSrcLimit =nullptr;
+    const char16_t *pSrc = src;
 
     conv = u_getDefaultConverter(pErrorCode);
     
@@ -232,7 +232,7 @@ U_CAPI wchar_t* U_EXPORT2
 u_strToWCS(wchar_t *dest, 
            int32_t destCapacity,
            int32_t *pDestLength,
-           const UChar *src, 
+           const char16_t *src,
            int32_t srcLength,
            UErrorCode *pErrorCode){
 
@@ -254,13 +254,13 @@ u_strToWCS(wchar_t *dest,
         srcLength = u_strlen(src);
     }
     if(0 < srcLength && srcLength <= destCapacity){
-        u_memcpy((UChar *)dest, src, srcLength);
+        u_memcpy((char16_t *)dest, src, srcLength);
     }
     if(pDestLength){
        *pDestLength = srcLength;
     }
 
-    u_terminateUChars((UChar *)dest,destCapacity,srcLength,pErrorCode);
+    u_terminateUChars((char16_t *)dest,destCapacity,srcLength,pErrorCode);
 
     return dest;
 
@@ -279,8 +279,8 @@ u_strToWCS(wchar_t *dest,
 
 #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
 /* helper function */
-static UChar* 
-_strFromWCS( UChar   *dest,
+static char16_t*
+_strFromWCS( char16_t   *dest,
              int32_t destCapacity, 
              int32_t *pDestLength,
              const wchar_t *src,
@@ -289,11 +289,11 @@ _strFromWCS( UChar   *dest,
 {
     int32_t retVal =0, count =0 ;
     UConverter* conv = nullptr;
-    UChar* pTarget = nullptr;
-    UChar* pTargetLimit = nullptr;
-    UChar* target = nullptr;
+    char16_t* pTarget = nullptr;
+    char16_t* pTargetLimit = nullptr;
+    char16_t* target = nullptr;
     
-    UChar uStack [_STACK_BUFFER_CAPACITY];
+    char16_t uStack [_STACK_BUFFER_CAPACITY];
 
     wchar_t wStack[_STACK_BUFFER_CAPACITY];
     wchar_t* pWStack = wStack;
@@ -482,8 +482,8 @@ cleanup:
 }
 #endif
 
-U_CAPI UChar* U_EXPORT2
-u_strFromWCS(UChar   *dest,
+U_CAPI char16_t* U_EXPORT2
+u_strFromWCS(char16_t   *dest,
              int32_t destCapacity, 
              int32_t *pDestLength,
              const wchar_t *src,
@@ -506,10 +506,10 @@ u_strFromWCS(UChar   *dest,
 #ifdef U_WCHAR_IS_UTF16
     /* wchar_t is UTF-16 just do a memcpy */
     if(srcLength == -1){
-        srcLength = u_strlen((const UChar *)src);
+        srcLength = u_strlen((const char16_t *)src);
     }
     if(0 < srcLength && srcLength <= destCapacity){
-        u_memcpy(dest, (const UChar *)src, srcLength);
+        u_memcpy(dest, (const char16_t *)src, srcLength);
     }
     if(pDestLength){
        *pDestLength = srcLength;
index 272d416fb4dcf206d35d9245c4c1bdcb420752ce..5fee8c381920adb56cdfc4ac47fb3a92a5f39c01 100644 (file)
@@ -60,8 +60,8 @@ int32_t checkOverflowAndEditsError(int32_t destIndex, int32_t destCapacity,
 
 /* Appends a full case mapping result, see UCASE_MAX_STRING_LENGTH. */
 inline int32_t
-appendResult(UChar *dest, int32_t destIndex, int32_t destCapacity,
-             int32_t result, const UChar *s,
+appendResult(char16_t *dest, int32_t destIndex, int32_t destCapacity,
+             int32_t result, const char16_t *s,
              int32_t cpLength, uint32_t options, icu::Edits *edits) {
     UChar32 c;
     int32_t length;
@@ -77,7 +77,7 @@ appendResult(UChar *dest, int32_t destIndex, int32_t destCapacity,
         }
         c=~result;
         if(destIndex<destCapacity && c<=0xffff) {  // BMP slightly-fastpath
-            dest[destIndex++]=(UChar)c;
+            dest[destIndex++]=(char16_t)c;
             return destIndex;
         }
         length=cpLength;
@@ -86,7 +86,7 @@ appendResult(UChar *dest, int32_t destIndex, int32_t destCapacity,
             c=U_SENTINEL;
             length=result;
         } else if(destIndex<destCapacity && result<=0xffff) {  // BMP slightly-fastpath
-            dest[destIndex++]=(UChar)result;
+            dest[destIndex++]=(char16_t)result;
             if(edits!=nullptr) {
                 edits->addReplace(cpLength, 1);
             }
@@ -133,7 +133,7 @@ appendResult(UChar *dest, int32_t destIndex, int32_t destCapacity,
 }
 
 inline int32_t
-appendUChar(UChar *dest, int32_t destIndex, int32_t destCapacity, UChar c) {
+appendUChar(char16_t *dest, int32_t destIndex, int32_t destCapacity, char16_t c) {
     if(destIndex<destCapacity) {
         dest[destIndex]=c;
     } else if(destIndex==INT32_MAX) {
@@ -143,8 +143,8 @@ appendUChar(UChar *dest, int32_t destIndex, int32_t destCapacity, UChar c) {
 }
 
 int32_t
-appendNonEmptyUnchanged(UChar *dest, int32_t destIndex, int32_t destCapacity,
-                        const UChar *s, int32_t length, uint32_t options, icu::Edits *edits) {
+appendNonEmptyUnchanged(char16_t *dest, int32_t destIndex, int32_t destCapacity,
+                        const char16_t *s, int32_t length, uint32_t options, icu::Edits *edits) {
     if(edits!=nullptr) {
         edits->addUnchanged(length);
     }
@@ -161,8 +161,8 @@ appendNonEmptyUnchanged(UChar *dest, int32_t destIndex, int32_t destCapacity,
 }
 
 inline int32_t
-appendUnchanged(UChar *dest, int32_t destIndex, int32_t destCapacity,
-                const UChar *s, int32_t length, uint32_t options, icu::Edits *edits) {
+appendUnchanged(char16_t *dest, int32_t destIndex, int32_t destCapacity,
+                const char16_t *s, int32_t length, uint32_t options, icu::Edits *edits) {
     if (length <= 0) {
         return destIndex;
     }
@@ -189,12 +189,12 @@ utf16_caseContextIterator(void *context, int8_t dir) {
 
     if(dir<0) {
         if(csc->start<csc->index) {
-            U16_PREV((const UChar *)csc->p, csc->start, csc->index, c);
+            U16_PREV((const char16_t *)csc->p, csc->start, csc->index, c);
             return c;
         }
     } else {
         if(csc->index<csc->limit) {
-            U16_NEXT((const UChar *)csc->p, csc->index, csc->limit, c);
+            U16_NEXT((const char16_t *)csc->p, csc->index, csc->limit, c);
             return c;
         }
     }
@@ -206,8 +206,8 @@ utf16_caseContextIterator(void *context, int8_t dir) {
  * caseLocale < 0: Case-folds [srcStart..srcLimit[.
  */
 int32_t toLower(int32_t caseLocale, uint32_t options,
-                UChar *dest, int32_t destCapacity,
-                const UChar *src, UCaseContext *csc, int32_t srcStart, int32_t srcLimit,
+                char16_t *dest, int32_t destCapacity,
+                const char16_t *src, UCaseContext *csc, int32_t srcStart, int32_t srcLimit,
                 icu::Edits *edits, UErrorCode &errorCode) {
     const int8_t *latinToLower;
     if (caseLocale == UCASE_LOC_ROOT ||
@@ -224,7 +224,7 @@ int32_t toLower(int32_t caseLocale, uint32_t options,
     int32_t srcIndex = srcStart;
     for (;;) {
         // fast path for simple cases
-        UChar lead = 0;
+        char16_t lead = 0;
         while (srcIndex < srcLimit) {
             lead = src[srcIndex];
             int32_t delta;
@@ -244,7 +244,7 @@ int32_t toLower(int32_t caseLocale, uint32_t options,
                     continue;
                 }
             }
-            lead += static_cast<UChar>(delta);
+            lead += static_cast<char16_t>(delta);
             destIndex = appendUnchanged(dest, destIndex, destCapacity,
                                         src + prev, srcIndex - 1 - prev, options, edits);
             if (destIndex >= 0) {
@@ -264,7 +264,7 @@ int32_t toLower(int32_t caseLocale, uint32_t options,
         }
         // slow path
         int32_t cpStart = srcIndex++;
-        UChar trail;
+        char16_t trail;
         UChar32 c;
         if (U16_IS_LEAD(lead) && srcIndex < srcLimit && U16_IS_TRAIL(trail = src[srcIndex])) {
             c = U16_GET_SUPPLEMENTARY(lead, trail);
@@ -272,7 +272,7 @@ int32_t toLower(int32_t caseLocale, uint32_t options,
         } else {
             c = lead;
         }
-        const UChar *s;
+        const char16_t *s;
         if (caseLocale >= 0) {
             csc->cpStart = cpStart;
             csc->cpLimit = srcIndex;
@@ -304,8 +304,8 @@ int32_t toLower(int32_t caseLocale, uint32_t options,
 }
 
 int32_t toUpper(int32_t caseLocale, uint32_t options,
-                UChar *dest, int32_t destCapacity,
-                const UChar *src, UCaseContext *csc, int32_t srcLength,
+                char16_t *dest, int32_t destCapacity,
+                const char16_t *src, UCaseContext *csc, int32_t srcLength,
                 icu::Edits *edits, UErrorCode &errorCode) {
     const int8_t *latinToUpper;
     if (caseLocale == UCASE_LOC_TURKISH) {
@@ -319,7 +319,7 @@ int32_t toUpper(int32_t caseLocale, uint32_t options,
     int32_t srcIndex = 0;
     for (;;) {
         // fast path for simple cases
-        UChar lead = 0;
+        char16_t lead = 0;
         while (srcIndex < srcLength) {
             lead = src[srcIndex];
             int32_t delta;
@@ -339,7 +339,7 @@ int32_t toUpper(int32_t caseLocale, uint32_t options,
                     continue;
                 }
             }
-            lead += static_cast<UChar>(delta);
+            lead += static_cast<char16_t>(delta);
             destIndex = appendUnchanged(dest, destIndex, destCapacity,
                                         src + prev, srcIndex - 1 - prev, options, edits);
             if (destIndex >= 0) {
@@ -360,7 +360,7 @@ int32_t toUpper(int32_t caseLocale, uint32_t options,
         // slow path
         int32_t cpStart;
         csc->cpStart = cpStart = srcIndex++;
-        UChar trail;
+        char16_t trail;
         UChar32 c;
         if (U16_IS_LEAD(lead) && srcIndex < srcLength && U16_IS_TRAIL(trail = src[srcIndex])) {
             c = U16_GET_SUPPLEMENTARY(lead, trail);
@@ -369,7 +369,7 @@ int32_t toUpper(int32_t caseLocale, uint32_t options,
             c = lead;
         }
         csc->cpLimit = srcIndex;
-        const UChar *s;
+        const char16_t *s;
         c = ucase_toFullUpper(c, utf16_caseContextIterator, csc, &s, caseLocale);
         if (c >= 0) {
             destIndex = appendUnchanged(dest, destIndex, destCapacity,
@@ -413,8 +413,8 @@ namespace {
  *
  * @return the src index after the titlecased sequence, or the start index if no Dutch IJ
  */
-int32_t maybeTitleDutchIJ(const UChar *src, UChar32 c, int32_t start, int32_t segmentLimit,
-                          UChar *dest, int32_t &destIndex, int32_t destCapacity, uint32_t options,
+int32_t maybeTitleDutchIJ(const char16_t *src, UChar32 c, int32_t start, int32_t segmentLimit,
+                          char16_t *dest, int32_t &destIndex, int32_t destCapacity, uint32_t options,
                           icu::Edits *edits) {
     U_ASSERT(start < segmentLimit);
 
@@ -427,7 +427,7 @@ int32_t maybeTitleDutchIJ(const UChar *src, UChar32 c, int32_t start, int32_t se
     int32_t unchanged2 = 0;  // after the j (0 or 1)
 
     // next character after the first letter
-    UChar c2 = src[index++];
+    char16_t c2 = src[index++];
 
     // Is the first letter an i/I with accent?
     if (c == u'I') {
@@ -492,8 +492,8 @@ int32_t maybeTitleDutchIJ(const UChar *src, UChar32 c, int32_t start, int32_t se
 
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalToTitle(int32_t caseLocale, uint32_t options, BreakIterator *iter,
-                         UChar *dest, int32_t destCapacity,
-                         const UChar *src, int32_t srcLength,
+                         char16_t *dest, int32_t destCapacity,
+                         const char16_t *src, int32_t srcLength,
                          icu::Edits *edits,
                          UErrorCode &errorCode) {
     if (!ustrcase_checkTitleAdjustmentOptions(options, errorCode)) {
@@ -562,7 +562,7 @@ ustrcase_internalToTitle(int32_t caseLocale, uint32_t options, BreakIterator *it
                 /* titlecase c which is from [titleStart..titleLimit[ */
                 csc.cpStart=titleStart;
                 csc.cpLimit=titleLimit;
-                const UChar *s;
+                const char16_t *s;
                 c=ucase_toFullTitle(c, utf16_caseContextIterator, &csc, &s, caseLocale);
                 destIndex=appendResult(dest, destIndex, destCapacity, c, s,
                                        titleLimit-titleStart, options, edits);
@@ -1079,7 +1079,7 @@ uint32_t getDiacriticData(UChar32 c) {
     }
 }
 
-UBool isFollowedByCasedLetter(const UChar *s, int32_t i, int32_t length) {
+UBool isFollowedByCasedLetter(const char16_t *s, int32_t i, int32_t length) {
     while (i < length) {
         UChar32 c;
         U16_NEXT(s, i, length, c);
@@ -1102,8 +1102,8 @@ UBool isFollowedByCasedLetter(const UChar *s, int32_t i, int32_t length) {
  * TODO: Try to re-consolidate one way or another with the non-Greek function.
  */
 int32_t toUpper(uint32_t options,
-                UChar *dest, int32_t destCapacity,
-                const UChar *src, int32_t srcLength,
+                char16_t *dest, int32_t destCapacity,
+                const char16_t *src, int32_t srcLength,
                 Edits *edits,
                 UErrorCode &errorCode) {
     int32_t destIndex=0;
@@ -1211,7 +1211,7 @@ int32_t toUpper(uint32_t options,
             }
 
             if (change) {
-                destIndex=appendUChar(dest, destIndex, destCapacity, (UChar)upper);
+                destIndex=appendUChar(dest, destIndex, destCapacity, (char16_t)upper);
                 if (destIndex >= 0 && (data & HAS_EITHER_DIALYTIKA) != 0) {
                     destIndex=appendUChar(dest, destIndex, destCapacity, 0x308);  // restore or add a dialytika
                 }
@@ -1228,7 +1228,7 @@ int32_t toUpper(uint32_t options,
                 }
             }
         } else {
-            const UChar *s;
+            const char16_t *s;
             c=ucase_toFullUpper(c, nullptr, nullptr, &s, UCASE_LOC_GREEK);
             destIndex = appendResult(dest, destIndex, destCapacity, c, s,
                                      nextIndex - i, options, edits);
@@ -1251,8 +1251,8 @@ U_NAMESPACE_END
 
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalToLower(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED
-                         UChar *dest, int32_t destCapacity,
-                         const UChar *src, int32_t srcLength,
+                         char16_t *dest, int32_t destCapacity,
+                         const char16_t *src, int32_t srcLength,
                          icu::Edits *edits,
                          UErrorCode &errorCode) {
     UCaseContext csc=UCASECONTEXT_INITIALIZER;
@@ -1268,8 +1268,8 @@ ustrcase_internalToLower(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_IT
 
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED
-                         UChar *dest, int32_t destCapacity,
-                         const UChar *src, int32_t srcLength,
+                         char16_t *dest, int32_t destCapacity,
+                         const char16_t *src, int32_t srcLength,
                          icu::Edits *edits,
                          UErrorCode &errorCode) {
     int32_t destIndex;
@@ -1291,8 +1291,8 @@ ustrcase_internalToUpper(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_IT
 
 U_CFUNC int32_t U_CALLCONV
 ustrcase_internalFold(int32_t /* caseLocale */, uint32_t options, UCASEMAP_BREAK_ITERATOR_UNUSED
-                      UChar *dest, int32_t destCapacity,
-                      const UChar *src, int32_t srcLength,
+                      char16_t *dest, int32_t destCapacity,
+                      const char16_t *src, int32_t srcLength,
                       icu::Edits *edits,
                       UErrorCode &errorCode) {
     int32_t destIndex = toLower(
@@ -1305,8 +1305,8 @@ ustrcase_internalFold(int32_t /* caseLocale */, uint32_t options, UCASEMAP_BREAK
 
 U_CFUNC int32_t
 ustrcase_map(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-             UChar *dest, int32_t destCapacity,
-             const UChar *src, int32_t srcLength,
+             char16_t *dest, int32_t destCapacity,
+             const char16_t *src, int32_t srcLength,
              UStringCaseMapper *stringCaseMapper,
              icu::Edits *edits,
              UErrorCode &errorCode) {
@@ -1349,12 +1349,12 @@ ustrcase_map(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
 
 U_CFUNC int32_t
 ustrcase_mapWithOverlap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITERATOR_PARAM
-                        UChar *dest, int32_t destCapacity,
-                        const UChar *src, int32_t srcLength,
+                        char16_t *dest, int32_t destCapacity,
+                        const char16_t *src, int32_t srcLength,
                         UStringCaseMapper *stringCaseMapper,
                         UErrorCode &errorCode) {
-    UChar buffer[300];
-    UChar *temp;
+    char16_t buffer[300];
+    char16_t *temp;
 
     int32_t destLength;
 
@@ -1387,7 +1387,7 @@ ustrcase_mapWithOverlap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITE
             temp=buffer;
         } else {
             /* allocate a buffer */
-            temp=(UChar *)uprv_malloc(destCapacity*U_SIZEOF_UCHAR);
+            temp=(char16_t *)uprv_malloc(destCapacity*U_SIZEOF_UCHAR);
             if(temp==nullptr) {
                 errorCode=U_MEMORY_ALLOCATION_ERROR;
                 return 0;
@@ -1415,8 +1415,8 @@ ustrcase_mapWithOverlap(int32_t caseLocale, uint32_t options, UCASEMAP_BREAK_ITE
 /* public API functions */
 
 U_CAPI int32_t U_EXPORT2
-u_strFoldCase(UChar *dest, int32_t destCapacity,
-              const UChar *src, int32_t srcLength,
+u_strFoldCase(char16_t *dest, int32_t destCapacity,
+              const char16_t *src, int32_t srcLength,
               uint32_t options,
               UErrorCode *pErrorCode) {
     return ustrcase_mapWithOverlap(
@@ -1430,8 +1430,8 @@ U_NAMESPACE_BEGIN
 
 int32_t CaseMap::fold(
         uint32_t options,
-        const UChar *src, int32_t srcLength,
-        UChar *dest, int32_t destCapacity, Edits *edits,
+        const char16_t *src, int32_t srcLength,
+        char16_t *dest, int32_t destCapacity, Edits *edits,
         UErrorCode &errorCode) {
     return ustrcase_map(
         UCASE_LOC_ROOT, options, UCASEMAP_BREAK_ITERATOR_NULL
@@ -1455,7 +1455,7 @@ U_NAMESPACE_END
 
 /* stack element for previous-level source/decomposition pointers */
 struct CmpEquivLevel {
-    const UChar *start, *s, *limit;
+    const char16_t *start, *s, *limit;
 };
 typedef struct CmpEquivLevel CmpEquivLevel;
 
@@ -1474,31 +1474,31 @@ typedef struct CmpEquivLevel CmpEquivLevel;
  * @return The result of comparison
  */
 static int32_t _cmpFold(
-            const UChar *s1, int32_t length1,
-            const UChar *s2, int32_t length2,
+            const char16_t *s1, int32_t length1,
+            const char16_t *s2, int32_t length2,
             uint32_t options,
             int32_t *matchLen1, int32_t *matchLen2,
             UErrorCode *pErrorCode) {
     int32_t cmpRes = 0;
 
     /* current-level start/limit - s1/s2 as current */
-    const UChar *start1, *start2, *limit1, *limit2;
+    const char16_t *start1, *start2, *limit1, *limit2;
 
     /* points to the original start address */
-    const UChar *org1, *org2;
+    const char16_t *org1, *org2;
 
     /* points to the end of match + 1 */
-    const UChar *m1, *m2;
+    const char16_t *m1, *m2;
 
     /* case folding variables */
-    const UChar *p;
+    const char16_t *p;
     int32_t length;
 
     /* stacks of previous-level start/current/limit */
     CmpEquivLevel stack1[2], stack2[2];
 
     /* case folding buffers, only use current-level start/limit */
-    UChar fold1[UCASE_MAX_STRING_LENGTH+1], fold2[UCASE_MAX_STRING_LENGTH+1];
+    char16_t fold1[UCASE_MAX_STRING_LENGTH+1], fold2[UCASE_MAX_STRING_LENGTH+1];
 
     /* track which is the current level per string */
     int32_t level1, level2;
@@ -1598,7 +1598,7 @@ static int32_t _cmpFold(
          * either variable c1, c2 is -1 only if the corresponding string is finished
          */
         if(c1==c2) {
-            const UChar *next1, *next2;
+            const char16_t *next1, *next2;
 
             if(c1<0) {
                 cmpRes=0;   /* c1==c2==-1 indicating end of strings */
@@ -1657,7 +1657,7 @@ static int32_t _cmpFold(
         /* get complete code points for c1, c2 for lookups if either is a surrogate */
         cp1=c1;
         if(U_IS_SURROGATE(c1)) {
-            UChar c;
+            char16_t c;
 
             if(U_IS_SURROGATE_LEAD(c1)) {
                 if(s1!=limit1 && U16_IS_TRAIL(c=*s1)) {
@@ -1673,7 +1673,7 @@ static int32_t _cmpFold(
 
         cp2=c2;
         if(U_IS_SURROGATE(c2)) {
-            UChar c;
+            char16_t c;
 
             if(U_IS_SURROGATE_LEAD(c2)) {
                 if(s2!=limit2 && U16_IS_TRAIL(c=*s2)) {
@@ -1837,8 +1837,8 @@ static int32_t _cmpFold(
 
 /* internal function */
 U_CFUNC int32_t
-u_strcmpFold(const UChar *s1, int32_t length1,
-             const UChar *s2, int32_t length2,
+u_strcmpFold(const char16_t *s1, int32_t length1,
+             const char16_t *s2, int32_t length2,
              uint32_t options,
              UErrorCode *pErrorCode) {
     return _cmpFold(s1, length1, s2, length2, options, nullptr, nullptr, pErrorCode);
@@ -1847,8 +1847,8 @@ u_strcmpFold(const UChar *s1, int32_t length1,
 /* public API functions */
 
 U_CAPI int32_t U_EXPORT2
-u_strCaseCompare(const UChar *s1, int32_t length1,
-                 const UChar *s2, int32_t length2,
+u_strCaseCompare(const char16_t *s1, int32_t length1,
+                 const char16_t *s2, int32_t length2,
                  uint32_t options,
                  UErrorCode *pErrorCode) {
     /* argument checking */
@@ -1865,7 +1865,7 @@ u_strCaseCompare(const UChar *s1, int32_t length1,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options) {
+u_strcasecmp(const char16_t *s1, const char16_t *s2, uint32_t options) {
     UErrorCode errorCode=U_ZERO_ERROR;
     return u_strcmpFold(s1, -1, s2, -1,
                         options|U_COMPARE_IGNORE_CASE,
@@ -1873,7 +1873,7 @@ u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options) {
 }
 
 U_CAPI int32_t U_EXPORT2
-u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options) {
+u_memcasecmp(const char16_t *s1, const char16_t *s2, int32_t length, uint32_t options) {
     UErrorCode errorCode=U_ZERO_ERROR;
     return u_strcmpFold(s1, length, s2, length,
                         options|U_COMPARE_IGNORE_CASE,
@@ -1881,7 +1881,7 @@ u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options)
 }
 
 U_CAPI int32_t U_EXPORT2
-u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options) {
+u_strncasecmp(const char16_t *s1, const char16_t *s2, int32_t n, uint32_t options) {
     UErrorCode errorCode=U_ZERO_ERROR;
     return u_strcmpFold(s1, n, s2, n,
                         options|(U_COMPARE_IGNORE_CASE|_STRNCMP_STYLE),
@@ -1890,8 +1890,8 @@ u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options) {
 
 /* internal API - detect length of shared prefix */
 U_CAPI void
-u_caseInsensitivePrefixMatch(const UChar *s1, int32_t length1,
-                             const UChar *s2, int32_t length2,
+u_caseInsensitivePrefixMatch(const char16_t *s1, int32_t length1,
+                             const char16_t *s2, int32_t length2,
                              uint32_t options,
                              int32_t *matchLen1, int32_t *matchLen2,
                              UErrorCode *pErrorCode) {
index 59e530502192a2d16b2ead7e450af8a9a0b2bfa0..176add9c5108ce1e44013a2617a6fd2e92566944 100644 (file)
@@ -42,8 +42,8 @@ ustrcase_getCaseLocale(const char *locale) {
 /* public API functions */
 
 U_CAPI int32_t U_EXPORT2
-u_strToLower(UChar *dest, int32_t destCapacity,
-             const UChar *src, int32_t srcLength,
+u_strToLower(char16_t *dest, int32_t destCapacity,
+             const char16_t *src, int32_t srcLength,
              const char *locale,
              UErrorCode *pErrorCode) {
     return ustrcase_mapWithOverlap(
@@ -54,8 +54,8 @@ u_strToLower(UChar *dest, int32_t destCapacity,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_strToUpper(UChar *dest, int32_t destCapacity,
-             const UChar *src, int32_t srcLength,
+u_strToUpper(char16_t *dest, int32_t destCapacity,
+             const char16_t *src, int32_t srcLength,
              const char *locale,
              UErrorCode *pErrorCode) {
     return ustrcase_mapWithOverlap(
@@ -69,8 +69,8 @@ U_NAMESPACE_BEGIN
 
 int32_t CaseMap::toLower(
         const char *locale, uint32_t options,
-        const UChar *src, int32_t srcLength,
-        UChar *dest, int32_t destCapacity, Edits *edits,
+        const char16_t *src, int32_t srcLength,
+        char16_t *dest, int32_t destCapacity, Edits *edits,
         UErrorCode &errorCode) {
     return ustrcase_map(
         ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL
@@ -81,8 +81,8 @@ int32_t CaseMap::toLower(
 
 int32_t CaseMap::toUpper(
         const char *locale, uint32_t options,
-        const UChar *src, int32_t srcLength,
-        UChar *dest, int32_t destCapacity, Edits *edits,
+        const char16_t *src, int32_t srcLength,
+        char16_t *dest, int32_t destCapacity, Edits *edits,
         UErrorCode &errorCode) {
     return ustrcase_map(
         ustrcase_getCaseLocale(locale), options, UCASEMAP_BREAK_ITERATOR_NULL
index 19233a9cc8d87db997c06928e0091b6aca1b7343..a60b2208f683ed042e4b93bc4aae5731453d4f7b 100644 (file)
@@ -58,7 +58,7 @@ StringEnumeration::next(int32_t *resultLength, UErrorCode &status) {
     return nullptr;
 }
 
-const UChar *
+const char16_t *
 StringEnumeration::unext(int32_t *resultLength, UErrorCode &status) {
     const UnicodeString *s=snext(status);
     if(U_SUCCESS(status) && s!=nullptr) {
@@ -107,7 +107,7 @@ StringEnumeration::setChars(const char *s, int32_t length, UErrorCode &status) {
             length=(int32_t)uprv_strlen(s);
         }
 
-        UChar *buffer=unistr.getBuffer(length+1);
+        char16_t *buffer=unistr.getBuffer(length+1);
         if(buffer!=nullptr) {
             u_charsToUChars(s, buffer, length);
             buffer[length]=0;
@@ -167,7 +167,7 @@ const char *UStringEnumeration::next(int32_t *resultLength, UErrorCode &status)
 
 const UnicodeString* UStringEnumeration::snext(UErrorCode& status) {
     int32_t length;
-    const UChar* str = uenum_unext(uenum, &length, &status);
+    const char16_t* str = uenum_unext(uenum, &length, &status);
     if (str == 0 || U_FAILURE(status)) {
         return 0;
     }
@@ -209,7 +209,7 @@ ustrenum_count(UEnumeration* en,
 /**
  * Wrapper API to make StringEnumeration look like UEnumeration.
  */
-static const UChar* U_CALLCONV
+static const char16_t* U_CALLCONV
 ustrenum_unext(UEnumeration* en,
                int32_t* resultLength,
                UErrorCode* ec)
@@ -297,7 +297,7 @@ ucharstrenum_count(UEnumeration* en,
     return ((UCharStringEnumeration*)en)->count;
 }
 
-static const UChar* U_CALLCONV
+static const char16_t* U_CALLCONV
 ucharstrenum_unext(UEnumeration* en,
                   int32_t* resultLength,
                   UErrorCode* /*ec*/) {
@@ -305,7 +305,7 @@ ucharstrenum_unext(UEnumeration* en,
     if (e->index >= e->count) {
         return nullptr;
     }
-    const UChar* result = ((const UChar**)e->uenum.context)[e->index++];
+    const char16_t* result = ((const char16_t**)e->uenum.context)[e->index++];
     if (resultLength) {
         *resultLength = (int32_t)u_strlen(result);
     }
@@ -376,7 +376,7 @@ uenum_openCharStringsEnumeration(const char* const strings[], int32_t count,
 }
 
 U_CAPI UEnumeration* U_EXPORT2
-uenum_openUCharStringsEnumeration(const UChar* const strings[], int32_t count,
+uenum_openUCharStringsEnumeration(const char16_t* const strings[], int32_t count,
                                  UErrorCode* ec) {
     UCharStringEnumeration* result = nullptr;
     if (U_SUCCESS(*ec) && count >= 0 && (count == 0 || strings != 0)) {
index 1a9b15a59febceb014c19b0b66b6912b0b4f46ac..3db9f35821d6a2b42d045ba364f04a78cd729a9e 100644 (file)
 
 
 /***
- * Fills in a UChar* string with the radix-based representation of a
+ * Fills in a char16_t* string with the radix-based representation of a
  * uint32_t number padded with zeroes to minwidth.  The result
  * will be null terminated if there is room.
  *
- * @param buffer UChar buffer to receive result
+ * @param buffer char16_t buffer to receive result
  * @param capacity capacity of buffer
  * @param i the unsigned number to be formatted
  * @param radix the radix from 2..36
  *        null
  */
 U_CAPI int32_t U_EXPORT2
-uprv_itou (UChar * buffer, int32_t capacity,
+uprv_itou (char16_t * buffer, int32_t capacity,
            uint32_t i, uint32_t radix, int32_t minwidth)
 {
     int32_t length = 0;
     int digit;
     int32_t j;
-    UChar temp;
+    char16_t temp;
 
     do{
         digit = (int)(i % radix);
-        buffer[length++]=(UChar)(digit<=9?(0x0030+digit):(0x0030+digit+7));
+        buffer[length++]=(char16_t)(digit<=9?(0x0030+digit):(0x0030+digit+7));
         i=i/radix;
     } while(i && length<capacity);
 
     while (length < minwidth){
-        buffer[length++] = (UChar) 0x0030;/*zero padding */
+        buffer[length++] = (char16_t) 0x0030;/*zero padding */
     }
     /* null terminate the buffer */
     if(length<capacity){
-        buffer[length] = (UChar) 0x0000;
+        buffer[length] = (char16_t) 0x0000;
     }
 
     /* Reverses the string */
index 249c55a5b02f9c616616d1abc69f8fc7ff60b4a6..4f7443cc886b7e3fc5256fa6e70d9dcd39ac522e 100644 (file)
@@ -29,7 +29,7 @@
 
 /* ANSI string.h - style functions ------------------------------------------ */
 
-/* U+ffff is the highest BMP code point, the highest one that fits into a 16-bit UChar */
+/* U+ffff is the highest BMP code point, the highest one that fits into a 16-bit char16_t */
 #define U_BMP_MAX 0xffff
 
 /* Forward binary string search functions ----------------------------------- */
@@ -40,7 +40,7 @@
  * The limit pointer may be nullptr, all others must be real pointers.
  */
 static inline UBool
-isMatchAtCPBoundary(const UChar *start, const UChar *match, const UChar *matchLimit, const UChar *limit) {
+isMatchAtCPBoundary(const char16_t *start, const char16_t *match, const char16_t *matchLimit, const char16_t *limit) {
     if(U16_IS_TRAIL(*match) && start!=match && U16_IS_LEAD(*(match-1))) {
         /* the leading edge of the match is in the middle of a surrogate pair */
         return false;
@@ -52,14 +52,14 @@ isMatchAtCPBoundary(const UChar *start, const UChar *match, const UChar *matchLi
     return true;
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strFindFirst(const UChar *s, int32_t length,
-               const UChar *sub, int32_t subLength) {
-    const UChar *start, *p, *q, *subLimit;
-    UChar c, cs, cq;
+U_CAPI char16_t * U_EXPORT2
+u_strFindFirst(const char16_t *s, int32_t length,
+               const char16_t *sub, int32_t subLength) {
+    const char16_t *start, *p, *q, *subLimit;
+    char16_t c, cs, cq;
 
     if(sub==nullptr || subLength<-1) {
-        return (UChar *)s;
+        return (char16_t *)s;
     }
     if(s==nullptr || length<-1) {
         return nullptr;
@@ -70,7 +70,7 @@ u_strFindFirst(const UChar *s, int32_t length,
     if(length<0 && subLength<0) {
         /* both strings are NUL-terminated */
         if((cs=*sub++)==0) {
-            return (UChar *)s;
+            return (char16_t *)s;
         }
         if(*sub==0 && !U16_IS_SURROGATE(cs)) {
             /* the substring consists of a single, non-surrogate BMP code point */
@@ -79,13 +79,13 @@ u_strFindFirst(const UChar *s, int32_t length,
 
         while((c=*s++)!=0) {
             if(c==cs) {
-                /* found first substring UChar, compare rest */
+                /* found first substring char16_t, compare rest */
                 p=s;
                 q=sub;
                 for(;;) {
                     if((cq=*q)==0) {
                         if(isMatchAtCPBoundary(start, s-1, p, nullptr)) {
-                            return (UChar *)(s-1); /* well-formed match */
+                            return (char16_t *)(s-1); /* well-formed match */
                         } else {
                             break; /* no match because surrogate pair is split */
                         }
@@ -110,7 +110,7 @@ u_strFindFirst(const UChar *s, int32_t length,
         subLength=u_strlen(sub);
     }
     if(subLength==0) {
-        return (UChar *)s;
+        return (char16_t *)s;
     }
 
     /* get sub[0] to search for it fast */
@@ -127,13 +127,13 @@ u_strFindFirst(const UChar *s, int32_t length,
         /* s is NUL-terminated */
         while((c=*s++)!=0) {
             if(c==cs) {
-                /* found first substring UChar, compare rest */
+                /* found first substring char16_t, compare rest */
                 p=s;
                 q=sub;
                 for(;;) {
                     if(q==subLimit) {
                         if(isMatchAtCPBoundary(start, s-1, p, nullptr)) {
-                            return (UChar *)(s-1); /* well-formed match */
+                            return (char16_t *)(s-1); /* well-formed match */
                         } else {
                             break; /* no match because surrogate pair is split */
                         }
@@ -150,7 +150,7 @@ u_strFindFirst(const UChar *s, int32_t length,
             }
         }
     } else {
-        const UChar *limit, *preLimit;
+        const char16_t *limit, *preLimit;
 
         /* subLength was decremented above */
         if(length<=subLength) {
@@ -165,13 +165,13 @@ u_strFindFirst(const UChar *s, int32_t length,
         while(s!=preLimit) {
             c=*s++;
             if(c==cs) {
-                /* found first substring UChar, compare rest */
+                /* found first substring char16_t, compare rest */
                 p=s;
                 q=sub;
                 for(;;) {
                     if(q==subLimit) {
                         if(isMatchAtCPBoundary(start, s-1, p, limit)) {
-                            return (UChar *)(s-1); /* well-formed match */
+                            return (char16_t *)(s-1); /* well-formed match */
                         } else {
                             break; /* no match because surrogate pair is split */
                         }
@@ -190,23 +190,23 @@ u_strFindFirst(const UChar *s, int32_t length,
     return nullptr;
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strstr(const UChar *s, const UChar *substring) {
+U_CAPI char16_t * U_EXPORT2
+u_strstr(const char16_t *s, const char16_t *substring) {
     return u_strFindFirst(s, -1, substring, -1);
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strchr(const UChar *s, UChar c) {
+U_CAPI char16_t * U_EXPORT2
+u_strchr(const char16_t *s, char16_t c) {
     if(U16_IS_SURROGATE(c)) {
         /* make sure to not find half of a surrogate pair */
         return u_strFindFirst(s, -1, &c, 1);
     } else {
-        UChar cs;
+        char16_t cs;
 
         /* trivial search for a BMP code point */
         for(;;) {
             if((cs=*s)==c) {
-                return (UChar *)s;
+                return (char16_t *)s;
             }
             if(cs==0) {
                 return nullptr;
@@ -216,18 +216,18 @@ u_strchr(const UChar *s, UChar c) {
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strchr32(const UChar *s, UChar32 c) {
+U_CAPI char16_t * U_EXPORT2
+u_strchr32(const char16_t *s, UChar32 c) {
     if((uint32_t)c<=U_BMP_MAX) {
         /* find BMP code point */
-        return u_strchr(s, (UChar)c);
+        return u_strchr(s, (char16_t)c);
     } else if((uint32_t)c<=UCHAR_MAX_VALUE) {
         /* find supplementary code point as surrogate pair */
-        UChar cs, lead=U16_LEAD(c), trail=U16_TRAIL(c);
+        char16_t cs, lead=U16_LEAD(c), trail=U16_TRAIL(c);
 
         while((cs=*s++)!=0) {
             if(cs==lead && *s==trail) {
-                return (UChar *)(s-1);
+                return (char16_t *)(s-1);
             }
         }
         return nullptr;
@@ -237,8 +237,8 @@ u_strchr32(const UChar *s, UChar32 c) {
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memchr(const UChar *s, UChar c, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memchr(const char16_t *s, char16_t c, int32_t count) {
     if(count<=0) {
         return nullptr; /* no string */
     } else if(U16_IS_SURROGATE(c)) {
@@ -246,32 +246,32 @@ u_memchr(const UChar *s, UChar c, int32_t count) {
         return u_strFindFirst(s, count, &c, 1);
     } else {
         /* trivial search for a BMP code point */
-        const UChar *limit=s+count;
+        const char16_t *limit=s+count;
         do {
             if(*s==c) {
-                return (UChar *)s;
+                return (char16_t *)s;
             }
         } while(++s!=limit);
         return nullptr;
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memchr32(const UChar *s, UChar32 c, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memchr32(const char16_t *s, UChar32 c, int32_t count) {
     if((uint32_t)c<=U_BMP_MAX) {
         /* find BMP code point */
-        return u_memchr(s, (UChar)c, count);
+        return u_memchr(s, (char16_t)c, count);
     } else if(count<2) {
         /* too short for a surrogate pair */
         return nullptr;
     } else if((uint32_t)c<=UCHAR_MAX_VALUE) {
         /* find supplementary code point as surrogate pair */
-        const UChar *limit=s+count-1; /* -1 so that we do not need a separate check for the trail unit */
-        UChar lead=U16_LEAD(c), trail=U16_TRAIL(c);
+        const char16_t *limit=s+count-1; /* -1 so that we do not need a separate check for the trail unit */
+        char16_t lead=U16_LEAD(c), trail=U16_TRAIL(c);
 
         do {
             if(*s==lead && *(s+1)==trail) {
-                return (UChar *)s;
+                return (char16_t *)s;
             }
         } while(++s!=limit);
         return nullptr;
@@ -283,14 +283,14 @@ u_memchr32(const UChar *s, UChar32 c, int32_t count) {
 
 /* Backward binary string search functions ---------------------------------- */
 
-U_CAPI UChar * U_EXPORT2
-u_strFindLast(const UChar *s, int32_t length,
-              const UChar *sub, int32_t subLength) {
-    const UChar *start, *limit, *p, *q, *subLimit;
-    UChar c, cs;
+U_CAPI char16_t * U_EXPORT2
+u_strFindLast(const char16_t *s, int32_t length,
+              const char16_t *sub, int32_t subLength) {
+    const char16_t *start, *limit, *p, *q, *subLimit;
+    char16_t c, cs;
 
     if(sub==nullptr || subLength<-1) {
-        return (UChar *)s;
+        return (char16_t *)s;
     }
     if(s==nullptr || length<-1) {
         return nullptr;
@@ -310,7 +310,7 @@ u_strFindLast(const UChar *s, int32_t length,
         subLength=u_strlen(sub);
     }
     if(subLength==0) {
-        return (UChar *)s;
+        return (char16_t *)s;
     }
 
     /* get sub[subLength-1] to search for it fast */
@@ -341,13 +341,13 @@ u_strFindLast(const UChar *s, int32_t length,
     while(s!=limit) {
         c=*(--limit);
         if(c==cs) {
-            /* found last substring UChar, compare rest */
+            /* found last substring char16_t, compare rest */
             p=limit;
             q=subLimit;
             for(;;) {
                 if(q==sub) {
                     if(isMatchAtCPBoundary(start, p, limit+1, start+length)) {
-                        return (UChar *)p; /* well-formed match */
+                        return (char16_t *)p; /* well-formed match */
                     } else {
                         break; /* no match because surrogate pair is split */
                     }
@@ -363,19 +363,19 @@ u_strFindLast(const UChar *s, int32_t length,
     return nullptr;
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strrstr(const UChar *s, const UChar *substring) {
+U_CAPI char16_t * U_EXPORT2
+u_strrstr(const char16_t *s, const char16_t *substring) {
     return u_strFindLast(s, -1, substring, -1);
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strrchr(const UChar *s, UChar c) {
+U_CAPI char16_t * U_EXPORT2
+u_strrchr(const char16_t *s, char16_t c) {
     if(U16_IS_SURROGATE(c)) {
         /* make sure to not find half of a surrogate pair */
         return u_strFindLast(s, -1, &c, 1);
     } else {
-        const UChar *result=nullptr;
-        UChar cs;
+        const char16_t *result=nullptr;
+        char16_t cs;
 
         /* trivial search for a BMP code point */
         for(;;) {
@@ -383,37 +383,37 @@ u_strrchr(const UChar *s, UChar c) {
                 result=s;
             }
             if(cs==0) {
-                return (UChar *)result;
+                return (char16_t *)result;
             }
             ++s;
         }
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strrchr32(const UChar *s, UChar32 c) {
+U_CAPI char16_t * U_EXPORT2
+u_strrchr32(const char16_t *s, UChar32 c) {
     if((uint32_t)c<=U_BMP_MAX) {
         /* find BMP code point */
-        return u_strrchr(s, (UChar)c);
+        return u_strrchr(s, (char16_t)c);
     } else if((uint32_t)c<=UCHAR_MAX_VALUE) {
         /* find supplementary code point as surrogate pair */
-        const UChar *result=nullptr;
-        UChar cs, lead=U16_LEAD(c), trail=U16_TRAIL(c);
+        const char16_t *result=nullptr;
+        char16_t cs, lead=U16_LEAD(c), trail=U16_TRAIL(c);
 
         while((cs=*s++)!=0) {
             if(cs==lead && *s==trail) {
                 result=s-1;
             }
         }
-        return (UChar *)result;
+        return (char16_t *)result;
     } else {
         /* not a Unicode code point, not findable */
         return nullptr;
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memrchr(const UChar *s, UChar c, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memrchr(const char16_t *s, char16_t c, int32_t count) {
     if(count<=0) {
         return nullptr; /* no string */
     } else if(U16_IS_SURROGATE(c)) {
@@ -421,32 +421,32 @@ u_memrchr(const UChar *s, UChar c, int32_t count) {
         return u_strFindLast(s, count, &c, 1);
     } else {
         /* trivial search for a BMP code point */
-        const UChar *limit=s+count;
+        const char16_t *limit=s+count;
         do {
             if(*(--limit)==c) {
-                return (UChar *)limit;
+                return (char16_t *)limit;
             }
         } while(s!=limit);
         return nullptr;
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memrchr32(const UChar *s, UChar32 c, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memrchr32(const char16_t *s, UChar32 c, int32_t count) {
     if((uint32_t)c<=U_BMP_MAX) {
         /* find BMP code point */
-        return u_memrchr(s, (UChar)c, count);
+        return u_memrchr(s, (char16_t)c, count);
     } else if(count<2) {
         /* too short for a surrogate pair */
         return nullptr;
     } else if((uint32_t)c<=UCHAR_MAX_VALUE) {
         /* find supplementary code point as surrogate pair */
-        const UChar *limit=s+count-1;
-        UChar lead=U16_LEAD(c), trail=U16_TRAIL(c);
+        const char16_t *limit=s+count-1;
+        char16_t lead=U16_LEAD(c), trail=U16_TRAIL(c);
 
         do {
             if(*limit==trail && *(limit-1)==lead) {
-                return (UChar *)(limit-1);
+                return (char16_t *)(limit-1);
             }
         } while(s!=--limit);
         return nullptr;
@@ -465,10 +465,10 @@ u_memrchr32(const UChar *s, UChar32 c, int32_t count) {
  * Return -(string length)-1 if there is no such code point.
  */
 static int32_t
-_matchFromSet(const UChar *string, const UChar *matchSet, UBool polarity) {
+_matchFromSet(const char16_t *string, const char16_t *matchSet, UBool polarity) {
     int32_t matchLen, matchBMPLen, strItr, matchItr;
     UChar32 stringCh, matchCh;
-    UChar c, c2;
+    char16_t c, c2;
 
     /* first part of matchSet contains only BMP code points */
     matchBMPLen = 0;
@@ -537,12 +537,12 @@ endloop:
 }
 
 /* Search for a codepoint in a string that matches one of the matchSet codepoints. */
-U_CAPI UChar * U_EXPORT2
-u_strpbrk(const UChar *string, const UChar *matchSet)
+U_CAPI char16_t * U_EXPORT2
+u_strpbrk(const char16_t *string, const char16_t *matchSet)
 {
     int32_t idx = _matchFromSet(string, matchSet, true);
     if(idx >= 0) {
-        return (UChar *)string + idx;
+        return (char16_t *)string + idx;
     } else {
         return nullptr;
     }
@@ -550,7 +550,7 @@ u_strpbrk(const UChar *string, const UChar *matchSet)
 
 /* Search for a codepoint in a string that matches one of the matchSet codepoints. */
 U_CAPI int32_t U_EXPORT2
-u_strcspn(const UChar *string, const UChar *matchSet)
+u_strcspn(const char16_t *string, const char16_t *matchSet)
 {
     int32_t idx = _matchFromSet(string, matchSet, true);
     if(idx >= 0) {
@@ -562,7 +562,7 @@ u_strcspn(const UChar *string, const UChar *matchSet)
 
 /* Search for a codepoint in a string that does not match one of the matchSet codepoints. */
 U_CAPI int32_t U_EXPORT2
-u_strspn(const UChar *string, const UChar *matchSet)
+u_strspn(const char16_t *string, const char16_t *matchSet)
 {
     int32_t idx = _matchFromSet(string, matchSet, false);
     if(idx >= 0) {
@@ -574,13 +574,13 @@ u_strspn(const UChar *string, const UChar *matchSet)
 
 /* ----- Text manipulation functions --- */
 
-U_CAPI UChar* U_EXPORT2
-u_strtok_r(UChar    *src, 
-     const UChar    *delim,
-           UChar   **saveState)
+U_CAPI char16_t* U_EXPORT2
+u_strtok_r(char16_t *src,
+     const char16_t *delim,
+           char16_t   **saveState)
 {
-    UChar *tokSource;
-    UChar *nextToken;
+    char16_t *tokSource;
+    char16_t *nextToken;
     uint32_t nonDelimIdx;
 
     /* If saveState is nullptr, the user messed up. */
@@ -624,11 +624,11 @@ u_strtok_r(UChar    *src,
 
 /* Miscellaneous functions -------------------------------------------------- */
 
-U_CAPI UChar* U_EXPORT2
-u_strcat(UChar     *dst, 
-    const UChar     *src)
+U_CAPI char16_t* U_EXPORT2
+u_strcat(char16_t  *dst,
+    const char16_t  *src)
 {
-    UChar *anchor = dst;            /* save a pointer to start of dst */
+    char16_t *anchor = dst;            /* save a pointer to start of dst */
 
     while(*dst != 0) {              /* To end of first string          */
         ++dst;
@@ -639,13 +639,13 @@ u_strcat(UChar     *dst,
     return anchor;
 }
 
-U_CAPI UChar*  U_EXPORT2
-u_strncat(UChar     *dst, 
-     const UChar     *src, 
+U_CAPI char16_t*  U_EXPORT2
+u_strncat(char16_t  *dst,
+     const char16_t  *src,
      int32_t     n ) 
 {
     if(n > 0) {
-        UChar *anchor = dst;            /* save a pointer to start of dst */
+        char16_t *anchor = dst;            /* save a pointer to start of dst */
 
         while(*dst != 0) {              /* To end of first string          */
             ++dst;
@@ -668,10 +668,10 @@ u_strncat(UChar     *dst,
 /* ----- Text property functions --- */
 
 U_CAPI int32_t   U_EXPORT2
-u_strcmp(const UChar *s1, 
-    const UChar *s2) 
+u_strcmp(const char16_t *s1,
+    const char16_t *s2)
 {
-    UChar  c1, c2;
+    char16_t  c1, c2;
 
     for(;;) {
         c1=*s1++;
@@ -684,11 +684,11 @@ u_strcmp(const UChar *s1,
 }
 
 U_CFUNC int32_t U_EXPORT2
-uprv_strCompare(const UChar *s1, int32_t length1,
-                const UChar *s2, int32_t length2,
+uprv_strCompare(const char16_t *s1, int32_t length1,
+                const char16_t *s2, int32_t length2,
                 UBool strncmpStyle, UBool codePointOrder) {
-    const UChar *start1, *start2, *limit1, *limit2;
-    UChar c1, c2;
+    const char16_t *start1, *start2, *limit1, *limit2;
+    char16_t c1, c2;
 
     /* setup for fix-up */
     start1=s1;
@@ -922,8 +922,8 @@ void fragment {
 #endif
 
 U_CAPI int32_t U_EXPORT2
-u_strCompare(const UChar *s1, int32_t length1,
-             const UChar *s2, int32_t length2,
+u_strCompare(const char16_t *s1, int32_t length1,
+             const char16_t *s2, int32_t length2,
              UBool codePointOrder) {
     /* argument checking */
     if(s1==nullptr || length1<-1 || s2==nullptr || length2<-1) {
@@ -934,13 +934,13 @@ u_strCompare(const UChar *s1, int32_t length1,
 
 /* String compare in code point order - u_strcmp() compares in code unit order. */
 U_CAPI int32_t U_EXPORT2
-u_strcmpCodePointOrder(const UChar *s1, const UChar *s2) {
+u_strcmpCodePointOrder(const char16_t *s1, const char16_t *s2) {
     return uprv_strCompare(s1, -1, s2, -1, false, true);
 }
 
 U_CAPI int32_t   U_EXPORT2
-u_strncmp(const UChar     *s1, 
-     const UChar     *s2, 
+u_strncmp(const char16_t  *s1,
+     const char16_t  *s2,
      int32_t     n) 
 {
     if(n > 0) {
@@ -959,15 +959,15 @@ u_strncmp(const UChar     *s1,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n) {
+u_strncmpCodePointOrder(const char16_t *s1, const char16_t *s2, int32_t n) {
     return uprv_strCompare(s1, n, s2, n, true, true);
 }
 
-U_CAPI UChar* U_EXPORT2
-u_strcpy(UChar     *dst, 
-    const UChar     *src) 
+U_CAPI char16_t* U_EXPORT2
+u_strcpy(char16_t  *dst,
+    const char16_t  *src)
 {
-    UChar *anchor = dst;            /* save a pointer to start of dst */
+    char16_t *anchor = dst;            /* save a pointer to start of dst */
 
     while((*(dst++) = *(src++)) != 0) {     /* copy string 2 over              */
     }
@@ -975,12 +975,12 @@ u_strcpy(UChar     *dst,
     return anchor;
 }
 
-U_CAPI UChar*  U_EXPORT2
-u_strncpy(UChar     *dst, 
-     const UChar     *src, 
+U_CAPI char16_t*  U_EXPORT2
+u_strncpy(char16_t  *dst,
+     const char16_t  *src,
      int32_t     n) 
 {
-    UChar *anchor = dst;            /* save a pointer to start of dst */
+    char16_t *anchor = dst;            /* save a pointer to start of dst */
 
     /* copy string 2 over */
     while(n > 0 && (*(dst++) = *(src++)) != 0) {
@@ -991,12 +991,12 @@ u_strncpy(UChar     *dst,
 }
 
 U_CAPI int32_t   U_EXPORT2
-u_strlen(const UChar *s) 
+u_strlen(const char16_t *s)
 {
 #if U_SIZEOF_WCHAR_T == U_SIZEOF_UCHAR
     return (int32_t)uprv_wcslen((const wchar_t *)s);
 #else
-    const UChar *t = s;
+    const char16_t *t = s;
     while(*t != 0) {
       ++t;
     }
@@ -1005,7 +1005,7 @@ u_strlen(const UChar *s)
 }
 
 U_CAPI int32_t U_EXPORT2
-u_countChar32(const UChar *s, int32_t length) {
+u_countChar32(const char16_t *s, int32_t length) {
     int32_t count;
 
     if(s==nullptr || length<-1) {
@@ -1025,7 +1025,7 @@ u_countChar32(const UChar *s, int32_t length) {
             }
         }
     } else /* length==-1 */ {
-        UChar c;
+        char16_t c;
 
         for(;;) {
             if((c=*s++)==0) {
@@ -1046,7 +1046,7 @@ u_countChar32(const UChar *s, int32_t length) {
 }
 
 U_CAPI UBool U_EXPORT2
-u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number) {
+u_strHasMoreChar32Than(const char16_t *s, int32_t length, int32_t number) {
 
     if(number<0) {
         return true;
@@ -1057,7 +1057,7 @@ u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number) {
 
     if(length==-1) {
         /* s is NUL-terminated */
-        UChar c;
+        char16_t c;
 
         /* count code points until they exceed */
         for(;;) {
@@ -1074,7 +1074,7 @@ u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number) {
         }
     } else {
         /* length>=0 known */
-        const UChar *limit;
+        const char16_t *limit;
         int32_t maxSupplementary;
 
         /* s contains at least (length+1)/2 code points: <=2 UChars per cp */
@@ -1091,7 +1091,7 @@ u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number) {
 
         /*
          * count code points until they exceed and also check that there are
-         * no more than maxSupplementary supplementary code points (UChar pairs)
+         * no more than maxSupplementary supplementary code points (char16_t pairs)
          */
         limit=s+length;
         for(;;) {
@@ -1113,27 +1113,27 @@ u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number) {
     }
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memcpy(UChar *dest, const UChar *src, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memcpy(char16_t *dest, const char16_t *src, int32_t count) {
     if(count > 0) {
         uprv_memcpy(dest, src, (size_t)count*U_SIZEOF_UCHAR);
     }
     return dest;
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memmove(UChar *dest, const UChar *src, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memmove(char16_t *dest, const char16_t *src, int32_t count) {
     if(count > 0) {
         uprv_memmove(dest, src, (size_t)count*U_SIZEOF_UCHAR);
     }
     return dest;
 }
 
-U_CAPI UChar * U_EXPORT2
-u_memset(UChar *dest, UChar c, int32_t count) {
+U_CAPI char16_t * U_EXPORT2
+u_memset(char16_t *dest, char16_t c, int32_t count) {
     if(count > 0) {
-        UChar *ptr = dest;
-        UChar *limit = dest + count;
+        char16_t *ptr = dest;
+        char16_t *limit = dest + count;
 
         while (ptr < limit) {
             *(ptr++) = c;
@@ -1143,9 +1143,9 @@ u_memset(UChar *dest, UChar c, int32_t count) {
 }
 
 U_CAPI int32_t U_EXPORT2
-u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count) {
+u_memcmp(const char16_t *buf1, const char16_t *buf2, int32_t count) {
     if(count > 0) {
-        const UChar *limit = buf1 + count;
+        const char16_t *limit = buf1 + count;
         int32_t result;
 
         while (buf1 < limit) {
@@ -1161,14 +1161,14 @@ u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count) {
 }
 
 U_CAPI int32_t U_EXPORT2
-u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count) {
+u_memcmpCodePointOrder(const char16_t *s1, const char16_t *s2, int32_t count) {
     return uprv_strCompare(s1, count, s2, count, false, true);
 }
 
 /* u_unescape & support fns ------------------------------------------------- */
 
 /* This map must be in ASCENDING ORDER OF THE ESCAPE CODE */
-static const UChar UNESCAPE_MAP[] = {
+static const char16_t UNESCAPE_MAP[] = {
     /*"   0x22, 0x22 */
     /*'   0x27, 0x27 */
     /*?   0x3F, 0x3F */
@@ -1185,7 +1185,7 @@ static const UChar UNESCAPE_MAP[] = {
 enum { UNESCAPE_MAP_LENGTH = UPRV_LENGTHOF(UNESCAPE_MAP) };
 
 /* Convert one octal digit to a numeric value 0..7, or -1 on failure */
-static int32_t _digit8(UChar c) {
+static int32_t _digit8(char16_t c) {
     if (c >= u'0' && c <= u'7') {
         return c - u'0';
     }
@@ -1193,7 +1193,7 @@ static int32_t _digit8(UChar c) {
 }
 
 /* Convert one hex digit to a numeric value 0..F, or -1 on failure */
-static int32_t _digit16(UChar c) {
+static int32_t _digit16(char16_t c) {
     if (c >= u'0' && c <= u'9') {
         return c - u'0';
     }
@@ -1230,7 +1230,7 @@ u_unescapeAt(UNESCAPE_CHAR_AT charAt,
         goto err;
     }
 
-    /* Fetch first UChar after '\\' */
+    /* Fetch first char16_t after '\\' */
     c = charAt((*offset)++, context);
 
     /* Convert hexadecimal and octal escapes */
@@ -1323,7 +1323,7 @@ u_unescapeAt(UNESCAPE_CHAR_AT charAt,
     if (c == u'c' && *offset < length) {
         c = charAt((*offset)++, context);
         if (U16_IS_LEAD(c) && *offset < length) {
-            UChar c2 = charAt(*offset, context);
+            char16_t c2 = charAt(*offset, context);
             if (U16_IS_TRAIL(c2)) {
                 ++(*offset);
                 c = U16_GET_SUPPLEMENTARY(c, c2);
@@ -1336,7 +1336,7 @@ u_unescapeAt(UNESCAPE_CHAR_AT charAt,
      * the backslash to generically escape the next character.
      * Deal with surrogate pairs. */
     if (U16_IS_LEAD(c) && *offset < length) {
-        UChar c2 = charAt(*offset, context);
+        char16_t c2 = charAt(*offset, context);
         if (U16_IS_TRAIL(c2)) {
             ++(*offset);
             return U16_GET_SUPPLEMENTARY(c, c2);
@@ -1350,10 +1350,10 @@ u_unescapeAt(UNESCAPE_CHAR_AT charAt,
     return (UChar32)0xFFFFFFFF;
 }
 
-/* u_unescapeAt() callback to return a UChar from a char* */
-static UChar U_CALLCONV
+/* u_unescapeAt() callback to return a char16_t from a char* */
+static char16_t U_CALLCONV
 _charPtr_charAt(int32_t offset, void *context) {
-    UChar c16;
+    char16_t c16;
     /* It would be more efficient to access the invariant tables
      * directly but there is no API for that. */
     u_charsToUChars(((char*) context) + offset, &c16, 1);
@@ -1361,7 +1361,7 @@ _charPtr_charAt(int32_t offset, void *context) {
 }
 
 /* Append an escape-free segment of the text; used by u_unescape() */
-static void _appendUChars(UChar *dest, int32_t destCapacity,
+static void _appendUChars(char16_t *dest, int32_t destCapacity,
                           const char *src, int32_t srcLen) {
     if (destCapacity < 0) {
         destCapacity = 0;
@@ -1372,9 +1372,9 @@ static void _appendUChars(UChar *dest, int32_t destCapacity,
     u_charsToUChars(src, dest, srcLen);
 }
 
-/* Do an invariant conversion of char* -> UChar*, with escape parsing */
+/* Do an invariant conversion of char* -> char16_t*, with escape parsing */
 U_CAPI int32_t U_EXPORT2
-u_unescape(const char *src, UChar *dest, int32_t destCapacity) {
+u_unescape(const char *src, char16_t *dest, int32_t destCapacity) {
     const char *segment = src;
     int32_t i = 0;
     char c;
@@ -1457,8 +1457,8 @@ u_unescape(const char *src, UChar *dest, int32_t destCapacity) {
     } \
 } UPRV_BLOCK_MACRO_END
 
-U_CAPI UChar U_EXPORT2
-u_asciiToUpper(UChar c) {
+U_CAPI char16_t U_EXPORT2
+u_asciiToUpper(char16_t c) {
     if (u'a' <= c && c <= u'z') {
         c = c + u'A' - u'a';
     }
@@ -1466,7 +1466,7 @@ u_asciiToUpper(UChar c) {
 }
 
 U_CAPI int32_t U_EXPORT2
-u_terminateUChars(UChar *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode) {
+u_terminateUChars(char16_t *dest, int32_t destCapacity, int32_t length, UErrorCode *pErrorCode) {
     __TERMINATE_STRING(dest, destCapacity, length, pErrorCode);
     return length;
 }
@@ -1520,8 +1520,8 @@ u_terminateWChars(wchar_t *dest, int32_t destCapacity, int32_t length, UErrorCod
 
 /* Used by UnicodeString to compute its hashcode - Not public API. */
 U_CAPI int32_t U_EXPORT2
-ustr_hashUCharsN(const UChar *str, int32_t length) {
-    STRING_HASH(UChar, str, length, *p);
+ustr_hashUCharsN(const char16_t *str, int32_t length) {
+    STRING_HASH(char16_t, str, length, *p);
 }
 
 U_CAPI int32_t U_EXPORT2
index 24f2090135521a3f01c9695eaa6612f6105f9014..59944f3bdfbe09e4cc94589423c55c58600f3ab2 100644 (file)
@@ -36,8 +36,8 @@
 #include "ustr_imp.h"
 #include "uassert.h"
 
-U_CAPI UChar* U_EXPORT2 
-u_strFromUTF32WithSub(UChar *dest,
+U_CAPI char16_t* U_EXPORT2
+u_strFromUTF32WithSub(char16_t *dest,
                int32_t destCapacity,
                int32_t *pDestLength,
                const UChar32 *src,
@@ -46,8 +46,8 @@ u_strFromUTF32WithSub(UChar *dest,
                UErrorCode *pErrorCode) {
     const UChar32 *srcLimit;
     UChar32 ch;
-    UChar *destLimit;
-    UChar *pDest;
+    char16_t *destLimit;
+    char16_t *pDest;
     int32_t reqLength;
     int32_t numSubstitutions;
 
@@ -78,7 +78,7 @@ u_strFromUTF32WithSub(UChar *dest,
               ((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff))) {
             ++src;
             if(pDest < destLimit) {
-                *pDest++ = (UChar)ch;
+                *pDest++ = (char16_t)ch;
             } else {
                 ++reqLength;
             }
@@ -99,7 +99,7 @@ u_strFromUTF32WithSub(UChar *dest,
             /* usually "loops" once; twice only for writing subchar */
             if((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff)) {
                 if(pDest < destLimit) {
-                    *pDest++ = (UChar)ch;
+                    *pDest++ = (char16_t)ch;
                 } else {
                     ++reqLength;
                 }
@@ -136,8 +136,8 @@ u_strFromUTF32WithSub(UChar *dest,
     return dest;
 }
 
-U_CAPI UChar* U_EXPORT2 
-u_strFromUTF32(UChar *dest,
+U_CAPI char16_t* U_EXPORT2
+u_strFromUTF32(char16_t *dest,
                int32_t destCapacity, 
                int32_t *pDestLength,
                const UChar32 *src,
@@ -154,13 +154,13 @@ U_CAPI UChar32* U_EXPORT2
 u_strToUTF32WithSub(UChar32 *dest,
              int32_t destCapacity,
              int32_t *pDestLength,
-             const UChar *src,
+             const char16_t *src,
              int32_t srcLength,
              UChar32 subchar, int32_t *pNumSubstitutions,
              UErrorCode *pErrorCode) {
-    const UChar *srcLimit;
+    const char16_t *srcLimit;
     UChar32 ch;
-    UChar ch2;
+    char16_t ch2;
     UChar32 *destLimit;
     UChar32 *pDest;
     int32_t reqLength;
@@ -246,7 +246,7 @@ U_CAPI UChar32* U_EXPORT2
 u_strToUTF32(UChar32 *dest, 
              int32_t destCapacity,
              int32_t *pDestLength,
-             const UChar *src, 
+             const char16_t *src,
              int32_t srcLength,
              UErrorCode *pErrorCode) {
     return u_strToUTF32WithSub(
@@ -256,8 +256,8 @@ u_strToUTF32(UChar32 *dest,
             pErrorCode);
 }
 
-U_CAPI UChar* U_EXPORT2
-u_strFromUTF8WithSub(UChar *dest,
+U_CAPI char16_t* U_EXPORT2
+u_strFromUTF8WithSub(char16_t *dest,
               int32_t destCapacity,
               int32_t *pDestLength,
               const char* src,
@@ -279,8 +279,8 @@ u_strFromUTF8WithSub(UChar *dest,
     if(pNumSubstitutions!=nullptr) {
         *pNumSubstitutions=0;
     }
-    UChar *pDest = dest;
-    UChar *pDestLimit = dest+destCapacity;
+    char16_t *pDest = dest;
+    char16_t *pDestLimit = dest+destCapacity;
     int32_t reqLength = 0;
     int32_t numSubstitutions=0;
 
@@ -309,7 +309,7 @@ u_strFromUTF8WithSub(UChar *dest,
             // modified copy of U8_NEXT()
             ++i;
             if(U8_IS_SINGLE(c)) {
-                *pDest++=(UChar)c;
+                *pDest++=(char16_t)c;
             } else {
                 uint8_t __t1, __t2;
                 if( /* handle U+0800..U+FFFF inline */
@@ -330,7 +330,7 @@ u_strFromUTF8WithSub(UChar *dest,
                         *pErrorCode = U_INVALID_CHAR_FOUND;
                         return nullptr;
                     } else if(c<=0xFFFF) {
-                        *(pDest++)=(UChar)c;
+                        *(pDest++)=(char16_t)c;
                     } else {
                         *(pDest++)=U16_LEAD(c);
                         if(pDest<pDestLimit) {
@@ -381,7 +381,7 @@ u_strFromUTF8WithSub(UChar *dest,
         for(;;) {
             /*
              * Each iteration of the inner loop progresses by at most 3 UTF-8
-             * bytes and one UChar, for most characters.
+             * bytes and one char16_t, for most characters.
              * For supplementary code points (4 & 2), which are rare,
              * there is an additional adjustment.
              */
@@ -402,7 +402,7 @@ u_strFromUTF8WithSub(UChar *dest,
                 // modified copy of U8_NEXT()
                 c = (uint8_t)src[i++];
                 if(U8_IS_SINGLE(c)) {
-                    *pDest++=(UChar)c;
+                    *pDest++=(char16_t)c;
                 } else {
                     uint8_t __t1, __t2;
                     if( /* handle U+0800..U+FFFF inline */
@@ -435,7 +435,7 @@ u_strFromUTF8WithSub(UChar *dest,
                             *pErrorCode = U_INVALID_CHAR_FOUND;
                             return nullptr;
                         } else if(c<=0xFFFF) {
-                            *(pDest++)=(UChar)c;
+                            *(pDest++)=(char16_t)c;
                         } else {
                             *(pDest++)=U16_LEAD(c);
                             *(pDest++)=U16_TRAIL(c);
@@ -449,7 +449,7 @@ u_strFromUTF8WithSub(UChar *dest,
             // modified copy of U8_NEXT()
             c = (uint8_t)src[i++];
             if(U8_IS_SINGLE(c)) {
-                *pDest++=(UChar)c;
+                *pDest++=(char16_t)c;
             } else {
                 uint8_t __t1, __t2;
                 if( /* handle U+0800..U+FFFF inline */
@@ -472,7 +472,7 @@ u_strFromUTF8WithSub(UChar *dest,
                         *pErrorCode = U_INVALID_CHAR_FOUND;
                         return nullptr;
                     } else if(c<=0xFFFF) {
-                        *(pDest++)=(UChar)c;
+                        *(pDest++)=(char16_t)c;
                     } else {
                         *(pDest++)=U16_LEAD(c);
                         if(pDest<pDestLimit) {
@@ -536,8 +536,8 @@ u_strFromUTF8WithSub(UChar *dest,
     return dest;
 }
 
-U_CAPI UChar* U_EXPORT2
-u_strFromUTF8(UChar *dest,
+U_CAPI char16_t* U_EXPORT2
+u_strFromUTF8(char16_t *dest,
               int32_t destCapacity,
               int32_t *pDestLength,
               const char* src,
@@ -550,14 +550,14 @@ u_strFromUTF8(UChar *dest,
             pErrorCode);
 }
 
-U_CAPI UChar * U_EXPORT2
-u_strFromUTF8Lenient(UChar *dest,
+U_CAPI char16_t * U_EXPORT2
+u_strFromUTF8Lenient(char16_t *dest,
                      int32_t destCapacity,
                      int32_t *pDestLength,
                      const char *src,
                      int32_t srcLength,
                      UErrorCode *pErrorCode) {
-    UChar *pDest = dest;
+    char16_t *pDest = dest;
     UChar32 ch;
     int32_t reqLength = 0;
     uint8_t* pSrc = (uint8_t*) src;
@@ -576,7 +576,7 @@ u_strFromUTF8Lenient(UChar *dest,
 
     if(srcLength < 0) {
         /* Transform a NUL-terminated string. */
-        UChar *pDestLimit = (dest!=nullptr)?(dest+destCapacity):nullptr;
+        char16_t *pDestLimit = (dest!=nullptr)?(dest+destCapacity):nullptr;
         uint8_t t1, t2, t3; /* trail bytes */
 
         while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
@@ -586,21 +586,21 @@ u_strFromUTF8Lenient(UChar *dest,
                  * a single-byte sequence for better character boundary
                  * resynchronization after illegal sequences.
                  */
-                *pDest++=(UChar)ch;
+                *pDest++=(char16_t)ch;
                 ++pSrc;
                 continue;
             } else if(ch < 0xe0) { /* U+0080..U+07FF */
                 if((t1 = pSrc[1]) != 0) {
                     /* 0x3080 = (0xc0 << 6) + 0x80 */
-                    *pDest++ = (UChar)((ch << 6) + t1 - 0x3080);
+                    *pDest++ = (char16_t)((ch << 6) + t1 - 0x3080);
                     pSrc += 2;
                     continue;
                 }
             } else if(ch < 0xf0) { /* U+0800..U+FFFF */
                 if((t1 = pSrc[1]) != 0 && (t2 = pSrc[2]) != 0) {
-                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
+                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (char16_t) */
                     /* 0x2080 = (0x80 << 6) + 0x80 */
-                    *pDest++ = (UChar)((ch << 12) + (t1 << 6) + t2 - 0x2080);
+                    *pDest++ = (char16_t)((ch << 12) + (t1 << 6) + t2 - 0x2080);
                     pSrc += 3;
                     continue;
                 }
@@ -689,15 +689,15 @@ u_strFromUTF8Lenient(UChar *dest,
                      * a single-byte sequence for better character boundary
                      * resynchronization after illegal sequences.
                      */
-                    *pDest++=(UChar)ch;
+                    *pDest++=(char16_t)ch;
                 } else if(ch < 0xe0) { /* U+0080..U+07FF */
                     /* 0x3080 = (0xc0 << 6) + 0x80 */
-                    *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
+                    *pDest++ = (char16_t)((ch << 6) + *pSrc++ - 0x3080);
                 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
-                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
+                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (char16_t) */
                     /* 0x2080 = (0x80 << 6) + 0x80 */
                     ch = (ch << 12) + (*pSrc++ << 6);
-                    *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
+                    *pDest++ = (char16_t)(ch + *pSrc++ - 0x2080);
                 } else /* f0..f4 */ { /* U+10000..U+10FFFF */
                     /* 0x3c82080 = (0xf0 << 18) + (0x80 << 12) + (0x80 << 6) + 0x80 */
                     ch = (ch << 18) + (*pSrc++ << 12);
@@ -719,20 +719,20 @@ u_strFromUTF8Lenient(UChar *dest,
                  * a single-byte sequence for better character boundary
                  * resynchronization after illegal sequences.
                  */
-                *pDest++=(UChar)ch;
+                *pDest++=(char16_t)ch;
                 continue;
             } else if(ch < 0xe0) { /* U+0080..U+07FF */
                 if(pSrc < pSrcLimit) {
                     /* 0x3080 = (0xc0 << 6) + 0x80 */
-                    *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
+                    *pDest++ = (char16_t)((ch << 6) + *pSrc++ - 0x3080);
                     continue;
                 }
             } else if(ch < 0xf0) { /* U+0800..U+FFFF */
                 if((pSrcLimit - pSrc) >= 2) {
-                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
+                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (char16_t) */
                     /* 0x2080 = (0x80 << 6) + 0x80 */
                     ch = (ch << 12) + (*pSrc++ << 6);
-                    *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
+                    *pDest++ = (char16_t)(ch + *pSrc++ - 0x2080);
                     pSrc += 3;
                     continue;
                 }
@@ -793,7 +793,7 @@ U_CAPI char* U_EXPORT2
 u_strToUTF8WithSub(char *dest,
             int32_t destCapacity,
             int32_t *pDestLength,
-            const UChar *pSrc,
+            const char16_t *pSrc,
             int32_t srcLength,
             UChar32 subchar, int32_t *pNumSubstitutions,
             UErrorCode *pErrorCode){
@@ -894,14 +894,14 @@ u_strToUTF8WithSub(char *dest,
             }
         }
     } else {
-        const UChar *pSrcLimit = (pSrc!=nullptr)?(pSrc+srcLength):nullptr;
+        const char16_t *pSrcLimit = (pSrc!=nullptr)?(pSrc+srcLength):nullptr;
         int32_t count;
 
         /* Faster loop without ongoing checking for pSrcLimit and pDestLimit. */
         for(;;) {
             /*
              * Each iteration of the inner loop progresses by at most 3 UTF-8
-             * bytes and one UChar, for most characters.
+             * bytes and one char16_t, for most characters.
              * For supplementary code points (4 & 2), which are rare,
              * there is an additional adjustment.
              */
@@ -1057,7 +1057,7 @@ U_CAPI char* U_EXPORT2
 u_strToUTF8(char *dest,
             int32_t destCapacity,
             int32_t *pDestLength,
-            const UChar *pSrc,
+            const char16_t *pSrc,
             int32_t srcLength,
             UErrorCode *pErrorCode){
     return u_strToUTF8WithSub(
@@ -1067,9 +1067,9 @@ u_strToUTF8(char *dest,
             pErrorCode);
 }
 
-U_CAPI UChar* U_EXPORT2
+U_CAPI char16_t* U_EXPORT2
 u_strFromJavaModifiedUTF8WithSub(
-        UChar *dest,
+        char16_t *dest,
         int32_t destCapacity,
         int32_t *pDestLength,
         const char *src,
@@ -1091,8 +1091,8 @@ u_strFromJavaModifiedUTF8WithSub(
     if(pNumSubstitutions!=nullptr) {
         *pNumSubstitutions=0;
     }
-    UChar *pDest = dest;
-    UChar *pDestLimit = dest+destCapacity;
+    char16_t *pDest = dest;
+    char16_t *pDestLimit = dest+destCapacity;
     int32_t reqLength = 0;
     int32_t numSubstitutions=0;
 
@@ -1103,7 +1103,7 @@ u_strFromJavaModifiedUTF8WithSub(
          */
         UChar32 c;
         while(((c = (uint8_t)*src) != 0) && c <= 0x7f && (pDest < pDestLimit)) {
-            *pDest++=(UChar)c;
+            *pDest++=(char16_t)c;
             ++src;
         }
         if(c == 0) {
@@ -1140,7 +1140,7 @@ u_strFromJavaModifiedUTF8WithSub(
         }
         /*
          * Each iteration of the inner loop progresses by at most 3 UTF-8
-         * bytes and one UChar.
+         * bytes and one char16_t.
          */
         if(subchar > 0xFFFF) {
             break;
@@ -1159,7 +1159,7 @@ u_strFromJavaModifiedUTF8WithSub(
         do {
             ch = (uint8_t)src[i++];
             if(U8_IS_SINGLE(ch)) {
-                *pDest++=(UChar)ch;
+                *pDest++=(char16_t)ch;
             } else {
                 if(ch >= 0xe0) {
                     if( /* handle U+0000..U+FFFF inline */
@@ -1167,8 +1167,8 @@ u_strFromJavaModifiedUTF8WithSub(
                         (t1 = (uint8_t)(src[i] - 0x80)) <= 0x3f &&
                         (t2 = (uint8_t)(src[i+1] - 0x80)) <= 0x3f
                     ) {
-                        /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
-                        *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
+                        /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (char16_t) */
+                        *pDest++ = (char16_t)((ch << 12) | (t1 << 6) | t2);
                         i += 2;
                         continue;
                     }
@@ -1177,7 +1177,7 @@ u_strFromJavaModifiedUTF8WithSub(
                         ch >= 0xc0 &&
                         (t1 = (uint8_t)(src[i] - 0x80)) <= 0x3f
                     ) {
-                        *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
+                        *pDest++ = (char16_t)(((ch & 0x1f) << 6) | t1);
                         ++i;
                         continue;
                     }
@@ -1197,7 +1197,7 @@ u_strFromJavaModifiedUTF8WithSub(
                     /* function call for error cases */
                     utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1);
                     ++numSubstitutions;
-                    *(pDest++)=(UChar)subchar;
+                    *(pDest++)=(char16_t)subchar;
                 }
             }
         } while(--count > 0);
@@ -1206,7 +1206,7 @@ u_strFromJavaModifiedUTF8WithSub(
     while(i < srcLength && (pDest < pDestLimit)) {
         ch = (uint8_t)src[i++];
         if(U8_IS_SINGLE(ch)){
-            *pDest++=(UChar)ch;
+            *pDest++=(char16_t)ch;
         } else {
             if(ch >= 0xe0) {
                 if( /* handle U+0000..U+FFFF inline */
@@ -1215,8 +1215,8 @@ u_strFromJavaModifiedUTF8WithSub(
                     (t1 = (uint8_t)(src[i] - 0x80)) <= 0x3f &&
                     (t2 = (uint8_t)(src[i+1] - 0x80)) <= 0x3f
                 ) {
-                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
-                    *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
+                    /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (char16_t) */
+                    *pDest++ = (char16_t)((ch << 12) | (t1 << 6) | t2);
                     i += 2;
                     continue;
                 }
@@ -1226,7 +1226,7 @@ u_strFromJavaModifiedUTF8WithSub(
                     i < srcLength &&
                     (t1 = (uint8_t)(src[i] - 0x80)) <= 0x3f
                 ) {
-                    *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
+                    *pDest++ = (char16_t)(((ch & 0x1f) << 6) | t1);
                     ++i;
                     continue;
                 }
@@ -1240,7 +1240,7 @@ u_strFromJavaModifiedUTF8WithSub(
                 utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1);
                 ++numSubstitutions;
                 if(subchar<=0xFFFF) {
-                    *(pDest++)=(UChar)subchar;
+                    *(pDest++)=(char16_t)subchar;
                 } else {
                     *(pDest++)=U16_LEAD(subchar);
                     if(pDest<pDestLimit) {
@@ -1314,14 +1314,14 @@ u_strToJavaModifiedUTF8(
         char *dest,
         int32_t destCapacity,
         int32_t *pDestLength,
-        const UChar *src, 
+        const char16_t *src,
         int32_t srcLength,
         UErrorCode *pErrorCode) {
     int32_t reqLength=0;
     uint32_t ch=0;
     uint8_t *pDest = (uint8_t *)dest;
     uint8_t *pDestLimit = pDest + destCapacity;
-    const UChar *pSrcLimit;
+    const char16_t *pSrcLimit;
     int32_t count;
 
     /* args check */
@@ -1361,7 +1361,7 @@ u_strToJavaModifiedUTF8(
         srcLength = (int32_t)(pSrcLimit - src);
         if(count >= srcLength && srcLength > 0 && *src <= 0x7f) {
             /* fast ASCII loop */
-            const UChar *prevSrc = src;
+            const char16_t *prevSrc = src;
             int32_t delta;
             while(src < pSrcLimit && (ch = *src) <= 0x7f && ch != 0) {
                 *pDest++=(uint8_t)ch;
@@ -1373,7 +1373,7 @@ u_strToJavaModifiedUTF8(
         }
         /*
          * Each iteration of the inner loop progresses by at most 3 UTF-8
-         * bytes and one UChar.
+         * bytes and one char16_t.
          */
         count /= 3;
         if(count > srcLength) {
index e79b06257b9ef7a19e920b6812160e1eba59f1f2..ba59444a3bbae4994623a5426bec37b596d987aa 100644 (file)
@@ -124,13 +124,13 @@ utext_setNativeIndex(UText *ut, int64_t index) {
     // The convention is that the index must always be on a code point boundary.
     // Adjust the index position if it is in the middle of a surrogate pair.
     if (ut->chunkOffset<ut->chunkLength) {
-        UChar c= ut->chunkContents[ut->chunkOffset];
+        char16_t c= ut->chunkContents[ut->chunkOffset];
         if (U16_IS_TRAIL(c)) {
             if (ut->chunkOffset==0) {
                 ut->pFuncs->access(ut, ut->chunkNativeStart, false);
             }
             if (ut->chunkOffset>0) {
-                UChar lead = ut->chunkContents[ut->chunkOffset-1];
+                char16_t lead = ut->chunkContents[ut->chunkOffset-1];
                 if (U16_IS_LEAD(lead)) {
                     ut->chunkOffset--;
                 }
@@ -151,7 +151,7 @@ utext_getPreviousNativeIndex(UText *ut) {
     int32_t i = ut->chunkOffset - 1;
     int64_t result;
     if (i >= 0) {
-        UChar c = ut->chunkContents[i];
+        char16_t c = ut->chunkContents[i];
         if (U16_IS_TRAIL(c) == false) {
             if (i <= ut->nativeIndexingLimit) {
                 result = ut->chunkNativeStart + i;
@@ -425,7 +425,7 @@ utext_previous32From(UText *ut, int64_t index) {
 U_CAPI int32_t U_EXPORT2
 utext_extract(UText *ut,
              int64_t start, int64_t limit,
-             UChar *dest, int32_t destCapacity,
+             char16_t *dest, int32_t destCapacity,
              UErrorCode *status) {
                  return ut->pFuncs->extract(ut, start, limit, dest, destCapacity, status);
              }
@@ -485,7 +485,7 @@ utext_hasMetaData(const UText *ut)
 U_CAPI int32_t U_EXPORT2
 utext_replace(UText *ut,
              int64_t nativeStart, int64_t nativeLimit,
-             const UChar *replacementText, int32_t replacementLength,
+             const char16_t *replacementText, int32_t replacementLength,
              UErrorCode *status)
 {
     if (U_FAILURE(*status)) {
@@ -849,8 +849,8 @@ U_CDECL_END
 //------------------------------------------------------------------------------
 
 // Chunk size.
-//     Must be less than 85 (256/3), because of byte mapping from UChar indexes to native indexes.
-//     Worst case is three native bytes to one UChar.  (Supplemenaries are 4 native bytes
+//     Must be less than 85 (256/3), because of byte mapping from char16_t indexes to native indexes.
+//     Worst case is three native bytes to one char16_t.  (Supplemenaries are 4 native bytes
 //     to two UChars.)
 //     The longest illegal byte sequence treated as a single error (and converted to U+FFFD)
 //     is a three-byte sequence (truncated four-byte sequence).
@@ -859,7 +859,7 @@ enum { UTF8_TEXT_CHUNK_SIZE=32 };
 
 //
 // UTF8Buf  Two of these structs will be set up in the UText's extra allocated space.
-//          Each contains the UChar chunk buffer, the to and from native maps, and
+//          Each contains the char16_t chunk buffer, the to and from native maps, and
 //          header info.
 //
 //     because backwards iteration fills the buffers starting at the end and
@@ -872,7 +872,7 @@ enum { UTF8_TEXT_CHUNK_SIZE=32 };
 //
 
 struct UTF8Buf {
-    int32_t   bufNativeStart;                        // Native index of first char in UChar buf
+    int32_t   bufNativeStart;                        // Native index of first char in char16_t buf
     int32_t   bufNativeLimit;                        // Native index following last char in buf.
     int32_t   bufStartIdx;                           // First filled position in buf.
     int32_t   bufLimitIdx;                           // Limit of filled range in buf.
@@ -882,13 +882,13 @@ struct UTF8Buf {
                                                      //   Set to bufNativeStart when filling forwards.
                                                      //   Set to computed value when filling backwards.
 
-    UChar     buf[UTF8_TEXT_CHUNK_SIZE+4];           // The UChar buffer.  Requires one extra position beyond the
+    char16_t  buf[UTF8_TEXT_CHUNK_SIZE+4];           // The char16_t buffer.  Requires one extra position beyond the
                                                      //   the chunk size, to allow for surrogate at the end.
                                                      //   Length must be identical to mapToNative array, below,
                                                      //   because of the way indexing works when the array is
                                                      //   filled backwards during a reverse iteration.  Thus,
                                                      //   the additional extra size.
-    uint8_t   mapToNative[UTF8_TEXT_CHUNK_SIZE+4];   // map UChar index in buf to
+    uint8_t   mapToNative[UTF8_TEXT_CHUNK_SIZE+4];   // map char16_t index in buf to
                                                      //  native offset from bufNativeStart.
                                                      //  Requires two extra slots,
                                                      //    one for a supplementary starting in the last normal position,
@@ -1209,7 +1209,7 @@ fillForward:
             nulTerminated = true;
         }
 
-        UChar   *buf = u8b_swap->buf;
+        char16_t   *buf = u8b_swap->buf;
         uint8_t *mapToNative  = u8b_swap->mapToNative;
         uint8_t *mapToUChars  = u8b_swap->mapToUChars;
         int32_t  destIx       = 0;
@@ -1223,7 +1223,7 @@ fillForward:
             if (c>0 && c<0x80) {
                 // Special case ASCII range for speed.
                 //   zero is excluded to simplify bounds checking.
-                buf[destIx] = (UChar)c;
+                buf[destIx] = (char16_t)c;
                 mapToNative[destIx]    = (uint8_t)(srcIx - ix);
                 mapToUChars[srcIx-ix]  = (uint8_t)destIx;
                 srcIx++;
@@ -1317,7 +1317,7 @@ fillReverse:
         ut->q = ut->p;
         ut->p = u8b_swap;
 
-        UChar   *buf = u8b_swap->buf;
+        char16_t   *buf = u8b_swap->buf;
         uint8_t *mapToNative = u8b_swap->mapToNative;
         uint8_t *mapToUChars = u8b_swap->mapToUChars;
         int32_t  toUCharsMapStart = ix - sizeof(UTF8Buf::mapToUChars) + 1;
@@ -1349,7 +1349,7 @@ fillReverse:
             c = s8[srcIx];
             if (c<0x80) {
                 // Special case ASCII range for speed.
-                buf[destIx] = (UChar)c;
+                buf[destIx] = (char16_t)c;
                 U_ASSERT(toUCharsMapStart <= srcIx);
                 mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx;
                 mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
@@ -1367,7 +1367,7 @@ fillReverse:
 
                 // Store the character in UTF-16 buffer.
                 if (c<0x10000) {
-                    buf[destIx] = (UChar)c;
+                    buf[destIx] = (char16_t)c;
                     mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
                 } else {
                     buf[destIx]         = U16_TRAIL(c);
@@ -1414,8 +1414,8 @@ fillReverse:
 //     Inserts a Replacement Char rather than failing on invalid UTF-8
 //     Removes unnecessary features.
 //
-static UChar*
-utext_strFromUTF8(UChar *dest,
+static char16_t*
+utext_strFromUTF8(char16_t *dest,
               int32_t destCapacity,
               int32_t *pDestLength,
               const char* src,
@@ -1424,8 +1424,8 @@ utext_strFromUTF8(UChar *dest,
               )
 {
 
-    UChar *pDest = dest;
-    UChar *pDestLimit = (dest!=nullptr)?(dest+destCapacity):nullptr;
+    char16_t *pDest = dest;
+    char16_t *pDestLimit = (dest!=nullptr)?(dest+destCapacity):nullptr;
     UChar32 ch=0;
     int32_t index = 0;
     int32_t reqLength = 0;
@@ -1435,11 +1435,11 @@ utext_strFromUTF8(UChar *dest,
     while((index < srcLength)&&(pDest<pDestLimit)){
         ch = pSrc[index++];
         if(ch <=0x7f){
-            *pDest++=(UChar)ch;
+            *pDest++=(char16_t)ch;
         }else{
             ch=utf8_nextCharSafeBody(pSrc, &index, srcLength, ch, -3);
             if(U_IS_BMP(ch)){
-                *(pDest++)=(UChar)ch;
+                *(pDest++)=(char16_t)ch;
             }else{
                 *(pDest++)=U16_LEAD(ch);
                 if(pDest<pDestLimit){
@@ -1479,7 +1479,7 @@ utext_strFromUTF8(UChar *dest,
 static int32_t U_CALLCONV
 utf8TextExtract(UText *ut,
                 int64_t start, int64_t limit,
-                UChar *dest, int32_t destCapacity,
+                char16_t *dest, int32_t destCapacity,
                 UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -1688,7 +1688,7 @@ struct ReplExtra {
      * Chunk UChars.
      * +1 to simplify filling with surrogate pair at the end.
      */
-    UChar s[REP_TEXT_CHUNK_SIZE+1];
+    char16_t s[REP_TEXT_CHUNK_SIZE+1];
 };
 
 
@@ -1751,7 +1751,7 @@ repTextAccess(UText *ut, int64_t index, UBool forward) {
      * Compute start/limit boundaries around index, for a segment of text
      * to be extracted.
      * To allow for the possibility that our user gave an index to the trailing
-     * half of a surrogate pair, we must request one extra preceding UChar when
+     * half of a surrogate pair, we must request one extra preceding char16_t when
      * going in the forward direction.  This will ensure that the buffer has the
      * entire code point at the specified index.
      */
@@ -1799,7 +1799,7 @@ repTextAccess(UText *ut, int64_t index, UBool forward) {
         // Figure out the bounds of the chunk to extract for reverse iteration.
         // Need to worry about chunk not splitting surrogate pairs, and while still
         // containing the data we need.
-        // Fix by requesting a chunk that includes an extra UChar at the end.
+        // Fix by requesting a chunk that includes an extra char16_t at the end.
         // If this turns out to be a lead surrogate, we can lop it off and still have
         //   the data we wanted.
         ut->chunkNativeStart = index32 + 1 - REP_TEXT_CHUNK_SIZE;
@@ -1834,7 +1834,7 @@ repTextAccess(UText *ut, int64_t index, UBool forward) {
             }
         }
 
-    // if the first UChar in the chunk could be the trailing half of a surrogate pair,
+    // if the first char16_t in the chunk could be the trailing half of a surrogate pair,
     // trim it off.
     if(ut->chunkNativeStart>0 && U16_IS_TRAIL(ex->s[0])) {
         ++(ut->chunkContents);
@@ -1857,7 +1857,7 @@ repTextAccess(UText *ut, int64_t index, UBool forward) {
 static int32_t U_CALLCONV
 repTextExtract(UText *ut,
                int64_t start, int64_t limit,
-               UChar *dest, int32_t destCapacity,
+               char16_t *dest, int32_t destCapacity,
                UErrorCode *status) {
     const Replaceable *rep=(const Replaceable *)ut->context;
     int32_t  length=rep->length();
@@ -1900,7 +1900,7 @@ repTextExtract(UText *ut,
 static int32_t U_CALLCONV
 repTextReplace(UText *ut,
                int64_t start, int64_t limit,
-               const UChar *src, int32_t length,
+               const char16_t *src, int32_t length,
                UErrorCode *status) {
     Replaceable *rep=(Replaceable *)ut->context;
     int32_t oldLength;
@@ -2139,7 +2139,7 @@ unistrTextAccess(UText *ut, int64_t index, UBool  forward) {
 static int32_t U_CALLCONV
 unistrTextExtract(UText *t,
                   int64_t start, int64_t limit,
-                  UChar *dest, int32_t destCapacity,
+                  char16_t *dest, int32_t destCapacity,
                   UErrorCode *pErrorCode) {
     const UnicodeString *us=(const UnicodeString *)t->context;
     int32_t length=us->length();
@@ -2176,7 +2176,7 @@ unistrTextExtract(UText *t,
 static int32_t U_CALLCONV
 unistrTextReplace(UText *ut,
                   int64_t start, int64_t limit,
-                  const UChar *src, int32_t length,
+                  const char16_t *src, int32_t length,
                   UErrorCode *pErrorCode) {
     UnicodeString *us=(UnicodeString *)ut->context;
     int32_t oldLength;
@@ -2331,7 +2331,7 @@ utext_openConstUnicodeString(UText *ut, const UnicodeString *s, UErrorCode *stat
 
 //------------------------------------------------------------------------------
 //
-//     UText implementation for const UChar * strings
+//     UText implementation for const char16_t * strings
 //
 //         Use of UText data members:
 //            context    pointer to UnicodeString
@@ -2359,8 +2359,8 @@ ucstrTextClone(UText *dest, const UText * src, UBool deep, UErrorCode * status)
         int32_t  len = (int32_t)utext_nativeLength(dest);
 
         // The cloned string IS going to be NUL terminated, whether or not the original was.
-        const UChar *srcStr = (const UChar *)src->context;
-        UChar *copyStr = (UChar *)uprv_malloc((len+1) * sizeof(UChar));
+        const char16_t *srcStr = (const char16_t *)src->context;
+        char16_t *copyStr = (char16_t *)uprv_malloc((len+1) * sizeof(char16_t));
         if (copyStr == nullptr) {
             *status = U_MEMORY_ALLOCATION_ERROR;
         } else {
@@ -2383,7 +2383,7 @@ ucstrTextClose(UText *ut) {
     // All that needs to be done here is delete the string if the UText
     //  owns it.  This occurs if the UText was created by cloning.
     if (ut->providerProperties & I32_FLAG(UTEXT_PROVIDER_OWNS_TEXT)) {
-        UChar *s = (UChar *)ut->context;
+        char16_t *s = (char16_t *)ut->context;
         uprv_free(s);
         ut->context = nullptr;
     }
@@ -2397,7 +2397,7 @@ ucstrTextLength(UText *ut) {
         // null terminated, we don't yet know the length. Scan for it.
         //    Access is not convenient for doing this
         //    because the current iteration position can't be changed.
-        const UChar  *str = (const UChar *)ut->context;
+        const char16_t  *str = (const char16_t *)ut->context;
         for (;;) {
             if (str[ut->chunkNativeLimit] == 0) {
                 break;
@@ -2415,7 +2415,7 @@ ucstrTextLength(UText *ut) {
 
 static UBool U_CALLCONV
 ucstrTextAccess(UText *ut, int64_t index, UBool  forward) {
-    const UChar *str   = (const UChar *)ut->context;
+    const char16_t *str   = (const char16_t *)ut->context;
 
     // pin the requested index to the bounds of the string,
     //  and set current iteration position.
@@ -2505,7 +2505,7 @@ breakout:
 static int32_t U_CALLCONV
 ucstrTextExtract(UText *ut,
                   int64_t start, int64_t limit,
-                  UChar *dest, int32_t destCapacity,
+                  char16_t *dest, int32_t destCapacity,
                   UErrorCode *pErrorCode)
 {
     if(U_FAILURE(*pErrorCode)) {
@@ -2516,7 +2516,7 @@ ucstrTextExtract(UText *ut,
         return 0;
     }
 
-    //const UChar *s=(const UChar *)ut->context;
+    //const char16_t *s=(const char16_t *)ut->context;
     int32_t si, di;
 
     int32_t start32;
@@ -2526,7 +2526,7 @@ ucstrTextExtract(UText *ut,
     //   Pins 'start' to the length of the string, if it came in out-of-bounds.
     //   Snaps 'start' to the beginning of a code point.
     ucstrTextAccess(ut, start, true);
-    const UChar *s=ut->chunkContents;
+    const char16_t *s=ut->chunkContents;
     start32 = ut->chunkOffset;
 
     int32_t strLength=(int32_t)ut->a;
@@ -2608,10 +2608,10 @@ static const struct UTextFuncs ucstrFuncs =
 
 U_CDECL_END
 
-static const UChar gEmptyUString[] = {0};
+static const char16_t gEmptyUString[] = {0};
 
 U_CAPI UText * U_EXPORT2
-utext_openUChars(UText *ut, const UChar *s, int64_t length, UErrorCode *status) {
+utext_openUChars(UText *ut, const char16_t *s, int64_t length, UErrorCode *status) {
     if (U_FAILURE(*status)) {
         return nullptr;
     }
@@ -2697,7 +2697,7 @@ charIterTextAccess(UText *ut, int64_t index, UBool  forward) {
     // Find the native index of the start of the buffer containing what we want.
     neededIndex -= neededIndex % CIBufSize;
 
-    UChar *buf = nullptr;
+    char16_t *buf = nullptr;
     UBool  needChunkSetup = true;
     int    i;
     if (ut->chunkNativeStart == neededIndex) {
@@ -2705,17 +2705,17 @@ charIterTextAccess(UText *ut, int64_t index, UBool  forward) {
         needChunkSetup = false;
     } else if (ut->b == neededIndex) {
         // The first buffer (buffer p) has what we need.
-        buf = (UChar *)ut->p;
+        buf = (char16_t *)ut->p;
     } else if (ut->c == neededIndex) {
         // The second buffer (buffer q) has what we need.
-        buf = (UChar *)ut->q;
+        buf = (char16_t *)ut->q;
     } else {
         // Neither buffer already has what we need.
         // Load new data from the character iterator.
         // Use the buf that is not the current buffer.
-        buf = (UChar *)ut->p;
+        buf = (char16_t *)ut->p;
         if (ut->p == ut->chunkContents) {
-            buf = (UChar *)ut->q;
+            buf = (char16_t *)ut->q;
         }
         ci->setIndex(neededIndex);
         for (i=0; i<CIBufSize; i++) {
@@ -2774,7 +2774,7 @@ charIterTextClone(UText *dest, const UText *src, UBool deep, UErrorCode * status
 static int32_t U_CALLCONV
 charIterTextExtract(UText *ut,
                   int64_t start, int64_t limit,
-                  UChar *dest, int32_t destCapacity,
+                  char16_t *dest, int32_t destCapacity,
                   UErrorCode *status)
 {
     if(U_FAILURE(*status)) {
@@ -2848,7 +2848,7 @@ utext_openCharacterIterator(UText *ut, CharacterIterator *ci, UErrorCode *status
     }
 
     // Extra space in UText for 2 buffers of CIBufSize UChars each.
-    int32_t  extraSpace = 2 * CIBufSize * sizeof(UChar);
+    int32_t  extraSpace = 2 * CIBufSize * sizeof(char16_t);
     ut = utext_setup(ut, extraSpace, status);
     if (U_SUCCESS(*status)) {
         ut->pFuncs                = &charIterFuncs;
@@ -2857,7 +2857,7 @@ utext_openCharacterIterator(UText *ut, CharacterIterator *ci, UErrorCode *status
         ut->a                    = ci->endIndex();        // Length of text
         ut->p                    = ut->pExtra;            // First buffer
         ut->b                    = -1;                    // Native index of first buffer contents
-        ut->q                    = (UChar*)ut->pExtra+CIBufSize;  // Second buffer
+        ut->q                    = (char16_t*)ut->pExtra+CIBufSize;  // Second buffer
         ut->c                    = -1;                    // Native index of second buffer contents
 
         // Initialize current chunk contents to be empty.
@@ -2866,7 +2866,7 @@ utext_openCharacterIterator(UText *ut, CharacterIterator *ci, UErrorCode *status
         //          so that getNativeIndex() will correctly compute to zero
         //          if no call to Access() has ever been made.  They can't be both
         //          zero without Access() thinking that the chunk is valid.
-        ut->chunkContents        = (UChar *)ut->p;
+        ut->chunkContents        = (char16_t *)ut->p;
         ut->chunkNativeStart     = -1;
         ut->chunkOffset          = 1;
         ut->chunkNativeLimit     = 0;
index 1d7ff9b115a9a0657d72a248db2fd75941f43746..f6a13aa445d228698dbe8adb5388927bf5dd3b21 100644 (file)
 #include "patternprops.h"
 #include "util.h"
 
-// Define UChar constants using hex for EBCDIC compatibility
+// Define char16_t constants using hex for EBCDIC compatibility
 
-static const UChar BACKSLASH  = 0x005C; /*\*/
-static const UChar UPPER_U    = 0x0055; /*U*/
-static const UChar LOWER_U    = 0x0075; /*u*/
-static const UChar APOSTROPHE = 0x0027; // '\''
-static const UChar SPACE      = 0x0020; // ' '
+static const char16_t BACKSLASH  = 0x005C; /*\*/
+static const char16_t UPPER_U    = 0x0055; /*U*/
+static const char16_t LOWER_U    = 0x0075; /*u*/
+static const char16_t APOSTROPHE = 0x0027; // '\''
+static const char16_t SPACE      = 0x0020; // ' '
 
 // "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-static const UChar DIGITS[] = {
+static const char16_t DIGITS[] = {
     48,49,50,51,52,53,54,55,56,57,
     65,66,67,68,69,70,71,72,73,74,
     75,76,77,78,79,80,81,82,83,84,
@@ -37,12 +37,12 @@ UnicodeString& ICU_Utility::appendNumber(UnicodeString& result, int32_t n,
                                      int32_t radix, int32_t minDigits) {
     if (radix < 2 || radix > 36) {
         // Bogus radix
-        return result.append((UChar)63/*?*/);
+        return result.append((char16_t)63/*?*/);
     }
     // Handle negatives
     if (n < 0) {
         n = -n;
-        result.append((UChar)45/*-*/);
+        result.append((char16_t)45/*-*/);
     }
     // First determine the number of digits
     int32_t nn = n;
@@ -122,9 +122,9 @@ UnicodeString &ICU_Utility::escape(UnicodeString& result, UChar32 c) {
 /*
 int32_t ICU_Utility::quotedIndexOf(const UnicodeString& text,
                                int32_t start, int32_t limit,
-                               UChar charToFind) {
+                               char16_t charToFind) {
     for (int32_t i=start; i<limit; ++i) {
-        UChar c = text.charAt(i);
+        char16_t c = text.charAt(i);
         if (c == BACKSLASH) {
             ++i;
         } else if (c == APOSTROPHE) {
@@ -149,7 +149,7 @@ int32_t ICU_Utility::quotedIndexOf(const UnicodeString& text,
 int32_t ICU_Utility::skipWhitespace(const UnicodeString& str, int32_t& pos,
                                     UBool advance) {
     int32_t p = pos;
-    const UChar* s = str.getBuffer();
+    const char16_t* s = str.getBuffer();
     p = (int32_t)(PatternProps::skipWhiteSpace(s + p, str.length() - p) - s);
     if (advance) {
         pos = p;
@@ -212,7 +212,7 @@ int32_t ICU_Utility::skipWhitespace(const UnicodeString& str, int32_t& pos,
  * @return true if 'ch' is seen preceded by zero or more
  * whitespace characters.
  */
-UBool ICU_Utility::parseChar(const UnicodeString& id, int32_t& pos, UChar ch) {
+UBool ICU_Utility::parseChar(const UnicodeString& id, int32_t& pos, char16_t ch) {
     int32_t start = pos;
     skipWhitespace(id, pos, true);
     if (pos == id.length() ||
@@ -292,7 +292,7 @@ int32_t ICU_Utility::parsePattern(const UnicodeString& pat,
 
 int32_t ICU_Utility::parseAsciiInteger(const UnicodeString& str, int32_t& pos) {
     int32_t result = 0;
-    UChar c;
+    char16_t c;
     while (pos < str.length() && (c = str.charAt(pos)) >= u'0' && c <= u'9') {
         result = result * 10 + (c - u'0');
         pos++;
index 4a9ae831de36c20fd0906bba95d1f5dc373c1d55..cf71b9623eab46d9db8abcf639de371e046729e5 100644 (file)
@@ -94,7 +94,7 @@ class U_COMMON_API ICU_Utility /* not : public UObject because all methods are s
 //?FOR FUTURE USE.  DISABLE FOR NOW for coverage reasons.
 //    static int32_t quotedIndexOf(const UnicodeString& text,
 //                                 int32_t start, int32_t limit,
-//                                 UChar c);
+//                                 char16_t c);
 
     /**
      * Skip over a sequence of zero or more white space characters at pos.
@@ -140,7 +140,7 @@ class U_COMMON_API ICU_Utility /* not : public UObject because all methods are s
      * @return true if 'ch' is seen preceded by zero or more
      * whitespace characters.
      */
-    static UBool parseChar(const UnicodeString& id, int32_t& pos, UChar ch);
+    static UBool parseChar(const UnicodeString& id, int32_t& pos, char16_t ch);
 
     /**
      * Parse a pattern string starting at offset pos.  Keywords are
index d6ae052214cc132d81239edb0b7871b791661d14..5991769d0681fe16b31d873fe0cbcc8e0eed71e0 100644 (file)
@@ -91,8 +91,8 @@ int32_t ICU_Utility::parsePattern(const UnicodeString& rule, int32_t pos, int32_
     int32_t p;
     int32_t intCount = 0; // number of integers parsed
     for (int32_t i=0; i<pattern.length(); ++i) {
-        UChar cpat = pattern.charAt(i);
-        UChar c;
+        char16_t cpat = pattern.charAt(i);
+        char16_t c;
         switch (cpat) {
         case 32 /*' '*/:
             if (pos >= limit) {
@@ -120,7 +120,7 @@ int32_t ICU_Utility::parsePattern(const UnicodeString& rule, int32_t pos, int32_
             if (pos >= limit) {
                 return -1;
             }
-            c = (UChar) u_tolower(rule.charAt(pos++));
+            c = (char16_t) u_tolower(rule.charAt(pos++));
             if (c != cpat) {
                 return -1;
             }
index a64762bdd59d665b05dd03115e3add6df80fbbc8..1f536d5643dfc512e11b2f6d7f86f2c994257fe3 100644 (file)
@@ -168,10 +168,10 @@ static void outputString(const char *s, char *outBuf, int32_t *outIx, int32_t ca
         
 
 
-static void outputUString(const UChar *s, int32_t len, 
+static void outputUString(const char16_t *s, int32_t len,
                           char *outBuf, int32_t *outIx, int32_t capacity, int32_t indent) {
     int32_t i = 0;
-    UChar   c;
+    char16_t   c;
     if (s==nullptr) {
         outputString(nullptr, outBuf, outIx, capacity, indent);
         return;
@@ -231,10 +231,10 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt,
             break;
 
         case 'S':
-            /* UChar * string, with length, len==-1 for NUL terminated. */
+            /* char16_t * string, with length, len==-1 for NUL terminated. */
             ptrArg = va_arg(args, char *);             /* Ptr    */
             intArg =(int32_t)va_arg(args, int32_t);    /* Length */
-            outputUString((const UChar *)ptrArg, intArg, outBuf, &outIx, capacity, indent);
+            outputUString((const char16_t *)ptrArg, intArg, outBuf, &outIx, capacity, indent);
             break;
 
         case 'b':
@@ -342,7 +342,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt,
 
                         case 'S':
                             charsToOutput = 0;
-                            outputUString((const UChar *)*ptrPtr, -1, outBuf, &outIx, capacity, indent);
+                            outputUString((const char16_t *)*ptrPtr, -1, outBuf, &outIx, capacity, indent);
                             outputChar('\n', outBuf, &outIx, capacity, indent);
                             longArg = *ptrPtr==nullptr? 0: 1;   /* for test for nullptr term. array. */
                             ptrPtr++;
index 8a204008b306c721fd86ac2691c6c0f80a8fb689..431f11568e16f0e8dc7eac57d9dfaed052cbe30e 100644 (file)
@@ -599,34 +599,34 @@ U_NAMESPACE_BEGIN
 // Use the Forward/Backward subclasses below.
 class UTrie2StringIterator : public UMemory {
 public:
-    UTrie2StringIterator(const UTrie2 *t, const UChar *p) :
+    UTrie2StringIterator(const UTrie2 *t, const char16_t *p) :
         trie(t), codePointStart(p), codePointLimit(p), codePoint(U_SENTINEL) {}
 
     const UTrie2 *trie;
-    const UChar *codePointStart, *codePointLimit;
+    const char16_t *codePointStart, *codePointLimit;
     UChar32 codePoint;
 };
 
 class BackwardUTrie2StringIterator : public UTrie2StringIterator {
 public:
-    BackwardUTrie2StringIterator(const UTrie2 *t, const UChar *s, const UChar *p) :
+    BackwardUTrie2StringIterator(const UTrie2 *t, const char16_t *s, const char16_t *p) :
         UTrie2StringIterator(t, p), start(s) {}
 
     uint16_t previous16();
 
-    const UChar *start;
+    const char16_t *start;
 };
 
 class ForwardUTrie2StringIterator : public UTrie2StringIterator {
 public:
     // Iteration limit l can be nullptr.
     // In that case, the caller must detect c==0 and stop.
-    ForwardUTrie2StringIterator(const UTrie2 *t, const UChar *p, const UChar *l) :
+    ForwardUTrie2StringIterator(const UTrie2 *t, const char16_t *p, const char16_t *l) :
         UTrie2StringIterator(t, p), limit(l) {}
 
     uint16_t next16();
 
-    const UChar *limit;
+    const char16_t *limit;
 };
 
 U_NAMESPACE_END
index 93656b0de4fafde87d6e56da4c2ad5bf5da43cbc..1254e8cba682f83f44746bf23cf0ef1cbbec0663 100644 (file)
@@ -404,7 +404,7 @@ utrie2_printLengths(const UTrie2 *trie, const char *which) {
 U_CAPI UTrie2 * U_EXPORT2
 utrie2_cloneAsThawed(const UTrie2 *other, UErrorCode *pErrorCode) {
     NewTrieAndStatus context;
-    UChar lead;
+    char16_t lead;
 
     if(U_FAILURE(*pErrorCode)) {
         return nullptr;
@@ -448,7 +448,7 @@ utrie2_cloneAsThawed(const UTrie2 *other, UErrorCode *pErrorCode) {
 U_CAPI UTrie2 * U_EXPORT2
 utrie2_fromUTrie(const UTrie *trie1, uint32_t errorValue, UErrorCode *pErrorCode) {
     NewTrieAndStatus context;
-    UChar lead;
+    char16_t lead;
 
     if(U_FAILURE(*pErrorCode)) {
         return nullptr;
index f1d757b5b9aba6126b2d59df899a6c5263e161ed..fce2af41306d63a4c349a1b4ce8bbd63b5927725 100644 (file)
@@ -49,8 +49,8 @@ const uint32_t severeErrors=
 
 static inline UBool
 isASCIIString(const UnicodeString &dest) {
-    const UChar *s=dest.getBuffer();
-    const UChar *limit=s+dest.length();
+    const char16_t *s=dest.getBuffer();
+    const char16_t *limit=s+dest.length();
     while(s<limit) {
         if(*s++>0x7f) {
             return false;
@@ -60,7 +60,7 @@ isASCIIString(const UnicodeString &dest) {
 }
 
 static UBool
-isASCIIOkBiDi(const UChar *s, int32_t length);
+isASCIIOkBiDi(const char16_t *s, int32_t length);
 
 static UBool
 isASCIIOkBiDi(const char *s, int32_t length);
@@ -185,13 +185,13 @@ private:
                     UBool toASCII, IDNAInfo &info, UErrorCode &errorCode) const;
 
     void
-    checkLabelBiDi(const UChar *label, int32_t labelLength, IDNAInfo &info) const;
+    checkLabelBiDi(const char16_t *label, int32_t labelLength, IDNAInfo &info) const;
 
     UBool
-    isLabelOkContextJ(const UChar *label, int32_t labelLength) const;
+    isLabelOkContextJ(const char16_t *label, int32_t labelLength) const;
 
     void
-    checkLabelContextO(const UChar *label, int32_t labelLength, IDNAInfo &info) const;
+    checkLabelContextO(const char16_t *label, int32_t labelLength, IDNAInfo &info) const;
 
     const Normalizer2 &uts46Norm2;  // uts46.nrm
     uint32_t options;
@@ -310,7 +310,7 @@ UTS46::process(const UnicodeString &src,
         dest.setToBogus();
         return dest;
     }
-    const UChar *srcArray=src.getBuffer();
+    const char16_t *srcArray=src.getBuffer();
     if(&dest==&src || srcArray==nullptr) {
         errorCode=U_ILLEGAL_ARGUMENT_ERROR;
         dest.setToBogus();
@@ -324,7 +324,7 @@ UTS46::process(const UnicodeString &src,
         info.errors|=UIDNA_ERROR_EMPTY_LABEL;
         return dest;
     }
-    UChar *destArray=dest.getBuffer(srcLength);
+    char16_t *destArray=dest.getBuffer(srcLength);
     if(destArray==nullptr) {
         errorCode=U_MEMORY_ALLOCATION_ERROR;
         return dest;
@@ -348,7 +348,7 @@ UTS46::process(const UnicodeString &src,
             dest.releaseBuffer(i);
             return dest;
         }
-        UChar c=srcArray[i];
+        char16_t c=srcArray[i];
         if(c>0x7f) {
             break;
         }
@@ -540,11 +540,11 @@ UTS46::processUnicode(const UnicodeString &src,
     UBool doMapDevChars=
         toASCII ? (options&UIDNA_NONTRANSITIONAL_TO_ASCII)==0 :
                   (options&UIDNA_NONTRANSITIONAL_TO_UNICODE)==0;
-    const UChar *destArray=dest.getBuffer();
+    const char16_t *destArray=dest.getBuffer();
     int32_t destLength=dest.length();
     int32_t labelLimit=labelStart;
     while(labelLimit<destLength) {
-        UChar c=destArray[labelLimit];
+        char16_t c=destArray[labelLimit];
         if(c==0x2e && !isLabel) {
             int32_t labelLength=labelLimit-labelStart;
             int32_t newLength=processLabel(dest, labelStart, labelLength,
@@ -604,7 +604,7 @@ UTS46::mapDevChars(UnicodeString &dest, int32_t labelStart, int32_t mappingStart
         return 0;
     }
     int32_t length=dest.length();
-    UChar *s=dest.getBuffer(dest[mappingStart]==0xdf ? length+1 : length);
+    char16_t *s=dest.getBuffer(dest[mappingStart]==0xdf ? length+1 : length);
     if(s==nullptr) {
         errorCode=U_MEMORY_ALLOCATION_ERROR;
         return length;
@@ -613,7 +613,7 @@ UTS46::mapDevChars(UnicodeString &dest, int32_t labelStart, int32_t mappingStart
     UBool didMapDevChars=false;
     int32_t readIndex=mappingStart, writeIndex=mappingStart;
     do {
-        UChar c=s[readIndex++];
+        char16_t c=s[readIndex++];
         switch(c) {
         case 0xdf:
             // Map sharp s to ss.
@@ -708,7 +708,7 @@ UTS46::processLabel(UnicodeString &dest,
     }
     UnicodeString fromPunycode;
     UnicodeString *labelString;
-    const UChar *label=dest.getBuffer()+labelStart;
+    const char16_t *label=dest.getBuffer()+labelStart;
     int32_t destLabelStart=labelStart;
     int32_t destLabelLength=labelLength;
     UBool wasPunycode;
@@ -725,7 +725,7 @@ UTS46::processLabel(UnicodeString &dest,
             return markBadACELabel(dest, labelStart, labelLength, toASCII, info, errorCode);
         }
         wasPunycode=true;
-        UChar *unicodeBuffer=fromPunycode.getBuffer(-1);  // capacity==-1: most labels should fit
+        char16_t *unicodeBuffer=fromPunycode.getBuffer(-1);  // capacity==-1: most labels should fit
         if(unicodeBuffer==nullptr) {
             // Should never occur if we used capacity==-1 which uses the internal buffer.
             errorCode=U_MEMORY_ALLOCATION_ERROR;
@@ -803,13 +803,13 @@ UTS46::processLabel(UnicodeString &dest,
     // in a non-Punycode label or U+FFFD itself in a Punycode label.
     // We also check for dots which can come from the input to a single-label function.
     // Ok to cast away const because we own the UnicodeString.
-    UChar *s=(UChar *)label;
-    const UChar *limit=label+labelLength;
-    UChar oredChars=0;
+    char16_t *s=(char16_t *)label;
+    const char16_t *limit=label+labelLength;
+    char16_t oredChars=0;
     // If we enforce STD3 rules, then ASCII characters other than LDH and dot are disallowed.
     UBool disallowNonLDHDot=(options&UIDNA_USE_STD3_RULES)!=0;
     do {
-        UChar c=*s;
+        char16_t c=*s;
         if(c<=0x7f) {
             if(c==0x2e) {
                 info.labelErrors|=UIDNA_ERROR_LABEL_HAS_DOT;
@@ -837,7 +837,7 @@ UTS46::processLabel(UnicodeString &dest,
     U16_NEXT_UNSAFE(label, cpLength, c);
     if((U_GET_GC_MASK(c)&U_GC_M_MASK)!=0) {
         info.labelErrors|=UIDNA_ERROR_LEADING_COMBINING_MARK;
-        labelString->replace(labelStart, cpLength, (UChar)0xfffd);
+        labelString->replace(labelStart, cpLength, (char16_t)0xfffd);
         label=labelString->getBuffer()+labelStart;
         labelLength+=1-cpLength;
         if(labelString==&dest) {
@@ -868,7 +868,7 @@ UTS46::processLabel(UnicodeString &dest,
             } else if(oredChars>=0x80) {
                 // Contains non-ASCII characters.
                 UnicodeString punycode;
-                UChar *buffer=punycode.getBuffer(63);  // 63==maximum DNS label length
+                char16_t *buffer=punycode.getBuffer(63);  // 63==maximum DNS label length
                 if(buffer==nullptr) {
                     errorCode=U_MEMORY_ALLOCATION_ERROR;
                     return destLabelLength;
@@ -934,12 +934,12 @@ UTS46::markBadACELabel(UnicodeString &dest,
     UBool disallowNonLDHDot=(options&UIDNA_USE_STD3_RULES)!=0;
     UBool isASCII=true;
     UBool onlyLDH=true;
-    const UChar *label=dest.getBuffer()+labelStart;
-    const UChar *limit=label+labelLength;
+    const char16_t *label=dest.getBuffer()+labelStart;
+    const char16_t *limit=label+labelLength;
     // Start after the initial "xn--".
     // Ok to cast away const because we own the UnicodeString.
-    for(UChar *s=const_cast<UChar *>(label+4); s<limit; ++s) {
-        UChar c=*s;
+    for(char16_t *s=const_cast<char16_t *>(label+4); s<limit; ++s) {
+        char16_t c=*s;
         if(c<=0x7f) {
             if(c==0x2e) {
                 info.labelErrors|=UIDNA_ERROR_LABEL_HAS_DOT;
@@ -957,7 +957,7 @@ UTS46::markBadACELabel(UnicodeString &dest,
         }
     }
     if(onlyLDH) {
-        dest.insert(labelStart+labelLength, (UChar)0xfffd);
+        dest.insert(labelStart+labelLength, (char16_t)0xfffd);
         if(dest.isBogus()) {
             errorCode=U_MEMORY_ALLOCATION_ERROR;
             return 0;
@@ -997,7 +997,7 @@ const uint32_t R_AL_AN_EN_ES_CS_ET_ON_BN_NSM_MASK=R_AL_MASK|EN_AN_MASK|ES_CS_ET_
 // that a domain name is a BiDi domain name (has an RTL label) only after
 // processing several earlier labels.
 void
-UTS46::checkLabelBiDi(const UChar *label, int32_t labelLength, IDNAInfo &info) const {
+UTS46::checkLabelBiDi(const char16_t *label, int32_t labelLength, IDNAInfo &info) const {
     // IDNA2008 BiDi rule
     // Get the directionality of the first character.
     UChar32 c;
@@ -1085,10 +1085,10 @@ UTS46::checkLabelBiDi(const UChar *label, int32_t labelLength, IDNAInfo &info) c
 // Cannot contain uppercase A-Z.
 // s[length-1] must be the trailing dot.
 static UBool
-isASCIIOkBiDi(const UChar *s, int32_t length) {
+isASCIIOkBiDi(const char16_t *s, int32_t length) {
     int32_t labelStart=0;
     for(int32_t i=0; i<length; ++i) {
-        UChar c=s[i];
+        char16_t c=s[i];
         if(c==0x2e) {  // dot
             if(i>labelStart) {
                 c=s[i-1];
@@ -1146,7 +1146,7 @@ isASCIIOkBiDi(const char *s, int32_t length) {
 }
 
 UBool
-UTS46::isLabelOkContextJ(const UChar *label, int32_t labelLength) const {
+UTS46::isLabelOkContextJ(const char16_t *label, int32_t labelLength) const {
     // [IDNA2008-Tables]
     // 200C..200D  ; CONTEXTJ    # ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER
     for(int32_t i=0; i<labelLength; ++i) {
@@ -1215,7 +1215,7 @@ UTS46::isLabelOkContextJ(const UChar *label, int32_t labelLength) const {
 }
 
 void
-UTS46::checkLabelContextO(const UChar *label, int32_t labelLength, IDNAInfo &info) const {
+UTS46::checkLabelContextO(const char16_t *label, int32_t labelLength, IDNAInfo &info) const {
     int32_t labelEnd=labelLength-1;  // inclusive
     int32_t arabicDigits=0;  // -1 for 066x, +1 for 06Fx
     for(int32_t i=0; i<=labelEnd; ++i) {
@@ -1365,8 +1365,8 @@ idnaInfoToStruct(IDNAInfo &info, UIDNAInfo *pInfo) {
 
 U_CAPI int32_t U_EXPORT2
 uidna_labelToASCII(const UIDNA *idna,
-                   const UChar *label, int32_t length,
-                   UChar *dest, int32_t capacity,
+                   const char16_t *label, int32_t length,
+                   char16_t *dest, int32_t capacity,
                    UIDNAInfo *pInfo, UErrorCode *pErrorCode) {
     if(!checkArgs(label, length, dest, capacity, pInfo, pErrorCode)) {
         return 0;
@@ -1381,8 +1381,8 @@ uidna_labelToASCII(const UIDNA *idna,
 
 U_CAPI int32_t U_EXPORT2
 uidna_labelToUnicode(const UIDNA *idna,
-                     const UChar *label, int32_t length,
-                     UChar *dest, int32_t capacity,
+                     const char16_t *label, int32_t length,
+                     char16_t *dest, int32_t capacity,
                      UIDNAInfo *pInfo, UErrorCode *pErrorCode) {
     if(!checkArgs(label, length, dest, capacity, pInfo, pErrorCode)) {
         return 0;
@@ -1397,8 +1397,8 @@ uidna_labelToUnicode(const UIDNA *idna,
 
 U_CAPI int32_t U_EXPORT2
 uidna_nameToASCII(const UIDNA *idna,
-                  const UChar *name, int32_t length,
-                  UChar *dest, int32_t capacity,
+                  const char16_t *name, int32_t length,
+                  char16_t *dest, int32_t capacity,
                   UIDNAInfo *pInfo, UErrorCode *pErrorCode) {
     if(!checkArgs(name, length, dest, capacity, pInfo, pErrorCode)) {
         return 0;
@@ -1413,8 +1413,8 @@ uidna_nameToASCII(const UIDNA *idna,
 
 U_CAPI int32_t U_EXPORT2
 uidna_nameToUnicode(const UIDNA *idna,
-                    const UChar *name, int32_t length,
-                    UChar *dest, int32_t capacity,
+                    const char16_t *name, int32_t length,
+                    char16_t *dest, int32_t capacity,
                     UIDNAInfo *pInfo, UErrorCode *pErrorCode) {
     if(!checkArgs(name, length, dest, capacity, pInfo, pErrorCode)) {
         return 0;
index 044ab1cc752d9ad4cb5ec408758d307c7abad328..ef9cd68019da876310c8e4d0289cd9bb0888738a 100644 (file)
@@ -295,7 +295,7 @@ uprv_detectWindowsTimeZone()
     int geoId = GetUserGeoID(GEOCLASS_NATION);
     int regionCodeLen = GetGeoInfoW(geoId, GEO_ISO2, regionCodeW, UPRV_LENGTHOF(regionCodeW), 0);
 
-    const UChar *icuTZ16 = nullptr;
+    const char16_t *icuTZ16 = nullptr;
     int32_t tzListLen = 0;
 
     if (regionCodeLen != 0) {
index 0a438c316a686bf5a5ac6af2af041ce9f94b50a4..4fd8de1b85e03baa44936e2f2d70870e8dd13b99 100644 (file)
@@ -125,14 +125,14 @@ UBool ScriptRun::next()
     scriptCode = USCRIPT_COMMON;
 
     for (scriptStart = scriptEnd; scriptEnd < charLimit; scriptEnd += 1) {
-        UChar   high = charArray[scriptEnd];
+        char16_t   high = charArray[scriptEnd];
         UChar32 ch   = high;
 
         // if the character is a high surrogate and it's not the last one
         // in the text, see if it's followed by a low surrogate
         if (high >= 0xD800 && high <= 0xDBFF && scriptEnd < charLimit - 1)
         {
-            UChar low = charArray[scriptEnd + 1];
+            char16_t low = charArray[scriptEnd + 1];
 
             // if it is followed by a low surrogate,
             // consume it and form the full character
index c26be4dc650bf38bd2883ca69dd88784bd28cfff..cc0774664119907dc42969533471e3d7cc97d72f 100644 (file)
@@ -39,15 +39,15 @@ class ScriptRun : public UObject {
 public:
     ScriptRun();
 
-    ScriptRun(const UChar chars[], int32_t length);
+    ScriptRun(const char16_t chars[], int32_t length);
 
-    ScriptRun(const UChar chars[], int32_t start, int32_t length);
+    ScriptRun(const char16_t chars[], int32_t start, int32_t length);
 
     void reset();
 
     void reset(int32_t start, int32_t count);
 
-    void reset(const UChar chars[], int32_t start, int32_t length);
+    void reset(const char16_t chars[], int32_t start, int32_t length);
 
     int32_t getScriptStart();
 
@@ -77,7 +77,7 @@ private:
 
     int32_t charStart;
     int32_t charLimit;
-    const UChar *charArray;
+    const char16_t *charArray;
 
     int32_t scriptStart;
     int32_t scriptEnd;
@@ -106,12 +106,12 @@ inline ScriptRun::ScriptRun()
     reset(nullptr, 0, 0);
 }
 
-inline ScriptRun::ScriptRun(const UChar chars[], int32_t length)
+inline ScriptRun::ScriptRun(const char16_t chars[], int32_t length)
 {
     reset(chars, 0, length);
 }
 
-inline ScriptRun::ScriptRun(const UChar chars[], int32_t start, int32_t length)
+inline ScriptRun::ScriptRun(const char16_t chars[], int32_t start, int32_t length)
 {
     reset(chars, start, length);
 }
@@ -147,7 +147,7 @@ inline void ScriptRun::reset(int32_t start, int32_t length)
     reset();
 }
 
-inline void ScriptRun::reset(const UChar chars[], int32_t start, int32_t length)
+inline void ScriptRun::reset(const char16_t chars[], int32_t start, int32_t length)
 {
     charArray = chars;
 
index 8d59fb9ef6a0911f595189b5732182ccd90c5d70..63750960cdff37c28c17bfe1c73b40427254b326 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <stdio.h>
 
-UChar testChars[] = {
+char16_t testChars[] = {
             0x0020, 0x0946, 0x0939, 0x093F, 0x0928, 0x094D, 0x0926, 0x0940, 0x0020,
             0x0627, 0x0644, 0x0639, 0x0631, 0x0628, 0x064A, 0x0629, 0x0020,
             0x0420, 0x0443, 0x0441, 0x0441, 0x043A, 0x0438, 0x0439, 0x0020,
index 4c8a864af65b0e57f60cec5fe2588158ba561235..0f4af65663efb79eea1fbe086d6bf27ef601eb39 100644 (file)
@@ -427,7 +427,7 @@ getChunkLimit(const UnicodeString &prev, const UnicodeString &s) {
     // all of these characters are on the BMP
     // do not include FF or VT in case they are part of a paragraph
     // (important for bidi contexts)
-    static const UChar paraEnds[] = {
+    static const char16_t paraEnds[] = {
         0xd, 0xa, 0x85, 0x2028, 0x2029
     };
     enum {
@@ -445,8 +445,8 @@ getChunkLimit(const UnicodeString &prev, const UnicodeString &s) {
         }
     }
 
-    const UChar *u = s.getBuffer(), *limit = u + s.length();
-    UChar c;
+    const char16_t *u = s.getBuffer(), *limit = u + s.length();
+    char16_t c;
 
     while (u < limit) {
         c = *u++;
@@ -476,13 +476,13 @@ enum {
     CNV_ADDS_FEFF   // automatically adds/detects the U+FEFF signature character
 };
 
-static inline UChar
+static inline char16_t
 nibbleToHex(uint8_t n) {
     n &= 0xf;
     return
         n <= 9 ?
-            (UChar)(0x30 + n) :
-            (UChar)((0x61 - 10) + n);
+            (char16_t)(0x30 + n) :
+            (char16_t)((0x61 - 10) + n);
 }
 
 // check the converter's Unicode signature properties;
@@ -506,8 +506,8 @@ cnvSigType(UConverter *cnv) {
 
     if (result == CNV_WITH_FEFF) {
         // test if the output charset emits a signature anyway
-        const UChar a[1] = { 0x61 }; // "a"
-        const UChar *in;
+        const char16_t a[1] = { 0x61 }; // "a"
+        const char16_t *in;
 
         char buffer[20];
         char *out;
@@ -600,8 +600,8 @@ ConvertFile::convertFile(const char *pname,
 
     uint32_t infoffset = 0, outfoffset = 0;   /* Where we are in the file, for error reporting. */
 
-    const UChar *unibuf, *unibufbp;
-    UChar *unibufp;
+    const char16_t *unibuf, *unibufbp;
+    char16_t *unibufp;
 
     size_t rd, wr;
 
@@ -669,7 +669,7 @@ ConvertFile::convertFile(const char *pname,
             initMsg(pname);
 
             if (parse.line >= 0) {
-                UChar linebuf[20], offsetbuf[20];
+                char16_t linebuf[20], offsetbuf[20];
                 uprv_itou(linebuf, 20, parse.line, 10, 0);
                 uprv_itou(offsetbuf, 20, parse.offset, 10, 0);
                 u_wmsg(stderr, "cantCreateTranslitParseErr", str.getTerminatedBuffer(),
@@ -811,7 +811,7 @@ ConvertFile::convertFile(const char *pname,
                 UnicodeString str;
                 for (i = 0; i < errorLength; ++i) {
                     if (i > 0) {
-                        str.append((UChar)uSP);
+                        str.append((char16_t)uSP);
                     }
                     str.append(nibbleToHex((uint8_t)errorBytes[i] >> 4));
                     str.append(nibbleToHex((uint8_t)errorBytes[i]));
@@ -839,7 +839,7 @@ ConvertFile::convertFile(const char *pname,
                 if (u.charAt(0) == uSig) {
                     u.remove(0, 1);
 
-                    // account for the removed UChar and offset
+                    // account for the removed char16_t and offset
                     --ulen;
 
                     if (useOffsets) {
@@ -897,7 +897,7 @@ ConvertFile::convertFile(const char *pname,
             // and possible/necessary
             if (sig > 0) {
                 if (u.charAt(0) != uSig && cnvSigType(convto) == CNV_WITH_FEFF) {
-                    u.insert(0, (UChar)uSig);
+                    u.insert(0, (char16_t)uSig);
 
                     if (useOffsets) {
                         // insert a pseudo-offset into fromoffsets[] as well
@@ -906,7 +906,7 @@ ConvertFile::convertFile(const char *pname,
                         fromoffsets[0] = -1;
                     }
 
-                    // account for the additional UChar and offset
+                    // account for the additional char16_t and offset
                     ++ulen;
                 }
                 sig = 0;
@@ -939,7 +939,7 @@ ConvertFile::convertFile(const char *pname,
                 if (err == U_BUFFER_OVERFLOW_ERROR) {
                     err = U_ZERO_ERROR;
                 } else if (U_FAILURE(err)) {
-                    UChar errorUChars[4];
+                    char16_t errorUChars[4];
                     const char *errtag;
                     char pos[32];
                     UChar32 c;
@@ -991,7 +991,7 @@ ConvertFile::convertFile(const char *pname,
                     UnicodeString str;
                     for (i = 0; i < errorLength;) {
                         if (i > 0) {
-                            str.append((UChar)uSP);
+                            str.append((char16_t)uSP);
                         }
                         U16_NEXT(errorUChars, i, errorLength, c);
                         if (c >= 0x100000) {
@@ -1062,7 +1062,7 @@ normal_exit:
 }
 
 static void usage(const char *pname, int ecode) {
-    const UChar *msg;
+    const char16_t *msg;
     int32_t msgLen;
     UErrorCode err = U_ZERO_ERROR;
     FILE *fp = ecode ? stderr : stdout;
index b25b666cc787b3b19f4d6a7e87fa866c3da28429..1b49d3b54434f89f482ada23d2290e96c3ecdf9a 100644 (file)
@@ -40,7 +40,7 @@ namespace {
  * Prefix string for Chinese index buckets.
  * See http://unicode.org/repos/cldr/trunk/specs/ldml/tr35-collation.html#Collation_Indexes
  */
-const UChar BASE[1] = { 0xFDD0 };
+const char16_t BASE[1] = { 0xFDD0 };
 const int32_t BASE_LENGTH = 1;
 
 UBool isOneLabelBetterThanOther(const Normalizer2 &nfkdNormalizer,
@@ -376,19 +376,19 @@ const UnicodeString &fixLabel(const UnicodeString &current, UnicodeString &temp)
     if (!current.startsWith(BASE, BASE_LENGTH)) {
         return current;
     }
-    UChar rest = current.charAt(BASE_LENGTH);
+    char16_t rest = current.charAt(BASE_LENGTH);
     if (0x2800 < rest && rest <= 0x28FF) { // stroke count
         int32_t count = rest-0x2800;
-        temp.setTo((UChar)(0x30 + count % 10));
+        temp.setTo((char16_t)(0x30 + count % 10));
         if (count >= 10) {
             count /= 10;
-            temp.insert(0, (UChar)(0x30 + count % 10));
+            temp.insert(0, (char16_t)(0x30 + count % 10));
             if (count >= 10) {
                 count /= 10;
-                temp.insert(0, (UChar)(0x30 + count));
+                temp.insert(0, (char16_t)(0x30 + count));
             }
         }
-        return temp.append((UChar)0x5283);
+        return temp.append((char16_t)0x5283);
     }
     return temp.setTo(current, BASE_LENGTH);
 }
@@ -492,7 +492,7 @@ BucketList *AlphabeticIndex::createBucketList(UErrorCode &errorCode) const {
         bucketList->adoptElement(bucket.orphan(), errorCode);
         if (U_FAILURE(errorCode)) { return nullptr; }
         // Remember ASCII and Pinyin buckets for Pinyin redirects.
-        UChar c;
+        char16_t c;
         if (current.length() == 1 && 0x41 <= (c = current.charAt(0)) && c <= 0x5A) {  // A-Z
             asciiBuckets[c - 0x41] = (Bucket *)bucketList->lastElement();
         } else if (current.length() == BASE_LENGTH + 1 && current.startsWith(BASE, BASE_LENGTH) &&
@@ -522,7 +522,7 @@ BucketList *AlphabeticIndex::createBucketList(UErrorCode &errorCode) const {
                     // For example, after ... Q R S Sch we add Sch\uFFFF->S
                     // and after ... Q R S Sch Sch\uFFFF St we add St\uFFFF->S.
                     bucket.adoptInsteadAndCheckErrorCode(new Bucket(emptyString_,
-                        UnicodeString(current).append((UChar)0xFFFF),
+                        UnicodeString(current).append((char16_t)0xFFFF),
                         U_ALPHAINDEX_NORMAL),
                         errorCode);
                     if (U_FAILURE(errorCode)) {
@@ -760,7 +760,7 @@ UBool AlphabeticIndex::addChineseIndexCharacters(UErrorCode &errorCode) {
     while (iter.next()) {
         const UnicodeString &s = iter.getString();
         U_ASSERT (s.startsWith(BASE, BASE_LENGTH));
-        UChar c = s.charAt(s.length() - 1);
+        char16_t c = s.charAt(s.length() - 1);
         if (0x41 <= c && c <= 0x5A) {  // A-Z
             // There are Pinyin labels, add ASCII A-Z labels as well.
             initialLabels_->add(0x41, 0x5A);  // A-Z
@@ -774,7 +774,7 @@ UBool AlphabeticIndex::addChineseIndexCharacters(UErrorCode &errorCode) {
 /*
  * Return the string with interspersed CGJs. Input must have more than 2 codepoints.
  */
-static const UChar CGJ = 0x034F;
+static const char16_t CGJ = 0x034F;
 UnicodeString AlphabeticIndex::separated(const UnicodeString &item) {
     UnicodeString result;
     if (item.length() == 0) {
@@ -880,7 +880,7 @@ void AlphabeticIndex::init(const Locale *locale, UErrorCode &status) {
         return;
     }
 
-    inflowLabel_.setTo((UChar)0x2026);    // Ellipsis
+    inflowLabel_.setTo((char16_t)0x2026);    // Ellipsis
     overflowLabel_ = inflowLabel_;
     underflowLabel_ = inflowLabel_;
 
index c97b69404f33bfbc067ff6f7ddd73039f02b1eca..4972b6873332d55bec0d3a503ad4e02cac6caa9a 100644 (file)
 //------------------------------------------------------------
 // Constants
 
-static const UChar TARGET_SEP = 45; // '-'
-static const UChar VARIANT_SEP = 47; // '/'
-static const UChar ANY[] = {0x41,0x6E,0x79,0}; // "Any"
-static const UChar NULL_ID[] = {78,117,108,108,0}; // "Null"
-static const UChar LATIN_PIVOT[] = {0x2D,0x4C,0x61,0x74,0x6E,0x3B,0x4C,0x61,0x74,0x6E,0x2D,0}; // "-Latn;Latn-"
+static const char16_t TARGET_SEP = 45; // '-'
+static const char16_t VARIANT_SEP = 47; // '/'
+static const char16_t ANY[] = {0x41,0x6E,0x79,0}; // "Any"
+static const char16_t NULL_ID[] = {78,117,108,108,0}; // "Null"
+static const char16_t LATIN_PIVOT[] = {0x2D,0x4C,0x61,0x74,0x6E,0x3B,0x4C,0x61,0x74,0x6E,0x2D,0}; // "-Latn;Latn-"
 
 // initial size for an Any-XXXX transform's cache of script-XXXX transforms
 // (will grow as necessary, but we don't expect to have source text with more than 7 scripts)
index 861a76a0427536185d885f4e0fae044df2e422bf..585415643bab0edd845365c5f8228f8e6af1924e 100644 (file)
@@ -98,7 +98,7 @@ u_writeDiff(int32_t diff, uint8_t *p) {
  * NFD text - there are never Hangul characters included.
  */
 U_CFUNC UChar32
-u_writeIdenticalLevelRun(UChar32 prev, const UChar *s, int32_t length, icu::ByteSink &sink) {
+u_writeIdenticalLevelRun(UChar32 prev, const char16_t *s, int32_t length, icu::ByteSink &sink) {
     char scratch[64];
     int32_t capacity;
 
index c62911e785a7f70baba5dd6f2688c08593a4243b..1ec0b2ad441b11248ee6bbcb2c753175c79d1a65 100644 (file)
@@ -34,7 +34,7 @@ U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(BreakTransliterator)
 
-static const UChar SPACE       = 32;  // ' '
+static const char16_t SPACE       = 32;  // ' '
 
 
 /**
index 59756e3e528795217689f4133130c2fcf1586235..bb89dffce2631f1549390a3c1ae9253e9ee432e4 100644 (file)
@@ -253,7 +253,7 @@ static void getCalendarKeyword(const UnicodeString &id, char *targetBuffer, int3
     int32_t calKeyLen = calendarKeyword.length();
     int32_t keyLen = 0;
 
-    int32_t keywordIdx = id.indexOf((UChar)0x003D); /* '=' */
+    int32_t keywordIdx = id.indexOf((char16_t)0x003D); /* '=' */
     if (id[0] == 0x40/*'@'*/
         && id.compareBetween(1, keywordIdx+1, calendarKeyword, 0, calKeyLen) == 0)
     {
@@ -314,7 +314,7 @@ static ECalType getCalendarTypeForLocale(const char *locid) {
     if (U_SUCCESS(status) && order != nullptr) {
         // the first calendar type is the default for the region
         int32_t len = 0;
-        const UChar *uCalType = ures_getStringByIndex(order, 0, &len, &status);
+        const char16_t *uCalType = ures_getStringByIndex(order, 0, &len, &status);
         if (len < (int32_t)sizeof(calTypeBuf)) {
             u_UCharsToChars(uCalType, calTypeBuf, len);
             *(calTypeBuf + len) = 0; // terminate;
@@ -432,7 +432,7 @@ protected:
     {
         if (U_SUCCESS(status)) {
             for(int32_t i=0;gCalTypes[i] != nullptr;i++) {
-                UnicodeString id((UChar)0x40); /* '@' a variant character */
+                UnicodeString id((char16_t)0x40); /* '@' a variant character */
                 id.append(UNICODE_STRING_SIMPLE("calendar="));
                 id.append(UnicodeString(gCalTypes[i], -1, US_INV));
                 result.put(id, (void*)this, status);
@@ -502,7 +502,7 @@ protected:
         if (ret == nullptr) {
             status = U_MEMORY_ALLOCATION_ERROR;
         } else {
-            ret->append((UChar)0x40); // '@' is a variant character
+            ret->append((char16_t)0x40); // '@' is a variant character
             ret->append(UNICODE_STRING("calendar=", 9));
             ret->append(UnicodeString(gCalTypes[getCalendarTypeForLocale(loc.getName())], -1, US_INV));
         }
index a065330cac219ed6e2010dc35bf4e1c35adf3cef..2f9699ee9dc90b130f30371d80bd4f8721054400 100644 (file)
@@ -147,7 +147,7 @@ void CaseMapTransliterator::handleTransliterate(Replaceable& text,
     csc.limit = offsets.contextLimit;
 
     UnicodeString tmp;
-    const UChar *s;
+    const char16_t *s;
     UChar32 c;
     int32_t textPos, delta, result;
 
index 5e8e86631583c3a9c678b33f733b155ac837a14f..d160f2c05f698b0d64db42bcdafde2d3f571f0ef 100644 (file)
@@ -51,23 +51,23 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ChoiceFormat)
 // Special characters used by ChoiceFormat.  There are two characters
 // used interchangeably to indicate <=.  Either is parsed, but only
 // LESS_EQUAL is generated by toPattern().
-#define SINGLE_QUOTE ((UChar)0x0027)   /*'*/
-#define LESS_THAN    ((UChar)0x003C)   /*<*/
-#define LESS_EQUAL   ((UChar)0x0023)   /*#*/
-#define LESS_EQUAL2  ((UChar)0x2264)
-#define VERTICAL_BAR ((UChar)0x007C)   /*|*/
-#define MINUS        ((UChar)0x002D)   /*-*/
+#define SINGLE_QUOTE ((char16_t)0x0027)   /*'*/
+#define LESS_THAN    ((char16_t)0x003C)   /*<*/
+#define LESS_EQUAL   ((char16_t)0x0023)   /*#*/
+#define LESS_EQUAL2  ((char16_t)0x2264)
+#define VERTICAL_BAR ((char16_t)0x007C)   /*|*/
+#define MINUS        ((char16_t)0x002D)   /*-*/
 
-static const UChar LEFT_CURLY_BRACE = 0x7B;     /*{*/
-static const UChar RIGHT_CURLY_BRACE = 0x7D;    /*}*/
+static const char16_t LEFT_CURLY_BRACE = 0x7B;     /*{*/
+static const char16_t RIGHT_CURLY_BRACE = 0x7D;    /*}*/
 
 #ifdef INFINITY
 #undef INFINITY
 #endif
-#define INFINITY     ((UChar)0x221E)
+#define INFINITY     ((char16_t)0x221E)
 
-//static const UChar gPositiveInfinity[] = {INFINITY, 0};
-//static const UChar gNegativeInfinity[] = {MINUS, INFINITY, 0};
+//static const char16_t gPositiveInfinity[] = {INFINITY, 0};
+//static const char16_t gNegativeInfinity[] = {MINUS, INFINITY, 0};
 #define POSITIVE_INF_STRLEN 1
 #define NEGATIVE_INF_STRLEN 2
 
@@ -313,7 +313,7 @@ ChoiceFormat::setChoices(const double* limits,
         int32_t textLength = text.length();
         int32_t nestingLevel = 0;
         for (int32_t j = 0; j < textLength; ++j) {
-            UChar c = text[j];
+            char16_t c = text[j];
             if (c == SINGLE_QUOTE && nestingLevel == 0) {
                 // Double each top-level apostrophe.
                 result.append(c);
@@ -450,7 +450,7 @@ ChoiceFormat::findSubMessage(const MessagePattern &pattern, int32_t partIndex, d
         double boundary = pattern.getNumericValue(part);
         // Fetch the ARG_SELECTOR character.
         int32_t selectorIndex = pattern.getPatternIndex(partIndex++);
-        UChar boundaryChar = pattern.getPatternString().charAt(selectorIndex);
+        char16_t boundaryChar = pattern.getPatternString().charAt(selectorIndex);
         if (boundaryChar == LESS_THAN ? !(number > boundary) : !(number >= boundary)) {
             // The number is in the interval between the previous boundary and the current one.
             // Return with the sub-message between them.
index a9c6b3de1f2f10529ad5f39eb019e3876cb34495..be0a8e4690f9740cb1b3e42d3515e54764062f30 100644 (file)
@@ -234,7 +234,7 @@ void CollationElementIterator::setOffset(int32_t newOffset,
     if (0 < newOffset && newOffset < string_.length()) {
         int32_t offset = newOffset;
         do {
-            UChar c = string_.charAt(offset);
+            char16_t c = string_.charAt(offset);
             if (!rbc_->isUnsafe(c) ||
                     (U16_IS_LEAD(c) && !rbc_->isUnsafe(string_.char32At(offset)))) {
                 break;
@@ -278,7 +278,7 @@ void CollationElementIterator::setText(const UnicodeString& source,
     }
 
     string_ = source;
-    const UChar *s = string_.getBuffer();
+    const char16_t *s = string_.getBuffer();
     CollationIterator *newIter;
     UBool numeric = rbc_->settings->isNumeric();
     if (rbc_->settings->dontCheckFCD()) {
index e0322eda91e5c84e34a7fe5c29ccde53c34b95e0..6d6587275edc8a31b930a858d296e7d22ad77082 100644 (file)
@@ -505,8 +505,8 @@ Collator::EComparisonResult Collator::compare(const UnicodeString& source,
 }
 
 // implement deprecated, previously abstract method
-Collator::EComparisonResult Collator::compare(const UChar* source, int32_t sourceLength,
-                                    const UChar* target, int32_t targetLength) 
+Collator::EComparisonResult Collator::compare(const char16_t* source, int32_t sourceLength,
+                                    const char16_t* target, int32_t targetLength)
                                     const
 {
     UErrorCode ec = U_ZERO_ERROR;
index 81109c139574beb63a5c5884ea5c3cef961c6278..d8fb89738c6a5206c0641cf9ffd5a8fa81703e4f 100644 (file)
@@ -669,7 +669,7 @@ CollationBuilder::addRelation(int32_t strength, const UnicodeString &prefix,
     // It does not work with certain types of contextual mappings.
     int32_t nfdLength = nfdString.length();
     if(nfdLength >= 2) {
-        UChar c = nfdString.charAt(0);
+        char16_t c = nfdString.charAt(0);
         if(Hangul::isJamoL(c) || Hangul::isJamoV(c)) {
             // While handling a Hangul syllable, contractions starting with Jamo L or V
             // would not see the following Jamo of that syllable.
@@ -1030,7 +1030,7 @@ CollationBuilder::setCaseBits(const UnicodeString &nfdString,
 
     int64_t cases = 0;
     if(numTailoredPrimaries > 0) {
-        const UChar *s = nfdString.getBuffer();
+        const char16_t *s = nfdString.getBuffer();
         UTF16CollationIterator baseCEs(baseData, false, s, s, s + nfdString.length());
         int32_t baseCEsLength = baseCEs.fetchCEs(errorCode) - 1;
         if(U_FAILURE(errorCode)) {
@@ -1641,7 +1641,7 @@ U_NAMESPACE_END
 U_NAMESPACE_USE
 
 U_CAPI UCollator * U_EXPORT2
-ucol_openRules(const UChar *rules, int32_t rulesLength,
+ucol_openRules(const char16_t *rules, int32_t rulesLength,
                UColAttributeValue normalizationMode, UCollationStrength strength,
                UParseError *parseError, UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) { return nullptr; }
@@ -1676,13 +1676,13 @@ ucol_getUnsafeSet( const UCollator *coll,
                   USet *unsafe,
                   UErrorCode *status)
 {
-    UChar buffer[internalBufferSize];
+    char16_t buffer[internalBufferSize];
     int32_t len = 0;
 
     uset_clear(unsafe);
 
     // cccpattern = "[[:^tccc=0:][:^lccc=0:]]", unfortunately variant
-    static const UChar cccpattern[25] = { 0x5b, 0x5b, 0x3a, 0x5e, 0x74, 0x63, 0x63, 0x63, 0x3d, 0x30, 0x3a, 0x5d,
+    static const char16_t cccpattern[25] = { 0x5b, 0x5b, 0x3a, 0x5e, 0x74, 0x63, 0x63, 0x63, 0x3d, 0x30, 0x3a, 0x5d,
                                     0x5b, 0x3a, 0x5e, 0x6c, 0x63, 0x63, 0x63, 0x3d, 0x30, 0x3a, 0x5d, 0x5d, 0x00 };
 
     // add chars that fail the fcd check
index 69ea3d680077f2254d5b291fefd8b3065afe04d4..d4f66828fbcb3206d1fc684b38e06f11ffabddf9 100644 (file)
@@ -90,7 +90,7 @@ struct U_I18N_API CollationData : public UMemory {
      * Returns the CE32 from two contexts words.
      * Access to the defaultCE32 for contraction and prefix matching.
      */
-    static uint32_t readCE32(const UChar *p) {
+    static uint32_t readCE32(const char16_t *p) {
         return ((uint32_t)p[0] << 16) | p[1];
     }
 
@@ -178,7 +178,7 @@ struct U_I18N_API CollationData : public UMemory {
     /** Array of CE values for expansions and OFFSET_TAG. */
     const int64_t *ces;
     /** Array of prefix and contraction-suffix matching data. */
-    const UChar *contexts;
+    const char16_t *contexts;
     /** Base collation data, or nullptr if this data itself is a base. */
     const CollationData *base;
     /**
index 9f33550368c902e4020b6030907bbccae6b05345..7c6f1b881e6b1e99ad7c8cd0fd37be8689372f36 100644 (file)
@@ -657,7 +657,7 @@ CollationDataBuilder::addCE32(const UnicodeString &prefix, const UnicodeString &
         if (s.length() > cLength) {
             // Check that there's no modern Hangul in contractions.
             for (int32_t i = 0; i < s.length(); ++i) {
-                UChar c = s.charAt(i);
+                char16_t c = s.charAt(i);
                 if ((c >= 0x1100 && c < 0x1100 + 19) || (c >= 0x1161 && c < 0x1161 + 21) || (c >= 0x11A7 && c < 0x11A7 + 28) || (c >= 0xAC00 && c < 0xD7A4)) {
                     errorCode = U_UNSUPPORTED_ERROR;
                     return;
@@ -692,7 +692,7 @@ CollationDataBuilder::addCE32(const UnicodeString &prefix, const UnicodeString &
         if(!isBuilderContextCE32(oldCE32)) {
             // Replace the simple oldCE32 with a builder context CE32
             // pointing to a new ConditionalCE32 list head.
-            int32_t index = addConditionalCE32(UnicodeString((UChar)0), oldCE32, errorCode);
+            int32_t index = addConditionalCE32(UnicodeString((char16_t)0), oldCE32, errorCode);
             if(U_FAILURE(errorCode)) { return; }
             uint32_t contextCE32 = makeBuilderContextCE32(index);
             utrie2_set32(trie, c, contextCE32, &errorCode);
@@ -703,7 +703,7 @@ CollationDataBuilder::addCE32(const UnicodeString &prefix, const UnicodeString &
             cond->builtCE32 = Collation::NO_CE32;
         }
         UnicodeString suffix(s, cLength);
-        UnicodeString context((UChar)prefix.length());
+        UnicodeString context((char16_t)prefix.length());
         context.append(prefix).append(suffix);
         unsafeBackwardSet.addAll(suffix);
         for(;;) {
@@ -914,13 +914,13 @@ CollationDataBuilder::copyFromBaseCE32(UChar32 c, uint32_t ce32, UBool withConte
     case Collation::PREFIX_TAG: {
         // Flatten prefixes and nested suffixes (contractions)
         // into a linear list of ConditionalCE32.
-        const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
+        const char16_t *p = base->contexts + Collation::indexFromCE32(ce32);
         ce32 = CollationData::readCE32(p);  // Default if no prefix match.
         if(!withContext) {
             return copyFromBaseCE32(c, ce32, false, errorCode);
         }
         ConditionalCE32 head;
-        UnicodeString context((UChar)0);
+        UnicodeString context((char16_t)0);
         int32_t index;
         if(Collation::isContractionCE32(ce32)) {
             index = copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
@@ -934,7 +934,7 @@ CollationDataBuilder::copyFromBaseCE32(UChar32 c, uint32_t ce32, UBool withConte
         while(prefixes.next(errorCode)) {
             context = prefixes.getString();
             context.reverse();
-            context.insert(0, (UChar)context.length());
+            context.insert(0, (char16_t)context.length());
             ce32 = (uint32_t)prefixes.getValue();
             if(Collation::isContractionCE32(ce32)) {
                 index = copyContractionsFromBaseCE32(context, c, ce32, cond, errorCode);
@@ -951,12 +951,12 @@ CollationDataBuilder::copyFromBaseCE32(UChar32 c, uint32_t ce32, UBool withConte
     }
     case Collation::CONTRACTION_TAG: {
         if(!withContext) {
-            const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
+            const char16_t *p = base->contexts + Collation::indexFromCE32(ce32);
             ce32 = CollationData::readCE32(p);  // Default if no suffix match.
             return copyFromBaseCE32(c, ce32, false, errorCode);
         }
         ConditionalCE32 head;
-        UnicodeString context((UChar)0);
+        UnicodeString context((char16_t)0);
         copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
         ce32 = makeBuilderContextCE32(head.next);
         contextChars.add(c);
@@ -981,7 +981,7 @@ int32_t
 CollationDataBuilder::copyContractionsFromBaseCE32(UnicodeString &context, UChar32 c, uint32_t ce32,
                                                    ConditionalCE32 *cond, UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return 0; }
-    const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
+    const char16_t *p = base->contexts + Collation::indexFromCE32(ce32);
     int32_t index;
     if((ce32 & Collation::CONTRACT_SINGLE_CP_NO_MATCH) != 0) {
         // No match on the single code point.
@@ -1318,7 +1318,7 @@ U_CDECL_END
 
 void
 CollationDataBuilder::setLeadSurrogates(UErrorCode &errorCode) {
-    for(UChar lead = 0xd800; lead < 0xdc00; ++lead) {
+    for(char16_t lead = 0xd800; lead < 0xdc00; ++lead) {
         int32_t value = -1;
         utrie2_enumForLeadSurrogate(trie, lead, nullptr, enumRangeLeadValue, &value);
         utrie2_set32ForLeadSurrogateCodeUnit(
@@ -1411,7 +1411,7 @@ CollationDataBuilder::buildMappings(CollationData &data, UErrorCode &errorCode)
     // Mark each lead surrogate as "unsafe"
     // if any of its 1024 associated supplementary code points is "unsafe".
     UChar32 c = 0x10000;
-    for(UChar lead = 0xd800; lead < 0xdc00; ++lead, c += 0x400) {
+    for(char16_t lead = 0xd800; lead < 0xdc00; ++lead, c += 0x400) {
         if(unsafeBackwardSet.containsSome(c, c + 0x3ff)) {
             unsafeBackwardSet.add(lead);
         }
@@ -1612,7 +1612,7 @@ int32_t
 CollationDataBuilder::addContextTrie(uint32_t defaultCE32, UCharsTrieBuilder &trieBuilder,
                                      UErrorCode &errorCode) {
     UnicodeString context;
-    context.append((UChar)(defaultCE32 >> 16)).append((UChar)defaultCE32);
+    context.append((char16_t)(defaultCE32 >> 16)).append((char16_t)defaultCE32);
     UnicodeString trieString;
     context.append(trieBuilder.buildUnicodeString(USTRINGTRIE_BUILD_SMALL, trieString, errorCode));
     if(U_FAILURE(errorCode)) { return -1; }
index 33a834f498c73545152be6663602d72301ec5b87..1884208eaa4b433e7f8f0422f685c38e83d38b59 100644 (file)
@@ -252,7 +252,7 @@ CollationDataReader::read(const CollationTailoring *base, const uint8_t *inBytes
             errorCode = U_INVALID_FORMAT_ERROR;  // Tailored contexts without tailored trie.
             return;
         }
-        data->contexts = reinterpret_cast<const UChar *>(inBytes + offset);
+        data->contexts = reinterpret_cast<const char16_t *>(inBytes + offset);
         data->contextsLength = length / 2;
     }
 
@@ -317,7 +317,7 @@ CollationDataReader::read(const CollationTailoring *base, const uint8_t *inBytes
         // Mark each lead surrogate as "unsafe"
         // if any of its 1024 associated supplementary code points is "unsafe".
         UChar32 c = 0x10000;
-        for(UChar lead = 0xd800; lead < 0xdc00; ++lead, c += 0x400) {
+        for(char16_t lead = 0xd800; lead < 0xdc00; ++lead, c += 0x400) {
             if(!tailoring.unsafeBackwardSet->containsNone(c, c + 0x3ff)) {
                 tailoring.unsafeBackwardSet->add(lead);
             }
index 083b57ea5800c19477b43d41dc01959a779f12c8..5030f6c852369a037c5abf40d98efd53c379aef1 100644 (file)
@@ -80,7 +80,7 @@ struct U_I18N_API CollationDataReader /* all static */ {
 
         /** Byte offset to uint32_t rootElements[]. */
         IX_ROOT_ELEMENTS_OFFSET,  // 12
-        /** Byte offset to UChar *contexts[]. */
+        /** Byte offset to char16_t *contexts[]. */
         IX_CONTEXTS_OFFSET,
         /** Byte offset to uint16_t [] with serialized unsafeBackwardSet. */
         IX_UNSAFE_BWD_OFFSET,
@@ -198,7 +198,7 @@ private:
  *      Compact storage for all of the CEs that occur in the root collation.
  *      See the CollationRootElements class.
  *
- * UChar *contexts[];
+ * char16_t *contexts[];
  *      Serialized UCharsTrie structures with prefix (pre-context) and contraction mappings.
  *
  * uint16_t unsafeBackwardSet[]; -- see UnicodeSet::serialize()
index dff34f533c25beeeaa23dd81c1164131a5b8a8be..ce78a0526a3b0426635c3b21b66df3ca4afb3b3e 100644 (file)
@@ -302,9 +302,9 @@ CollationDataWriter::write(UBool isBase, const UVersionInfo dataVersion,
     UnicodeString scripts;
     indexes[CollationDataReader::IX_SCRIPTS_OFFSET] = totalSize;
     if(isBase) {
-        scripts.append((UChar)data.numScripts);
-        scripts.append(reinterpret_cast<const UChar *>(data.scriptsIndex), data.numScripts + 16);
-        scripts.append(reinterpret_cast<const UChar *>(data.scriptStarts), data.scriptStartsLength);
+        scripts.append((char16_t)data.numScripts);
+        scripts.append(reinterpret_cast<const char16_t *>(data.scriptsIndex), data.numScripts + 16);
+        scripts.append(reinterpret_cast<const char16_t *>(data.scriptStarts), data.scriptStartsLength);
         totalSize += scripts.length() * 2;
     }
 
index 1fbd27fc8ee47bb47a052f6573f099dc58cbcdf8..f40781a1178f60069d520311bdf1d8d30620833b 100644 (file)
@@ -107,8 +107,8 @@ CollationFastLatin::getOptions(const CollationData *data, const CollationSetting
 
 int32_t
 CollationFastLatin::compareUTF16(const uint16_t *table, const uint16_t *primaries, int32_t options,
-                                 const UChar *left, int32_t leftLength,
-                                 const UChar *right, int32_t rightLength) {
+                                 const char16_t *left, int32_t leftLength,
+                                 const char16_t *right, int32_t rightLength) {
     // This is a modified copy of CollationCompare::compareUpToQuaternary(),
     // optimized for common Latin text.
     // Keep them in sync!
@@ -854,7 +854,7 @@ CollationFastLatin::lookupUTF8Unsafe(const uint16_t *table, UChar32 c,
 
 uint32_t
 CollationFastLatin::nextPair(const uint16_t *table, UChar32 c, uint32_t ce,
-                             const UChar *s16, const uint8_t *s8, int32_t &sIndex, int32_t &sLength) {
+                             const char16_t *s16, const uint8_t *s8, int32_t &sIndex, int32_t &sLength) {
     if(ce >= MIN_LONG || ce < CONTRACTION) {
         return ce;  // simple or special mini CE
     } else if(ce >= EXPANSION) {
index 7013f71ce60416a6ced31a381dca430555a1462d..d4caddcb63e4b2cc644fd0f92d7035146121a98d 100644 (file)
@@ -188,7 +188,7 @@ public:
      */
     static const int32_t BAIL_OUT_RESULT = -2;
 
-    static inline int32_t getCharIndex(UChar c) {
+    static inline int32_t getCharIndex(char16_t c) {
         if(c <= LATIN_MAX) {
             return c;
         } else if(PUNCT_START <= c && c < PUNCT_LIMIT) {
@@ -211,8 +211,8 @@ public:
                               uint16_t *primaries, int32_t capacity);
 
     static int32_t compareUTF16(const uint16_t *table, const uint16_t *primaries, int32_t options,
-                                const UChar *left, int32_t leftLength,
-                                const UChar *right, int32_t rightLength);
+                                const char16_t *left, int32_t leftLength,
+                                const char16_t *right, int32_t rightLength);
 
     static int32_t compareUTF8(const uint16_t *table, const uint16_t *primaries, int32_t options,
                                const uint8_t *left, int32_t leftLength,
@@ -226,7 +226,7 @@ private:
                                      const uint8_t *s8, int32_t &sIndex);
 
     static uint32_t nextPair(const uint16_t *table, UChar32 c, uint32_t ce,
-                             const UChar *s16, const uint8_t *s8, int32_t &sIndex, int32_t &sLength);
+                             const char16_t *s16, const uint8_t *s8, int32_t &sIndex, int32_t &sLength);
 
     static inline uint32_t getPrimaries(uint32_t variableTop, uint32_t pair) {
         uint32_t ce = pair & 0xffff;
index c481445ca0044ec765e597a3702b83edcf8ddc57..b1fd3af70aaafd0056a55b853b3a99d4abdc0d3c 100644 (file)
@@ -140,7 +140,7 @@ CollationFastLatinBuilder::loadGroups(const CollationData &data, UErrorCode &err
     if(U_FAILURE(errorCode)) { return false; }
     headerLength = 1 + NUM_SPECIAL_GROUPS;
     uint32_t r0 = (CollationFastLatin::VERSION << 8) | headerLength;
-    result.append((UChar)r0);
+    result.append((char16_t)r0);
     // The first few reordering groups should be special groups
     // (space, punct, ..., digit) followed by Latn, then Grek and other scripts.
     for(int32_t i = 0; i < NUM_SPECIAL_GROUPS; ++i) {
@@ -149,7 +149,7 @@ CollationFastLatinBuilder::loadGroups(const CollationData &data, UErrorCode &err
             // missing data
             return false;
         }
-        result.append((UChar)0);  // reserve a slot for this group
+        result.append((char16_t)0);  // reserve a slot for this group
     }
 
     firstDigitPrimary = data.getFirstPrimaryForGroup(UCOL_REORDER_CODE_DIGIT);
@@ -205,7 +205,7 @@ void
 CollationFastLatinBuilder::getCEs(const CollationData &data, UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return; }
     int32_t i = 0;
-    for(UChar c = 0;; ++i, ++c) {
+    for(char16_t c = 0;; ++i, ++c) {
         if(c == CollationFastLatin::LATIN_LIMIT) {
             c = CollationFastLatin::PUNCT_START;
         } else if(c == CollationFastLatin::PUNCT_LIMIT) {
@@ -342,7 +342,7 @@ UBool
 CollationFastLatinBuilder::getCEsFromContractionCE32(const CollationData &data, uint32_t ce32,
                                                      UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return false; }
-    const UChar *p = data.contexts + Collation::indexFromCE32(ce32);
+    const char16_t *p = data.contexts + Collation::indexFromCE32(ce32);
     ce32 = CollationData::readCE32(p);  // Default if no suffix match.
     // Since the original ce32 is not a prefix mapping,
     // the default ce32 must not be another contraction.
@@ -454,7 +454,7 @@ CollationFastLatinBuilder::encodeUniqueCEs(UErrorCode &errorCode) {
                 U_ASSERT(pri <= CollationFastLatin::MAX_LONG);
                 // Set the group's header entry to the
                 // last "long primary" in or before the group.
-                result.setCharAt(1 + group, (UChar)pri);
+                result.setCharAt(1 + group, (char16_t)pri);
                 if(++group < NUM_SPECIAL_GROUPS) {
                     lastGroupPrimary = lastSpecialPrimaries[group];
                 } else {
@@ -566,7 +566,7 @@ CollationFastLatinBuilder::encodeCharCEs(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return false; }
     int32_t miniCEsStart = result.length();
     for(int32_t i = 0; i < CollationFastLatin::NUM_FAST_CHARS; ++i) {
-        result.append((UChar)0);  // initialize to completely ignorable
+        result.append((char16_t)0);  // initialize to completely ignorable
     }
     int32_t indexBase = result.length();
     for(int32_t i = 0; i < CollationFastLatin::NUM_FAST_CHARS; ++i) {
@@ -581,11 +581,11 @@ CollationFastLatinBuilder::encodeCharCEs(UErrorCode &errorCode) {
             if(expansionIndex > (int32_t)CollationFastLatin::INDEX_MASK) {
                 miniCE = CollationFastLatin::BAIL_OUT;
             } else {
-                result.append((UChar)(miniCE >> 16)).append((UChar)miniCE);
+                result.append((char16_t)(miniCE >> 16)).append((char16_t)miniCE);
                 miniCE = CollationFastLatin::EXPANSION | expansionIndex;
             }
         }
-        result.setCharAt(miniCEsStart + i, (UChar)miniCE);
+        result.setCharAt(miniCEsStart + i, (char16_t)miniCE);
     }
     return U_SUCCESS(errorCode);
 }
@@ -613,13 +613,13 @@ CollationFastLatinBuilder::encodeContractions(UErrorCode &errorCode) {
             int64_t cce1 = contractionCEs.elementAti(index + 2);
             uint32_t miniCE = encodeTwoCEs(cce0, cce1);
             if(miniCE == CollationFastLatin::BAIL_OUT) {
-                result.append((UChar)(x | (1 << CollationFastLatin::CONTR_LENGTH_SHIFT)));
+                result.append((char16_t)(x | (1 << CollationFastLatin::CONTR_LENGTH_SHIFT)));
             } else if(miniCE <= 0xffff) {
-                result.append((UChar)(x | (2 << CollationFastLatin::CONTR_LENGTH_SHIFT)));
-                result.append((UChar)miniCE);
+                result.append((char16_t)(x | (2 << CollationFastLatin::CONTR_LENGTH_SHIFT)));
+                result.append((char16_t)miniCE);
             } else {
-                result.append((UChar)(x | (3 << CollationFastLatin::CONTR_LENGTH_SHIFT)));
-                result.append((UChar)(miniCE >> 16)).append((UChar)miniCE);
+                result.append((char16_t)(x | (3 << CollationFastLatin::CONTR_LENGTH_SHIFT)));
+                result.append((char16_t)(miniCE >> 16)).append((char16_t)miniCE);
             }
             firstTriple = false;
         }
@@ -627,11 +627,11 @@ CollationFastLatinBuilder::encodeContractions(UErrorCode &errorCode) {
         // and if so, then we could truncate the result and reuse the other list.
         // However, that seems unlikely.
         result.setCharAt(headerLength + i,
-                         (UChar)(CollationFastLatin::CONTRACTION | contractionIndex));
+                         (char16_t)(CollationFastLatin::CONTRACTION | contractionIndex));
     }
     if(result.length() > firstContractionIndex) {
         // Terminate the last contraction list.
-        result.append((UChar)CollationFastLatin::CONTR_CHAR_MASK);
+        result.append((char16_t)CollationFastLatin::CONTR_CHAR_MASK);
     }
     if(result.isBogus()) {
         errorCode = U_MEMORY_ALLOCATION_ERROR;
index 3a6671d5288959e8e6a6838651bc90c76877fbba..f8c6da22b2baa806fee7ecf333ac1f9da55558ab 100644 (file)
@@ -209,7 +209,7 @@ CollationIterator::handleNextCE32(UChar32 &c, UErrorCode &errorCode) {
     return (c < 0) ? Collation::FALLBACK_CE32 : data->getCE32(c);
 }
 
-UChar
+char16_t
 CollationIterator::handleGetTrailSurrogate() {
     return 0;
 }
@@ -303,7 +303,7 @@ CollationIterator::appendCEsFromCE32(const CollationData *d, UChar32 c, uint32_t
             if(forward) { forwardNumCodePoints(1, errorCode); }
             break;
         case Collation::CONTRACTION_TAG: {
-            const UChar *p = d->contexts + Collation::indexFromCE32(ce32);
+            const char16_t *p = d->contexts + Collation::indexFromCE32(ce32);
             uint32_t defaultCE32 = CollationData::readCE32(p);  // Default if no suffix match.
             if(!forward) {
                 // Backward contractions are handled by previousCEUnsafe().
@@ -408,7 +408,7 @@ CollationIterator::appendCEsFromCE32(const CollationData *d, UChar32 c, uint32_t
         case Collation::LEAD_SURROGATE_TAG: {
             U_ASSERT(forward);  // Backward iteration should never see lead surrogate code _unit_ data.
             U_ASSERT(U16_IS_LEAD(c));
-            UChar trail;
+            char16_t trail;
             if(U16_IS_TRAIL(trail = handleGetTrailSurrogate())) {
                 c = U16_GET_SUPPLEMENTARY(c, trail);
                 ce32 &= Collation::LEAD_TYPE_MASK;
@@ -447,7 +447,7 @@ CollationIterator::appendCEsFromCE32(const CollationData *d, UChar32 c, uint32_t
 uint32_t
 CollationIterator::getCE32FromPrefix(const CollationData *d, uint32_t ce32,
                                      UErrorCode &errorCode) {
-    const UChar *p = d->contexts + Collation::indexFromCE32(ce32);
+    const char16_t *p = d->contexts + Collation::indexFromCE32(ce32);
     ce32 = CollationData::readCE32(p);  // Default if no prefix match.
     p += 2;
     // Number of code points read before the original code point.
@@ -488,7 +488,7 @@ CollationIterator::backwardNumSkipped(int32_t n, UErrorCode &errorCode) {
 
 uint32_t
 CollationIterator::nextCE32FromContraction(const CollationData *d, uint32_t contractionCE32,
-                                           const UChar *p, uint32_t ce32, UChar32 c,
+                                           const char16_t *p, uint32_t ce32, UChar32 c,
                                            UErrorCode &errorCode) {
     // c: next code point after the original one
 
index 526509328980abf5c3198c2c88dd831f9e1f058a..07bdf61985ae09ae02bf9bf38bb87c5a7f146280 100644 (file)
@@ -242,7 +242,7 @@ protected:
      * if a trail surrogate follows the lead surrogate.
      * Otherwise returns any other code unit and does not advance.
      */
-    virtual UChar handleGetTrailSurrogate();
+    virtual char16_t handleGetTrailSurrogate();
 
     /**
      * Called when handleNextCE32() returns with c==0, to see whether it is a NUL terminator.
@@ -290,7 +290,7 @@ private:
 
     uint32_t nextCE32FromContraction(
             const CollationData *d, uint32_t contractionCE32,
-            const UChar *p, uint32_t ce32, UChar32 c,
+            const char16_t *p, uint32_t ce32, UChar32 c,
             UErrorCode &errorCode);
 
     uint32_t nextCE32FromDiscontiguousContraction(
index 2e08cd7fd6fb09aa786c78ba261918a670ffaf7e..4cc25a1f5ced210d6296f72f99e29160cc8a6065 100644 (file)
@@ -40,7 +40,7 @@ U_NAMESPACE_BEGIN
 
 namespace {
 
-static const UChar BEFORE[] = { 0x5b, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0 };  // "[before"
+static const char16_t BEFORE[] = { 0x5b, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0 };  // "[before"
 const int32_t BEFORE_LENGTH = 7;
 
 }  // namespace
@@ -92,7 +92,7 @@ CollationRuleParser::parse(const UnicodeString &ruleString, UErrorCode &errorCod
     ruleIndex = 0;
 
     while(ruleIndex < rules->length()) {
-        UChar c = rules->charAt(ruleIndex);
+        char16_t c = rules->charAt(ruleIndex);
         if(PatternProps::isWhiteSpace(c)) {
             ++ruleIndex;
             continue;
@@ -174,7 +174,7 @@ CollationRuleParser::parseResetAndPosition(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return UCOL_DEFAULT; }
     int32_t i = skipWhiteSpace(ruleIndex + 1);
     int32_t j;
-    UChar c;
+    char16_t c;
     int32_t resetStrength;
     if(rules->compare(i, BEFORE_LENGTH, BEFORE, 0, BEFORE_LENGTH) == 0 &&
             (j = i + BEFORE_LENGTH) < rules->length() &&
@@ -211,7 +211,7 @@ CollationRuleParser::parseRelationOperator(UErrorCode &errorCode) {
     if(ruleIndex >= rules->length()) { return UCOL_DEFAULT; }
     int32_t strength;
     int32_t i = ruleIndex;
-    UChar c = rules->charAt(i++);
+    char16_t c = rules->charAt(i++);
     switch(c) {
     case 0x3c:  // '<'
         if(i < rules->length() && rules->charAt(i) == 0x3c) {  // <<
@@ -262,7 +262,7 @@ CollationRuleParser::parseRelationStrings(int32_t strength, int32_t i, UErrorCod
     UnicodeString prefix, str, extension;
     i = parseTailoringString(i, str, errorCode);
     if(U_FAILURE(errorCode)) { return; }
-    UChar next = (i < rules->length()) ? rules->charAt(i) : 0;
+    char16_t next = (i < rules->length()) ? rules->charAt(i) : 0;
     if(next == 0x7c) {  // '|' separates the context prefix from the string.
         prefix = str;
         i = parseTailoringString(i + 1, str, errorCode);
@@ -377,7 +377,7 @@ CollationRuleParser::parseString(int32_t i, UnicodeString &raw, UErrorCode &erro
             if(c == 0x27) {  // apostrophe
                 if(i < rules->length() && rules->charAt(i) == 0x27) {
                     // Double apostrophe, encodes a single one.
-                    raw.append((UChar)0x27);
+                    raw.append((char16_t)0x27);
                     ++i;
                     continue;
                 }
@@ -397,7 +397,7 @@ CollationRuleParser::parseString(int32_t i, UnicodeString &raw, UErrorCode &erro
                             break;
                         }
                     }
-                    raw.append((UChar)c);
+                    raw.append((char16_t)c);
                 }
             } else if(c == 0x5c) {  // backslash
                 if(i == rules->length()) {
@@ -417,7 +417,7 @@ CollationRuleParser::parseString(int32_t i, UnicodeString &raw, UErrorCode &erro
             --i;
             break;
         } else {
-            raw.append((UChar)c);
+            raw.append((char16_t)c);
         }
     }
     for(int32_t j = 0; j < raw.length();) {
@@ -465,16 +465,16 @@ CollationRuleParser::parseSpecialPosition(int32_t i, UnicodeString &str, UErrorC
         ++j;
         for(int32_t pos = 0; pos < UPRV_LENGTHOF(positions); ++pos) {
             if(raw == UnicodeString(positions[pos], -1, US_INV)) {
-                str.setTo((UChar)POS_LEAD).append((UChar)(POS_BASE + pos));
+                str.setTo((char16_t)POS_LEAD).append((char16_t)(POS_BASE + pos));
                 return j;
             }
         }
         if(raw == UNICODE_STRING_SIMPLE("top")) {
-            str.setTo((UChar)POS_LEAD).append((UChar)(POS_BASE + LAST_REGULAR));
+            str.setTo((char16_t)POS_LEAD).append((char16_t)(POS_BASE + LAST_REGULAR));
             return j;
         }
         if(raw == UNICODE_STRING_SIMPLE("variable top")) {
-            str.setTo((UChar)POS_LEAD).append((UChar)(POS_BASE + LAST_VARIABLE));
+            str.setTo((char16_t)POS_LEAD).append((char16_t)(POS_BASE + LAST_VARIABLE));
             return j;
         }
     }
@@ -506,14 +506,14 @@ CollationRuleParser::parseSetting(UErrorCode &errorCode) {
             return;
         }
         UnicodeString v;
-        int32_t valueIndex = raw.lastIndexOf((UChar)0x20);
+        int32_t valueIndex = raw.lastIndexOf((char16_t)0x20);
         if(valueIndex >= 0) {
             v.setTo(raw, valueIndex + 1);
             raw.truncate(valueIndex);
         }
         if(raw == UNICODE_STRING_SIMPLE("strength") && v.length() == 1) {
             int32_t value = UCOL_DEFAULT;
-            UChar c = v.charAt(0);
+            char16_t c = v.charAt(0);
             if(0x31 <= c && c <= 0x34) {  // 1..4
                 value = UCOL_PRIMARY + (c - 0x31);
             } else if(c == 0x49) {  // 'I'
@@ -698,7 +698,7 @@ CollationRuleParser::parseReordering(const UnicodeString &raw, UErrorCode &error
     CharString word;
     while(i < raw.length()) {
         ++i;  // skip the word-separating space
-        int32_t limit = raw.indexOf((UChar)0x20, i);
+        int32_t limit = raw.indexOf((char16_t)0x20, i);
         if(limit < 0) { limit = raw.length(); }
         word.clear().appendInvariantChars(raw.tempSubStringBetween(i, limit), errorCode);
         if(U_FAILURE(errorCode)) { return; }
@@ -756,7 +756,7 @@ CollationRuleParser::parseUnicodeSet(int32_t i, UnicodeSet &set, UErrorCode &err
             setParseError("unbalanced UnicodeSet pattern brackets", errorCode);
             return j;
         }
-        UChar c = rules->charAt(j++);
+        char16_t c = rules->charAt(j++);
         if(c == 0x5b) {  // '['
             ++level;
         } else if(c == 0x5d) {  // ']'
@@ -779,12 +779,12 @@ CollationRuleParser::parseUnicodeSet(int32_t i, UnicodeSet &set, UErrorCode &err
 
 int32_t
 CollationRuleParser::readWords(int32_t i, UnicodeString &raw) const {
-    static const UChar sp = 0x20;
+    static const char16_t sp = 0x20;
     raw.remove();
     i = skipWhiteSpace(i);
     for(;;) {
         if(i >= rules->length()) { return 0; }
-        UChar c = rules->charAt(i);
+        char16_t c = rules->charAt(i);
         if(isSyntaxChar(c) && c != 0x2d && c != 0x5f) {  // syntax except -_
             if(raw.isEmpty()) { return i; }
             if(raw.endsWith(&sp, 1)) {  // remove trailing space
@@ -806,7 +806,7 @@ int32_t
 CollationRuleParser::skipComment(int32_t i) const {
     // skip to past the newline
     while(i < rules->length()) {
-        UChar c = rules->charAt(i++);
+        char16_t c = rules->charAt(i++);
         // LF or FF or CR or NEL or LS or PS
         if(c == 0xa || c == 0xc || c == 0xd || c == 0x85 || c == 0x2028 || c == 0x2029) {
             // Unicode Newline Guidelines: "A readline function should stop at NLF, LS, FF, or PS."
index e124881fcf0a2f418b976454104af445398e154c..aabdf03f57b14aa3465f21f06e50b83d384fc7cd 100644 (file)
@@ -60,13 +60,13 @@ public:
      *
      * The second contraction character is POS_BASE + Position.
      */
-    static const UChar POS_LEAD = 0xfffe;
+    static const char16_t POS_LEAD = 0xfffe;
     /**
      * Base for the second character of contractions that encode special reset positions.
      * Braille characters U+28xx are printable and normalization-inert.
      * @see POS_LEAD
      */
-    static const UChar POS_BASE = 0x2800;
+    static const char16_t POS_BASE = 0x2800;
 
     class U_I18N_API Sink : public UObject {
     public:
index d707e7978aeea38d1ec798efde798099d3efac79..62e6a5d1806eb090b5b1dfddf5cb20337c305bfc 100644 (file)
@@ -82,30 +82,30 @@ TailoredSet::handleCE32(UChar32 start, UChar32 end, uint32_t ce32) {
 void
 TailoredSet::compare(UChar32 c, uint32_t ce32, uint32_t baseCE32) {
     if(Collation::isPrefixCE32(ce32)) {
-        const UChar *p = data->contexts + Collation::indexFromCE32(ce32);
+        const char16_t *p = data->contexts + Collation::indexFromCE32(ce32);
         ce32 = data->getFinalCE32(CollationData::readCE32(p));
         if(Collation::isPrefixCE32(baseCE32)) {
-            const UChar *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
+            const char16_t *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
             baseCE32 = baseData->getFinalCE32(CollationData::readCE32(q));
             comparePrefixes(c, p + 2, q + 2);
         } else {
             addPrefixes(data, c, p + 2);
         }
     } else if(Collation::isPrefixCE32(baseCE32)) {
-        const UChar *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
+        const char16_t *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
         baseCE32 = baseData->getFinalCE32(CollationData::readCE32(q));
         addPrefixes(baseData, c, q + 2);
     }
 
     if(Collation::isContractionCE32(ce32)) {
-        const UChar *p = data->contexts + Collation::indexFromCE32(ce32);
+        const char16_t *p = data->contexts + Collation::indexFromCE32(ce32);
         if((ce32 & Collation::CONTRACT_SINGLE_CP_NO_MATCH) != 0) {
             ce32 = Collation::NO_CE32;
         } else {
             ce32 = data->getFinalCE32(CollationData::readCE32(p));
         }
         if(Collation::isContractionCE32(baseCE32)) {
-            const UChar *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
+            const char16_t *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
             if((baseCE32 & Collation::CONTRACT_SINGLE_CP_NO_MATCH) != 0) {
                 baseCE32 = Collation::NO_CE32;
             } else {
@@ -116,7 +116,7 @@ TailoredSet::compare(UChar32 c, uint32_t ce32, uint32_t baseCE32) {
             addContractions(c, p + 2);
         }
     } else if(Collation::isContractionCE32(baseCE32)) {
-        const UChar *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
+        const char16_t *q = baseData->contexts + Collation::indexFromCE32(baseCE32);
         baseCE32 = baseData->getFinalCE32(CollationData::readCE32(q));
         addContractions(c, q + 2);
     }
@@ -202,7 +202,7 @@ TailoredSet::compare(UChar32 c, uint32_t ce32, uint32_t baseCE32) {
             }
         }
     } else if(tag == Collation::HANGUL_TAG) {
-        UChar jamos[3];
+        char16_t jamos[3];
         int32_t length = Hangul::decompose(c, jamos);
         if(tailored->contains(jamos[0]) || tailored->contains(jamos[1]) ||
                 (length == 3 && tailored->contains(jamos[2]))) {
@@ -214,7 +214,7 @@ TailoredSet::compare(UChar32 c, uint32_t ce32, uint32_t baseCE32) {
 }
 
 void
-TailoredSet::comparePrefixes(UChar32 c, const UChar *p, const UChar *q) {
+TailoredSet::comparePrefixes(UChar32 c, const char16_t *p, const char16_t *q) {
     // Parallel iteration over prefixes of both tables.
     UCharsTrie::Iterator prefixes(p, 0, errorCode);
     UCharsTrie::Iterator basePrefixes(q, 0, errorCode);
@@ -222,7 +222,7 @@ TailoredSet::comparePrefixes(UChar32 c, const UChar *p, const UChar *q) {
     const UnicodeString *bp = nullptr;  // Base prefix.
     // Use a string with a U+FFFF as the limit sentinel.
     // U+FFFF is untailorable and will not occur in prefixes.
-    UnicodeString none((UChar)0xffff);
+    UnicodeString none((char16_t)0xffff);
     for(;;) {
         if(tp == nullptr) {
             if(prefixes.next(errorCode)) {
@@ -259,7 +259,7 @@ TailoredSet::comparePrefixes(UChar32 c, const UChar *p, const UChar *q) {
 }
 
 void
-TailoredSet::compareContractions(UChar32 c, const UChar *p, const UChar *q) {
+TailoredSet::compareContractions(UChar32 c, const char16_t *p, const char16_t *q) {
     // Parallel iteration over suffixes of both tables.
     UCharsTrie::Iterator suffixes(p, 0, errorCode);
     UCharsTrie::Iterator baseSuffixes(q, 0, errorCode);
@@ -268,8 +268,8 @@ TailoredSet::compareContractions(UChar32 c, const UChar *p, const UChar *q) {
     // Use a string with two U+FFFF as the limit sentinel.
     // U+FFFF is untailorable and will not occur in contractions except maybe
     // as a single suffix character for a root-collator boundary contraction.
-    UnicodeString none((UChar)0xffff);
-    none.append((UChar)0xffff);
+    UnicodeString none((char16_t)0xffff);
+    none.append((char16_t)0xffff);
     for(;;) {
         if(ts == nullptr) {
             if(suffixes.next(errorCode)) {
@@ -306,7 +306,7 @@ TailoredSet::compareContractions(UChar32 c, const UChar *p, const UChar *q) {
 }
 
 void
-TailoredSet::addPrefixes(const CollationData *d, UChar32 c, const UChar *p) {
+TailoredSet::addPrefixes(const CollationData *d, UChar32 c, const char16_t *p) {
     UCharsTrie::Iterator prefixes(p, 0, errorCode);
     while(prefixes.next(errorCode)) {
         addPrefix(d, prefixes.getString(), c, (uint32_t)prefixes.getValue());
@@ -318,7 +318,7 @@ TailoredSet::addPrefix(const CollationData *d, const UnicodeString &pfx, UChar32
     setPrefix(pfx);
     ce32 = d->getFinalCE32(ce32);
     if(Collation::isContractionCE32(ce32)) {
-        const UChar *p = d->contexts + Collation::indexFromCE32(ce32);
+        const char16_t *p = d->contexts + Collation::indexFromCE32(ce32);
         addContractions(c, p + 2);
     }
     tailored->add(UnicodeString(unreversedPrefix).append(c));
@@ -326,7 +326,7 @@ TailoredSet::addPrefix(const CollationData *d, const UnicodeString &pfx, UChar32
 }
 
 void
-TailoredSet::addContractions(UChar32 c, const UChar *p) {
+TailoredSet::addContractions(UChar32 c, const char16_t *p) {
     UCharsTrie::Iterator suffixes(p, 0, errorCode);
     while(suffixes.next(errorCode)) {
         addSuffix(c, suffixes.getString());
@@ -510,9 +510,9 @@ ContractionsAndExpansions::handleCE32(UChar32 start, UChar32 end, uint32_t ce32)
                 // TODO: This should be optimized,
                 // especially if [start..end] is the complete Hangul range. (assert that)
                 UTF16CollationIterator iter(data, false, nullptr, nullptr, nullptr);
-                UChar hangul[1] = { 0 };
+                char16_t hangul[1] = { 0 };
                 for(UChar32 c = start; c <= end; ++c) {
-                    hangul[0] = (UChar)c;
+                    hangul[0] = (char16_t)c;
                     iter.setText(hangul, hangul + 1);
                     int32_t length = iter.fetchCEs(errorCode);
                     if(U_FAILURE(errorCode)) { return; }
@@ -540,7 +540,7 @@ ContractionsAndExpansions::handleCE32(UChar32 start, UChar32 end, uint32_t ce32)
 void
 ContractionsAndExpansions::handlePrefixes(
         UChar32 start, UChar32 end, uint32_t ce32) {
-    const UChar *p = data->contexts + Collation::indexFromCE32(ce32);
+    const char16_t *p = data->contexts + Collation::indexFromCE32(ce32);
     ce32 = CollationData::readCE32(p);  // Default if no prefix match.
     handleCE32(start, end, ce32);
     if(!addPrefixes) { return; }
@@ -559,7 +559,7 @@ ContractionsAndExpansions::handlePrefixes(
 void
 ContractionsAndExpansions::handleContractions(
         UChar32 start, UChar32 end, uint32_t ce32) {
-    const UChar *p = data->contexts + Collation::indexFromCE32(ce32);
+    const char16_t *p = data->contexts + Collation::indexFromCE32(ce32);
     if((ce32 & Collation::CONTRACT_SINGLE_CP_NO_MATCH) != 0) {
         // No match on the single code point.
         // We are underneath a prefix, and the default mapping is just
index f69debc5d9fc9039c8d6751b206e325e2ce1f096..99aa194e762105e0314ace58a8beef45b5a99335 100644 (file)
@@ -58,12 +58,12 @@ public:
 
 private:
     void compare(UChar32 c, uint32_t ce32, uint32_t baseCE32);
-    void comparePrefixes(UChar32 c, const UChar *p, const UChar *q);
-    void compareContractions(UChar32 c, const UChar *p, const UChar *q);
+    void comparePrefixes(UChar32 c, const char16_t *p, const char16_t *q);
+    void compareContractions(UChar32 c, const char16_t *p, const char16_t *q);
 
-    void addPrefixes(const CollationData *d, UChar32 c, const UChar *p);
+    void addPrefixes(const CollationData *d, UChar32 c, const char16_t *p);
     void addPrefix(const CollationData *d, const UnicodeString &pfx, UChar32 c, uint32_t ce32);
-    void addContractions(UChar32 c, const UChar *p);
+    void addContractions(UChar32 c, const char16_t *p);
     void addSuffix(UChar32 c, const UnicodeString &sfx);
     void add(UChar32 c);
 
index 8236d4fae57dcf5d13f43974b44ee49c70a7801c..cb127c50917f16d3f1f545155383ff219356dd48 100644 (file)
 #include "cmemory.h"
 
 // keep in sync with Transliterator
-//static const UChar ID_SEP   = 0x002D; /*-*/
-static const UChar ID_DELIM = 0x003B; /*;*/
-static const UChar NEWLINE  = 10;
+//static const char16_t ID_SEP   = 0x002D; /*-*/
+static const char16_t ID_DELIM = 0x003B; /*;*/
+static const char16_t NEWLINE  = 10;
 
-static const UChar COLON_COLON[] = {0x3A, 0x3A, 0}; //"::"
+static const char16_t COLON_COLON[] = {0x3A, 0x3A, 0}; //"::"
 
 U_NAMESPACE_BEGIN
 
-const UChar CompoundTransliterator::PASS_STRING[] = { 0x0025, 0x0050, 0x0061, 0x0073, 0x0073, 0 }; // "%Pass"
+const char16_t CompoundTransliterator::PASS_STRING[] = { 0x0025, 0x0050, 0x0061, 0x0073, 0x0073, 0 }; // "%Pass"
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CompoundTransliterator)
 
@@ -385,7 +385,7 @@ void CompoundTransliterator::adoptTransliterators(Transliterator* adoptedTransli
 /**
  * Append c to buf, unless buf is empty or buf already ends in c.
  */
-static void _smartAppend(UnicodeString& buf, UChar c) {
+static void _smartAppend(UnicodeString& buf, char16_t c) {
     if (buf.length() != 0 &&
         buf.charAt(buf.length() - 1) != c) {
         buf.append(c);
index 2b8af08ea980dc8f985cb192a073f26d0059c613..ed7e438d97a281385fbf3c572e0c4aceb1e579c2 100644 (file)
@@ -171,7 +171,7 @@ public:
     static UClassID U_EXPORT2 getStaticClassID();
 
     /* @internal */
-    static const UChar PASS_STRING[];
+    static const char16_t PASS_STRING[];
 
 private:
 
index 81879c5269a098d0fcf8e12d2cb72d788fb0f8ff..4c5f73b31b0387476c418f92ba14afbb3829852a 100644 (file)
@@ -58,7 +58,7 @@ int32_t CharsetMatch::getConfidence()const
     return confidence;
 }
 
-int32_t CharsetMatch::getUChars(UChar *buf, int32_t cap, UErrorCode *status) const
+int32_t CharsetMatch::getUChars(char16_t *buf, int32_t cap, UErrorCode *status) const
 {
     UConverter *conv = ucnv_open(getName(), status);
     int32_t result = ucnv_toUChars(conv, buf, cap, (const char *) textIn->fRawInput, textIn->fRawLength, status);
index f475d39f0696a6ef052f6f1a9e56c1fc1db45b76..c31da81863785d6615695b8e66f16bfa02a04652 100644 (file)
@@ -62,7 +62,7 @@ class CharsetMatch : public UMemory
 
     int32_t getConfidence()const;
 
-    int32_t getUChars(UChar *buf, int32_t cap, UErrorCode *status) const;
+    int32_t getUChars(char16_t *buf, int32_t cap, UErrorCode *status) const;
 };
 
 U_NAMESPACE_END
index e0a64aa949a89406eef17ba610a4461436d0374a..a6e6f83f0f3219b339b562af2669dba59b3f9aa2 100644 (file)
@@ -37,7 +37,7 @@ const char *CharsetRecog_UTF_16_BE::getName() const
 //   NULs are a contra-indication, they will appear commonly if the actual encoding is UTF-32.
 //   NULs should be rare in actual text. 
 
-static int32_t adjustConfidence(UChar codeUnit, int32_t confidence) {
+static int32_t adjustConfidence(char16_t codeUnit, int32_t confidence) {
     if (codeUnit == 0) {
         confidence -= 10;
     } else if ((codeUnit >= 0x20 && codeUnit <= 0xff) || codeUnit == 0x0a) {
@@ -60,7 +60,7 @@ UBool CharsetRecog_UTF_16_BE::match(InputText* textIn, CharsetMatch *results) co
 
     int32_t bytesToCheck = (length > 30) ? 30 : length;
     for (int32_t charIndex=0; charIndex<bytesToCheck-1; charIndex+=2) {
-        UChar codeUnit = (input[charIndex] << 8) | input[charIndex + 1];
+        char16_t codeUnit = (input[charIndex] << 8) | input[charIndex + 1];
         if (charIndex == 0 && codeUnit == 0xFEFF) {
             confidence = 100;
             break;
@@ -95,7 +95,7 @@ UBool CharsetRecog_UTF_16_LE::match(InputText* textIn, CharsetMatch *results) co
 
     int32_t bytesToCheck = (length > 30) ? 30 : length;
     for (int32_t charIndex=0; charIndex<bytesToCheck-1; charIndex+=2) {
-        UChar codeUnit = input[charIndex] | (input[charIndex + 1] << 8);
+        char16_t codeUnit = input[charIndex] | (input[charIndex + 1] << 8);
         if (charIndex == 0 && codeUnit == 0xFEFF) {
             confidence = 100;     // UTF-16 BOM
             if (length >= 4 && input[2] == 0 && input[3] == 0) {
index 1a1c58027170c684629ba529206dcef7b5c96fe7..7c5adaaf7c39f4f1c5668a1798f6884443e37b1e 100644 (file)
@@ -29,7 +29,7 @@
 
 U_NAMESPACE_BEGIN
 
-static const UChar gNumberPatternSeparator = 0x3B; // ;
+static const char16_t gNumberPatternSeparator = 0x3B; // ;
 
 U_CDECL_BEGIN
 
@@ -50,11 +50,11 @@ U_CDECL_END
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CurrencyPluralInfo)
 
-static const UChar gDefaultCurrencyPluralPattern[] = {'0', '.', '#', '#', ' ', 0xA4, 0xA4, 0xA4, 0};
-static const UChar gTripleCurrencySign[] = {0xA4, 0xA4, 0xA4, 0};
-static const UChar gPluralCountOther[] = {0x6F, 0x74, 0x68, 0x65, 0x72, 0};
-static const UChar gPart0[] = {0x7B, 0x30, 0x7D, 0};
-static const UChar gPart1[] = {0x7B, 0x31, 0x7D, 0};
+static const char16_t gDefaultCurrencyPluralPattern[] = {'0', '.', '#', '#', ' ', 0xA4, 0xA4, 0xA4, 0};
+static const char16_t gTripleCurrencySign[] = {0xA4, 0xA4, 0xA4, 0};
+static const char16_t gPluralCountOther[] = {0x6F, 0x74, 0x68, 0x65, 0x72, 0};
+static const char16_t gPart0[] = {0x7B, 0x30, 0x7D, 0};
+static const char16_t gPart1[] = {0x7B, 0x31, 0x7D, 0};
 
 static const char gNumberElementsTag[]="NumberElements";
 static const char gLatnTag[]="latn";
@@ -289,7 +289,7 @@ CurrencyPluralInfo::setupCurrencyPluralPattern(const Locale& loc, UErrorCode& st
     ures_getByKeyWithFallback(numElements.getAlias(), ns->getName(), rb.getAlias(), &ec);
     ures_getByKeyWithFallback(rb.getAlias(), gPatternsTag, rb.getAlias(), &ec);
     int32_t ptnLen;
-    const UChar* numberStylePattern = ures_getStringByKeyWithFallback(rb.getAlias(), gDecimalFormatTag, &ptnLen, &ec);
+    const char16_t* numberStylePattern = ures_getStringByKeyWithFallback(rb.getAlias(), gDecimalFormatTag, &ptnLen, &ec);
     // Fall back to "latn" if num sys specific pattern isn't there.
     if ( ec == U_MISSING_RESOURCE_ERROR && (uprv_strcmp(ns->getName(), gLatnTag) != 0)) {
         ec = U_ZERO_ERROR;
@@ -298,7 +298,7 @@ CurrencyPluralInfo::setupCurrencyPluralPattern(const Locale& loc, UErrorCode& st
         numberStylePattern = ures_getStringByKeyWithFallback(rb.getAlias(), gDecimalFormatTag, &ptnLen, &ec);
     }
     int32_t numberStylePatternLen = ptnLen;
-    const UChar* negNumberStylePattern = nullptr;
+    const char16_t* negNumberStylePattern = nullptr;
     int32_t negNumberStylePatternLen = 0;
     // TODO: Java
     // parse to check whether there is ";" separator in the numberStylePattern
@@ -335,7 +335,7 @@ CurrencyPluralInfo::setupCurrencyPluralPattern(const Locale& loc, UErrorCode& st
         while (((pluralCount = keywords->next(nullptr, ec)) != nullptr) && U_SUCCESS(ec)) {
             int32_t ptnLength;
             UErrorCode err = U_ZERO_ERROR;
-            const UChar* patternChars = ures_getStringByKeyWithFallback(currencyRes.getAlias(), pluralCount, &ptnLength, &err);
+            const char16_t* patternChars = ures_getStringByKeyWithFallback(currencyRes.getAlias(), pluralCount, &ptnLength, &err);
             if (err == U_MEMORY_ALLOCATION_ERROR || patternChars == nullptr) {
                 ec = err;
                 break;
index 92bcf1268ac387830476371142dfa7f66a054ee2..98f28365cfc8217f95711e456507b6d46cd20bbc 100644 (file)
@@ -48,7 +48,7 @@ CurrencyUnit::CurrencyUnit(ConstChar16Ptr _isoCode, UErrorCode& ec) {
         isoCode[3] = 0;
     }
     if (useDefault) {
-        uprv_memcpy(isoCode, kDefaultCurrency, sizeof(UChar) * 4);
+        uprv_memcpy(isoCode, kDefaultCurrency, sizeof(char16_t) * 4);
     }
     char simpleIsoCode[4];
     u_UCharsToChars(isoCode, simpleIsoCode, 4);
index 87ab385d30dbc5624ed9c273ec4097188daf08aa..ac1f777399ad301f5c38985142e397b4bbc49bdc 100644 (file)
@@ -59,7 +59,7 @@ static const char gLatn[] =  "latn";
 static const char gSymbols[] = "symbols";
 static const char gNumberElementsLatnSymbols[] = "NumberElements/latn/symbols";
 
-static const UChar INTL_CURRENCY_SYMBOL_STR[] = {0xa4, 0xa4, 0};
+static const char16_t INTL_CURRENCY_SYMBOL_STR[] = {0xa4, 0xa4, 0};
 
 // List of field names to be loaded from the data files.
 // These are parallel with the enum ENumberFormatSymbol in unicode/dcfmtsym.h.
@@ -461,7 +461,7 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status,
 
     // Get the default currency from the currency API.
     UErrorCode internalStatus = U_ZERO_ERROR; // don't propagate failures out
-    UChar curriso[4];
+    char16_t curriso[4];
     UnicodeString tempStr;
     int32_t currisoLength = ucurr_forLocale(locStr, curriso, UPRV_LENGTHOF(curriso), &internalStatus);
     if (U_SUCCESS(internalStatus) && currisoLength == 3) {
@@ -485,34 +485,34 @@ DecimalFormatSymbols::initialize() {
      * cannot initialize a static array with class constructors.
      *  markus 2000may25
      */
-    fSymbols[kDecimalSeparatorSymbol] = (UChar)0x2e;    // '.' decimal separator
+    fSymbols[kDecimalSeparatorSymbol] = (char16_t)0x2e;    // '.' decimal separator
     fSymbols[kGroupingSeparatorSymbol].remove();        //     group (thousands) separator
-    fSymbols[kPatternSeparatorSymbol] = (UChar)0x3b;    // ';' pattern separator
-    fSymbols[kPercentSymbol] = (UChar)0x25;             // '%' percent sign
-    fSymbols[kZeroDigitSymbol] = (UChar)0x30;           // '0' native 0 digit
-    fSymbols[kOneDigitSymbol] = (UChar)0x31;            // '1' native 1 digit
-    fSymbols[kTwoDigitSymbol] = (UChar)0x32;            // '2' native 2 digit
-    fSymbols[kThreeDigitSymbol] = (UChar)0x33;          // '3' native 3 digit
-    fSymbols[kFourDigitSymbol] = (UChar)0x34;           // '4' native 4 digit
-    fSymbols[kFiveDigitSymbol] = (UChar)0x35;           // '5' native 5 digit
-    fSymbols[kSixDigitSymbol] = (UChar)0x36;            // '6' native 6 digit
-    fSymbols[kSevenDigitSymbol] = (UChar)0x37;          // '7' native 7 digit
-    fSymbols[kEightDigitSymbol] = (UChar)0x38;          // '8' native 8 digit
-    fSymbols[kNineDigitSymbol] = (UChar)0x39;           // '9' native 9 digit
-    fSymbols[kDigitSymbol] = (UChar)0x23;               // '#' pattern digit
-    fSymbols[kPlusSignSymbol] = (UChar)0x002b;          // '+' plus sign
-    fSymbols[kMinusSignSymbol] = (UChar)0x2d;           // '-' minus sign
-    fSymbols[kCurrencySymbol] = (UChar)0xa4;            // 'OX' currency symbol
+    fSymbols[kPatternSeparatorSymbol] = (char16_t)0x3b;    // ';' pattern separator
+    fSymbols[kPercentSymbol] = (char16_t)0x25;             // '%' percent sign
+    fSymbols[kZeroDigitSymbol] = (char16_t)0x30;           // '0' native 0 digit
+    fSymbols[kOneDigitSymbol] = (char16_t)0x31;            // '1' native 1 digit
+    fSymbols[kTwoDigitSymbol] = (char16_t)0x32;            // '2' native 2 digit
+    fSymbols[kThreeDigitSymbol] = (char16_t)0x33;          // '3' native 3 digit
+    fSymbols[kFourDigitSymbol] = (char16_t)0x34;           // '4' native 4 digit
+    fSymbols[kFiveDigitSymbol] = (char16_t)0x35;           // '5' native 5 digit
+    fSymbols[kSixDigitSymbol] = (char16_t)0x36;            // '6' native 6 digit
+    fSymbols[kSevenDigitSymbol] = (char16_t)0x37;          // '7' native 7 digit
+    fSymbols[kEightDigitSymbol] = (char16_t)0x38;          // '8' native 8 digit
+    fSymbols[kNineDigitSymbol] = (char16_t)0x39;           // '9' native 9 digit
+    fSymbols[kDigitSymbol] = (char16_t)0x23;               // '#' pattern digit
+    fSymbols[kPlusSignSymbol] = (char16_t)0x002b;          // '+' plus sign
+    fSymbols[kMinusSignSymbol] = (char16_t)0x2d;           // '-' minus sign
+    fSymbols[kCurrencySymbol] = (char16_t)0xa4;            // 'OX' currency symbol
     fSymbols[kIntlCurrencySymbol].setTo(true, INTL_CURRENCY_SYMBOL_STR, 2);
-    fSymbols[kMonetarySeparatorSymbol] = (UChar)0x2e;   // '.' monetary decimal separator
-    fSymbols[kExponentialSymbol] = (UChar)0x45;         // 'E' exponential
-    fSymbols[kPerMillSymbol] = (UChar)0x2030;           // '%o' per mill
-    fSymbols[kPadEscapeSymbol] = (UChar)0x2a;           // '*' pad escape symbol
-    fSymbols[kInfinitySymbol] = (UChar)0x221e;          // 'oo' infinite
-    fSymbols[kNaNSymbol] = (UChar)0xfffd;               // SUB NaN
-    fSymbols[kSignificantDigitSymbol] = (UChar)0x0040;  // '@' significant digit
+    fSymbols[kMonetarySeparatorSymbol] = (char16_t)0x2e;   // '.' monetary decimal separator
+    fSymbols[kExponentialSymbol] = (char16_t)0x45;         // 'E' exponential
+    fSymbols[kPerMillSymbol] = (char16_t)0x2030;           // '%o' per mill
+    fSymbols[kPadEscapeSymbol] = (char16_t)0x2a;           // '*' pad escape symbol
+    fSymbols[kInfinitySymbol] = (char16_t)0x221e;          // 'oo' infinite
+    fSymbols[kNaNSymbol] = (char16_t)0xfffd;               // SUB NaN
+    fSymbols[kSignificantDigitSymbol] = (char16_t)0x0040;  // '@' significant digit
     fSymbols[kMonetaryGroupingSeparatorSymbol].remove(); // 
-    fSymbols[kExponentMultiplicationSymbol] = (UChar)0xd7; // 'x' multiplication symbol for exponents
+    fSymbols[kExponentMultiplicationSymbol] = (char16_t)0xd7; // 'x' multiplication symbol for exponents
     fSymbols[kApproximatelySignSymbol] = u'~';          // '~' approximately sign
     fIsCustomCurrencySymbol = false; 
     fIsCustomIntlCurrencySymbol = false;
@@ -522,7 +522,7 @@ DecimalFormatSymbols::initialize() {
     nsName[0] = 0;
 }
 
-void DecimalFormatSymbols::setCurrency(const UChar* currency, UErrorCode& status) {
+void DecimalFormatSymbols::setCurrency(const char16_t* currency, UErrorCode& status) {
     // TODO: If this method is made public:
     // - Adopt ICU4J behavior of not allowing currency to be null.
     // - Also verify that the length of currency is 3.
index a4058c69244d0d82168b27005c079f4ec06594cf..a21b68ce1e2cf6c5a551917747d12523146826d4 100644 (file)
 #include "unicode/unistr.h"
 
 
-#define QUOTE             ((UChar)0x0027)
-#define LOW_LINE          ((UChar)0x005F)
-#define COLON             ((UChar)0x003A)
-#define LEFT_CURLY_BRACKET  ((UChar)0x007B)
-#define RIGHT_CURLY_BRACKET ((UChar)0x007D)
-#define SPACE             ((UChar)0x0020)
-#define EN_DASH           ((UChar)0x2013)
-#define SOLIDUS           ((UChar)0x002F)
-#define PERCENT           ((UChar)0x0025)
+#define QUOTE             ((char16_t)0x0027)
+#define LOW_LINE          ((char16_t)0x005F)
+#define COLON             ((char16_t)0x003A)
+#define LEFT_CURLY_BRACKET  ((char16_t)0x007B)
+#define RIGHT_CURLY_BRACKET ((char16_t)0x007D)
+#define SPACE             ((char16_t)0x0020)
+#define EN_DASH           ((char16_t)0x2013)
+#define SOLIDUS           ((char16_t)0x002F)
+#define PERCENT           ((char16_t)0x0025)
 
-#define DIGIT_ZERO        ((UChar)0x0030)
-#define DIGIT_ONE         ((UChar)0x0031)
+#define DIGIT_ZERO        ((char16_t)0x0030)
+#define DIGIT_ONE         ((char16_t)0x0031)
 
-#define LOW_A             ((UChar)0x0061)
-#define LOW_B             ((UChar)0x0062)
-#define LOW_C             ((UChar)0x0063)
-#define LOW_D             ((UChar)0x0064)
-#define LOW_E             ((UChar)0x0065)
-#define LOW_F             ((UChar)0x0066)
-#define LOW_G             ((UChar)0x0067)
-#define LOW_H             ((UChar)0x0068)
-#define LOW_I             ((UChar)0x0069)
-#define LOW_J             ((UChar)0x006a)
-#define LOW_K             ((UChar)0x006B)
-#define LOW_L             ((UChar)0x006C)
-#define LOW_M             ((UChar)0x006D)
-#define LOW_N             ((UChar)0x006E)
-#define LOW_O             ((UChar)0x006F)
-#define LOW_P             ((UChar)0x0070)
-#define LOW_Q             ((UChar)0x0071)
-#define LOW_R             ((UChar)0x0072)
-#define LOW_S             ((UChar)0x0073)
-#define LOW_T             ((UChar)0x0074)
-#define LOW_U             ((UChar)0x0075)
-#define LOW_V             ((UChar)0x0076)
-#define LOW_W             ((UChar)0x0077)
-#define LOW_Y             ((UChar)0x0079)
-#define LOW_Z             ((UChar)0x007A)
+#define LOW_A             ((char16_t)0x0061)
+#define LOW_B             ((char16_t)0x0062)
+#define LOW_C             ((char16_t)0x0063)
+#define LOW_D             ((char16_t)0x0064)
+#define LOW_E             ((char16_t)0x0065)
+#define LOW_F             ((char16_t)0x0066)
+#define LOW_G             ((char16_t)0x0067)
+#define LOW_H             ((char16_t)0x0068)
+#define LOW_I             ((char16_t)0x0069)
+#define LOW_J             ((char16_t)0x006a)
+#define LOW_K             ((char16_t)0x006B)
+#define LOW_L             ((char16_t)0x006C)
+#define LOW_M             ((char16_t)0x006D)
+#define LOW_N             ((char16_t)0x006E)
+#define LOW_O             ((char16_t)0x006F)
+#define LOW_P             ((char16_t)0x0070)
+#define LOW_Q             ((char16_t)0x0071)
+#define LOW_R             ((char16_t)0x0072)
+#define LOW_S             ((char16_t)0x0073)
+#define LOW_T             ((char16_t)0x0074)
+#define LOW_U             ((char16_t)0x0075)
+#define LOW_V             ((char16_t)0x0076)
+#define LOW_W             ((char16_t)0x0077)
+#define LOW_Y             ((char16_t)0x0079)
+#define LOW_Z             ((char16_t)0x007A)
 
-#define CAP_A             ((UChar)0x0041)
-#define CAP_C             ((UChar)0x0043)
-#define CAP_D             ((UChar)0x0044)
-#define CAP_E             ((UChar)0x0045)
-#define CAP_F             ((UChar)0x0046)
-#define CAP_G             ((UChar)0x0047)
-#define CAP_H             ((UChar)0x0048)
-#define CAP_K             ((UChar)0x004B)
-#define CAP_L             ((UChar)0x004C)
-#define CAP_M             ((UChar)0x004D)
-#define CAP_N             ((UChar)0x004E)
-#define CAP_O             ((UChar)0x004F)
-#define CAP_P             ((UChar)0x0050)
-#define CAP_Q             ((UChar)0x0051)
-#define CAP_S             ((UChar)0x0053)
-#define CAP_T             ((UChar)0x0054)
-#define CAP_U             ((UChar)0x0055)
-#define CAP_V             ((UChar)0x0056)
-#define CAP_W             ((UChar)0x0057)
-#define CAP_Y             ((UChar)0x0059)
-#define CAP_Z             ((UChar)0x005A)
+#define CAP_A             ((char16_t)0x0041)
+#define CAP_C             ((char16_t)0x0043)
+#define CAP_D             ((char16_t)0x0044)
+#define CAP_E             ((char16_t)0x0045)
+#define CAP_F             ((char16_t)0x0046)
+#define CAP_G             ((char16_t)0x0047)
+#define CAP_H             ((char16_t)0x0048)
+#define CAP_K             ((char16_t)0x004B)
+#define CAP_L             ((char16_t)0x004C)
+#define CAP_M             ((char16_t)0x004D)
+#define CAP_N             ((char16_t)0x004E)
+#define CAP_O             ((char16_t)0x004F)
+#define CAP_P             ((char16_t)0x0050)
+#define CAP_Q             ((char16_t)0x0051)
+#define CAP_S             ((char16_t)0x0053)
+#define CAP_T             ((char16_t)0x0054)
+#define CAP_U             ((char16_t)0x0055)
+#define CAP_V             ((char16_t)0x0056)
+#define CAP_W             ((char16_t)0x0057)
+#define CAP_Y             ((char16_t)0x0059)
+#define CAP_Z             ((char16_t)0x005A)
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 
index f79288530646a92cf05b27ab32596ecdf89c4f0b..b652c3eeda59236f5f33cf6d3a0dc16186d5a452 100644 (file)
@@ -70,7 +70,7 @@
  * Unlocalized date-time pattern characters. For example: 'y', 'd', etc. All
  * locales use the same these unlocalized pattern characters.
  */
-static const UChar gPatternChars[] = {
+static const char16_t gPatternChars[] = {
     // if UDAT_HAS_PATTERN_CHAR_FOR_TIME_SEPARATOR:
     //   GyMdkHmsSEDFwWahKzYeugAZvcLQqVUOXxrbB:
     // else:
@@ -91,7 +91,7 @@ static const UChar gPatternChars[] = {
 // files.  They aren't designed for actual use, just for backup.
 
 // These are the month names and abbreviations of last resort.
-static const UChar gLastResortMonthNames[13][3] =
+static const char16_t gLastResortMonthNames[13][3] =
 {
     {0x0030, 0x0031, 0x0000}, /* "01" */
     {0x0030, 0x0032, 0x0000}, /* "02" */
@@ -109,7 +109,7 @@ static const UChar gLastResortMonthNames[13][3] =
 };
 
 // These are the weekday names and abbreviations of last resort.
-static const UChar gLastResortDayNames[8][2] =
+static const char16_t gLastResortDayNames[8][2] =
 {
     {0x0030, 0x0000}, /* "0" */
     {0x0031, 0x0000}, /* "1" */
@@ -122,7 +122,7 @@ static const UChar gLastResortDayNames[8][2] =
 };
 
 // These are the quarter names and abbreviations of last resort.
-static const UChar gLastResortQuarters[4][2] =
+static const char16_t gLastResortQuarters[4][2] =
 {
     {0x0031, 0x0000}, /* "1" */
     {0x0032, 0x0000}, /* "2" */
@@ -131,13 +131,13 @@ static const UChar gLastResortQuarters[4][2] =
 };
 
 // These are the am/pm and BC/AD markers of last resort.
-static const UChar gLastResortAmPmMarkers[2][3] =
+static const char16_t gLastResortAmPmMarkers[2][3] =
 {
     {0x0041, 0x004D, 0x0000}, /* "AM" */
     {0x0050, 0x004D, 0x0000}  /* "PM" */
 };
 
-static const UChar gLastResortEras[2][3] =
+static const char16_t gLastResortEras[2][3] =
 {
     {0x0042, 0x0043, 0x0000}, /* "BC" */
     {0x0041, 0x0044, 0x0000}  /* "AD" */
@@ -1382,8 +1382,8 @@ DateFormatSymbols::getPatternUChars(void)
 }
 
 UDateFormatField U_EXPORT2
-DateFormatSymbols::getPatternCharIndex(UChar c) {
-    const UChar *p = u_strchr(gPatternChars, c);
+DateFormatSymbols::getPatternCharIndex(char16_t c) {
+    const char16_t *p = u_strchr(gPatternChars, c);
     if (p == nullptr) {
         return UDAT_FIELD_COUNT;
     } else {
@@ -1429,7 +1429,7 @@ DateFormatSymbols::isNumericField(UDateFormatField f, int32_t count) {
 }
 
 UBool U_EXPORT2
-DateFormatSymbols::isNumericPatternChar(UChar c, int32_t count) {
+DateFormatSymbols::isNumericPatternChar(char16_t c, int32_t count) {
     return isNumericField(getPatternCharIndex(c), count);
 }
 
@@ -1455,35 +1455,35 @@ DateFormatSymbols::setLocalPatternChars(const UnicodeString& newLocalPatternChar
 namespace {
 
 // Constants declarations
-static const UChar kCalendarAliasPrefixUChar[] = {
+static const char16_t kCalendarAliasPrefixUChar[] = {
     SOLIDUS, CAP_L, CAP_O, CAP_C, CAP_A, CAP_L, CAP_E, SOLIDUS,
     LOW_C, LOW_A, LOW_L, LOW_E, LOW_N, LOW_D, LOW_A, LOW_R, SOLIDUS
 };
-static const UChar kGregorianTagUChar[] = {
+static const char16_t kGregorianTagUChar[] = {
     LOW_G, LOW_R, LOW_E, LOW_G, LOW_O, LOW_R, LOW_I, LOW_A, LOW_N
 };
-static const UChar kVariantTagUChar[] = {
+static const char16_t kVariantTagUChar[] = {
     PERCENT, LOW_V, LOW_A, LOW_R, LOW_I, LOW_A, LOW_N, LOW_T
 };
-static const UChar kLeapTagUChar[] = {
+static const char16_t kLeapTagUChar[] = {
     LOW_L, LOW_E, LOW_A, LOW_P
 };
-static const UChar kCyclicNameSetsTagUChar[] = {
+static const char16_t kCyclicNameSetsTagUChar[] = {
     LOW_C, LOW_Y, LOW_C, LOW_L, LOW_I, LOW_C, CAP_N, LOW_A, LOW_M, LOW_E, CAP_S, LOW_E, LOW_T, LOW_S
 };
-static const UChar kYearsTagUChar[] = {
+static const char16_t kYearsTagUChar[] = {
     SOLIDUS, LOW_Y, LOW_E, LOW_A, LOW_R, LOW_S
 };
-static const UChar kZodiacsUChar[] = {
+static const char16_t kZodiacsUChar[] = {
     SOLIDUS, LOW_Z, LOW_O, LOW_D, LOW_I, LOW_A, LOW_C, LOW_S
 };
-static const UChar kDayPartsTagUChar[] = {
+static const char16_t kDayPartsTagUChar[] = {
     SOLIDUS, LOW_D, LOW_A, LOW_Y, CAP_P, LOW_A, LOW_R, LOW_T, LOW_S
 };
-static const UChar kFormatTagUChar[] = {
+static const char16_t kFormatTagUChar[] = {
     SOLIDUS, LOW_F, LOW_O, LOW_R, LOW_M, LOW_A, LOW_T
 };
-static const UChar kAbbrTagUChar[] = {
+static const char16_t kAbbrTagUChar[] = {
     SOLIDUS, LOW_A, LOW_B, LOW_B, LOW_R, LOW_E, LOW_V, LOW_I, LOW_A, LOW_T, LOW_E, LOW_D
 };
 
@@ -1701,7 +1701,7 @@ struct CalendarDataSink : public ResourceSink {
                 }
                 U_ASSERT(stringMap != nullptr);
                 int32_t valueStringSize;
-                const UChar *valueString = value.getString(valueStringSize, errorCode);
+                const char16_t *valueString = value.getString(valueStringSize, errorCode);
                 if (U_FAILURE(errorCode)) { return; }
                 LocalPointer<UnicodeString> valueUString(new UnicodeString(true, valueString, valueStringSize), errorCode);
                 stringMap->put(keyUString, valueUString.orphan(), errorCode);
@@ -1795,7 +1795,7 @@ struct CalendarDataSink : public ResourceSink {
 
         if (value.getType() == URES_ALIAS) {
             int32_t aliasPathSize;
-            const UChar* aliasPathUChar = value.getAliasString(aliasPathSize, errorCode);
+            const char16_t* aliasPathUChar = value.getAliasString(aliasPathSize, errorCode);
             if (U_FAILURE(errorCode)) { return NONE; }
             UnicodeString aliasPath(aliasPathUChar, aliasPathSize);
             const int32_t aliasPrefixLength = UPRV_LENGTHOF(kCalendarAliasPrefixUChar);
@@ -1846,7 +1846,7 @@ CalendarDataSink::~CalendarDataSink() {
 //------------------------------------------------------
 
 static void
-initField(UnicodeString **field, int32_t& length, const UChar *data, LastResortSize numStr, LastResortSize strLen, UErrorCode &status) {
+initField(UnicodeString **field, int32_t& length, const char16_t *data, LastResortSize numStr, LastResortSize strLen, UErrorCode &status) {
     if (U_SUCCESS(status)) {
         length = numStr;
         *field = newUnicodeStringArray((size_t)numStr);
@@ -2501,31 +2501,31 @@ DateFormatSymbols::initializeData(const Locale& locale, const char *type, UError
 
             status = U_USING_FALLBACK_WARNING;
             //TODO(fabalbon): make sure we are storing las resort data for all fields in here.
-            initField(&fEras, fErasCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
-            initField(&fEraNames, fEraNamesCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
-            initField(&fNarrowEras, fNarrowErasCount, (const UChar *)gLastResortEras, kEraNum, kEraLen, status);
-            initField(&fMonths, fMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
-            initField(&fShortMonths, fShortMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fNarrowMonths, fNarrowMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fStandaloneMonths, fStandaloneMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
-            initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, (const UChar *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
-            initField(&fWeekdays, fWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fShortWeekdays, fShortWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fShorterWeekdays, fShorterWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fNarrowWeekdays, fNarrowWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneWeekdays, fStandaloneWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, (const UChar *)gLastResortDayNames, kDayNum, kDayLen, status);
-            initField(&fAmPms, fAmPmsCount, (const UChar *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
-            initField(&fNarrowAmPms, fNarrowAmPmsCount, (const UChar *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
-            initField(&fQuarters, fQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fShortQuarters, fShortQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fNarrowQuarters, fNarrowQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fStandaloneQuarters, fStandaloneQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
-            initField(&fStandaloneNarrowQuarters, fStandaloneNarrowQuartersCount, (const UChar *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fEras, fErasCount, (const char16_t *)gLastResortEras, kEraNum, kEraLen, status);
+            initField(&fEraNames, fEraNamesCount, (const char16_t *)gLastResortEras, kEraNum, kEraLen, status);
+            initField(&fNarrowEras, fNarrowErasCount, (const char16_t *)gLastResortEras, kEraNum, kEraLen, status);
+            initField(&fMonths, fMonthsCount, (const char16_t *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
+            initField(&fShortMonths, fShortMonthsCount, (const char16_t *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fNarrowMonths, fNarrowMonthsCount, (const char16_t *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fStandaloneMonths, fStandaloneMonthsCount, (const char16_t *)gLastResortMonthNames, kMonthNum, kMonthLen,  status);
+            initField(&fStandaloneShortMonths, fStandaloneShortMonthsCount, (const char16_t *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fStandaloneNarrowMonths, fStandaloneNarrowMonthsCount, (const char16_t *)gLastResortMonthNames, kMonthNum, kMonthLen, status);
+            initField(&fWeekdays, fWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fShortWeekdays, fShortWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fShorterWeekdays, fShorterWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fNarrowWeekdays, fNarrowWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneWeekdays, fStandaloneWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneShortWeekdays, fStandaloneShortWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneShorterWeekdays, fStandaloneShorterWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fStandaloneNarrowWeekdays, fStandaloneNarrowWeekdaysCount, (const char16_t *)gLastResortDayNames, kDayNum, kDayLen, status);
+            initField(&fAmPms, fAmPmsCount, (const char16_t *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
+            initField(&fNarrowAmPms, fNarrowAmPmsCount, (const char16_t *)gLastResortAmPmMarkers, kAmPmNum, kAmPmLen, status);
+            initField(&fQuarters, fQuartersCount, (const char16_t *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fShortQuarters, fShortQuartersCount, (const char16_t *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fNarrowQuarters, fNarrowQuartersCount, (const char16_t *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fStandaloneQuarters, fStandaloneQuartersCount, (const char16_t *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fStandaloneShortQuarters, fStandaloneShortQuartersCount, (const char16_t *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
+            initField(&fStandaloneNarrowQuarters, fStandaloneNarrowQuartersCount, (const char16_t *)gLastResortQuarters, kQuarterNum, kQuarterLen, status);
             fLocalPatternChars.setTo(true, gPatternChars, PATTERN_CHARS_LEN);
         }
     }
index 6fc16bb3e08d3c6bc91cf4b4514a857c616be1dd..2cc7764817998dedfd28bf50895549a236314a34 100644 (file)
 #include "unicode/unistr.h"
 
 
-#define QUOTE             ((UChar)0x0027)
-#define LOW_LINE          ((UChar)0x005F)
-#define COLON             ((UChar)0x003A)
-#define LEFT_CURLY_BRACKET  ((UChar)0x007B)
-#define RIGHT_CURLY_BRACKET ((UChar)0x007D)
-#define SPACE             ((UChar)0x0020)
-#define EN_DASH           ((UChar)0x2013)
-#define SOLIDUS           ((UChar)0x002F)
+#define QUOTE             ((char16_t)0x0027)
+#define LOW_LINE          ((char16_t)0x005F)
+#define COLON             ((char16_t)0x003A)
+#define LEFT_CURLY_BRACKET  ((char16_t)0x007B)
+#define RIGHT_CURLY_BRACKET ((char16_t)0x007D)
+#define SPACE             ((char16_t)0x0020)
+#define EN_DASH           ((char16_t)0x2013)
+#define SOLIDUS           ((char16_t)0x002F)
 
-#define DIGIT_ZERO        ((UChar)0x0030)
-#define DIGIT_ONE         ((UChar)0x0031)
+#define DIGIT_ZERO        ((char16_t)0x0030)
+#define DIGIT_ONE         ((char16_t)0x0031)
 
-#define LOW_A             ((UChar)0x0061)
-#define LOW_B             ((UChar)0x0062)
-#define LOW_C             ((UChar)0x0063)
-#define LOW_D             ((UChar)0x0064)
-#define LOW_E             ((UChar)0x0065)
-#define LOW_F             ((UChar)0x0066)
-#define LOW_G             ((UChar)0x0067)
-#define LOW_H             ((UChar)0x0068)
-#define LOW_I             ((UChar)0x0069)
-#define LOW_J             ((UChar)0x006a)
-#define LOW_K             ((UChar)0x006B)
-#define LOW_L             ((UChar)0x006C)
-#define LOW_M             ((UChar)0x006D)
-#define LOW_N             ((UChar)0x006E)
-#define LOW_O             ((UChar)0x006F)
-#define LOW_P             ((UChar)0x0070)
-#define LOW_Q             ((UChar)0x0071)
-#define LOW_R             ((UChar)0x0072)
-#define LOW_S             ((UChar)0x0073)
-#define LOW_T             ((UChar)0x0074)
-#define LOW_U             ((UChar)0x0075)
-#define LOW_V             ((UChar)0x0076)
-#define LOW_W             ((UChar)0x0077)
-#define LOW_Y             ((UChar)0x0079)
-#define LOW_Z             ((UChar)0x007A)
+#define LOW_A             ((char16_t)0x0061)
+#define LOW_B             ((char16_t)0x0062)
+#define LOW_C             ((char16_t)0x0063)
+#define LOW_D             ((char16_t)0x0064)
+#define LOW_E             ((char16_t)0x0065)
+#define LOW_F             ((char16_t)0x0066)
+#define LOW_G             ((char16_t)0x0067)
+#define LOW_H             ((char16_t)0x0068)
+#define LOW_I             ((char16_t)0x0069)
+#define LOW_J             ((char16_t)0x006a)
+#define LOW_K             ((char16_t)0x006B)
+#define LOW_L             ((char16_t)0x006C)
+#define LOW_M             ((char16_t)0x006D)
+#define LOW_N             ((char16_t)0x006E)
+#define LOW_O             ((char16_t)0x006F)
+#define LOW_P             ((char16_t)0x0070)
+#define LOW_Q             ((char16_t)0x0071)
+#define LOW_R             ((char16_t)0x0072)
+#define LOW_S             ((char16_t)0x0073)
+#define LOW_T             ((char16_t)0x0074)
+#define LOW_U             ((char16_t)0x0075)
+#define LOW_V             ((char16_t)0x0076)
+#define LOW_W             ((char16_t)0x0077)
+#define LOW_Y             ((char16_t)0x0079)
+#define LOW_Z             ((char16_t)0x007A)
 
-#define CAP_A             ((UChar)0x0041)
-#define CAP_B             ((UChar)0x0042)
-#define CAP_C             ((UChar)0x0043)
-#define CAP_D             ((UChar)0x0044)
-#define CAP_E             ((UChar)0x0045)
-#define CAP_F             ((UChar)0x0046)
-#define CAP_G             ((UChar)0x0047)
-#define CAP_J             ((UChar)0x004A)
-#define CAP_H             ((UChar)0x0048)
-#define CAP_K             ((UChar)0x004B)
-#define CAP_L             ((UChar)0x004C)
-#define CAP_M             ((UChar)0x004D)
-#define CAP_O             ((UChar)0x004F)
-#define CAP_Q             ((UChar)0x0051)
-#define CAP_S             ((UChar)0x0053)
-#define CAP_T             ((UChar)0x0054)
-#define CAP_U             ((UChar)0x0055)
-#define CAP_V             ((UChar)0x0056)
-#define CAP_W             ((UChar)0x0057)
-#define CAP_Y             ((UChar)0x0059)
-#define CAP_Z             ((UChar)0x005A)
+#define CAP_A             ((char16_t)0x0041)
+#define CAP_B             ((char16_t)0x0042)
+#define CAP_C             ((char16_t)0x0043)
+#define CAP_D             ((char16_t)0x0044)
+#define CAP_E             ((char16_t)0x0045)
+#define CAP_F             ((char16_t)0x0046)
+#define CAP_G             ((char16_t)0x0047)
+#define CAP_J             ((char16_t)0x004A)
+#define CAP_H             ((char16_t)0x0048)
+#define CAP_K             ((char16_t)0x004B)
+#define CAP_L             ((char16_t)0x004C)
+#define CAP_M             ((char16_t)0x004D)
+#define CAP_O             ((char16_t)0x004F)
+#define CAP_Q             ((char16_t)0x0051)
+#define CAP_S             ((char16_t)0x0053)
+#define CAP_T             ((char16_t)0x0054)
+#define CAP_U             ((char16_t)0x0055)
+#define CAP_V             ((char16_t)0x0056)
+#define CAP_W             ((char16_t)0x0057)
+#define CAP_Y             ((char16_t)0x0059)
+#define CAP_Z             ((char16_t)0x005A)
 
 //#define MINIMUM_SUPPORTED_CALENDAR_FIELD    UCAL_MINUTE
 
index c792b53c12d5e1bb5f76fd950b5d067137fb56d0..608701466819f45833179836f254e05719cc8596 100644 (file)
@@ -44,7 +44,7 @@ U_NAMESPACE_BEGIN
 #endif
 
 
-static const UChar gDateFormatSkeleton[][11] = {
+static const char16_t gDateFormatSkeleton[][11] = {
 //yMMMMEEEEd
 {LOW_Y, CAP_M, CAP_M, CAP_M, CAP_M, CAP_E, CAP_E, CAP_E, CAP_E, LOW_D, 0},
 //yMMMMd
@@ -61,10 +61,10 @@ static const char gDateTimePatternsTag[] = "DateTimePatterns";
 
 
 // latestFirst:
-static const UChar gLaterFirstPrefix[] = {LOW_L, LOW_A, LOW_T, LOW_E, LOW_S,LOW_T, CAP_F, LOW_I, LOW_R, LOW_S, LOW_T, COLON};
+static const char16_t gLaterFirstPrefix[] = {LOW_L, LOW_A, LOW_T, LOW_E, LOW_S,LOW_T, CAP_F, LOW_I, LOW_R, LOW_S, LOW_T, COLON};
 
 // earliestFirst:
-static const UChar gEarlierFirstPrefix[] = {LOW_E, LOW_A, LOW_R, LOW_L, LOW_I, LOW_E, LOW_S, LOW_T, CAP_F, LOW_I, LOW_R, LOW_S, LOW_T, COLON};
+static const char16_t gEarlierFirstPrefix[] = {LOW_E, LOW_A, LOW_R, LOW_L, LOW_I, LOW_E, LOW_S, LOW_T, CAP_F, LOW_I, LOW_R, LOW_S, LOW_T, COLON};
 
 
 class FormattedDateIntervalData : public FormattedValueFieldPositionIteratorImpl {
@@ -827,7 +827,7 @@ DateIntervalFormat::initializePattern(UErrorCode& status) {
                                   dateTimePatternsRes.getAlias(), &status);
 
         int32_t dateTimeFormatLength;
-        const UChar* dateTimeFormat = ures_getStringByIndex(
+        const char16_t* dateTimeFormat = ures_getStringByIndex(
                                             dateTimePatternsRes.getAlias(),
                                             (int32_t)DateFormat::kDateTime,
                                             &dateTimeFormatLength, &status);
@@ -964,14 +964,14 @@ UnicodeString
 DateIntervalFormat::normalizeHourMetacharacters(const UnicodeString& skeleton) const {
     UnicodeString result = skeleton;
     
-    UChar hourMetachar = u'\0';
-    UChar dayPeriodChar = u'\0';
+    char16_t hourMetachar = u'\0';
+    char16_t dayPeriodChar = u'\0';
     int32_t hourFieldStart = 0;
     int32_t hourFieldLength = 0;
     int32_t dayPeriodStart = 0;
     int32_t dayPeriodLength = 0;
     for (int32_t i = 0; i < result.length(); i++) {
-        UChar c = result[i];
+        char16_t c = result[i];
         if (c == LOW_J || c == CAP_J || c == CAP_C || c == LOW_H || c == CAP_H || c == LOW_K || c == CAP_K) {
             if (hourMetachar == u'\0') {
                 hourMetachar = c;
@@ -993,7 +993,7 @@ DateIntervalFormat::normalizeHourMetacharacters(const UnicodeString& skeleton) c
     
     if (hourMetachar != u'\0') {
         UErrorCode err = U_ZERO_ERROR;
-        UChar hourChar = CAP_H;
+        char16_t hourChar = CAP_H;
         UnicodeString convertedPattern = DateFormat::getBestPattern(fLocale, UnicodeString(hourMetachar), err);
 
         if (U_SUCCESS(err)) {
@@ -1066,11 +1066,11 @@ DateIntervalFormat::getDateTimeSkeleton(const UnicodeString& skeleton,
     int32_t mCount = 0;
     int32_t vCount = 0;
     int32_t zCount = 0;
-    UChar hourChar = u'\0';
+    char16_t hourChar = u'\0';
     int32_t i;
 
     for (i = 0; i < skeleton.length(); ++i) {
-        UChar ch = skeleton[i];
+        char16_t ch = skeleton[i];
         switch ( ch ) {
           case CAP_E:
             dateSkeleton.append(ch);
@@ -1463,7 +1463,7 @@ DateIntervalFormat::setIntervalPattern(UCalendarDateFields field,
         // need to look for it from skeleton 'yMMMd',
         // if found, adjust field width in interval pattern from
         // "MMM" to "MMMM".
-        UChar fieldLetter = fgCalendarFieldToPatternLetter[field];
+        char16_t fieldLetter = fgCalendarFieldToPatternLetter[field];
         if ( extendedSkeleton ) {
             *extendedSkeleton = *skeleton;
             *extendedBestSkeleton = *bestSkeleton;
@@ -1506,7 +1506,7 @@ DateIntervalFormat::setIntervalPattern(UCalendarDateFields field,
 int32_t  U_EXPORT2
 DateIntervalFormat::splitPatternInto2Part(const UnicodeString& intervalPattern) {
     UBool inQuote = false;
-    UChar prevCh = 0;
+    char16_t prevCh = 0;
     int32_t count = 0;
 
     /* repeatedPattern used to record whether a pattern has already seen.
@@ -1534,7 +1534,7 @@ DateIntervalFormat::splitPatternInto2Part(const UnicodeString& intervalPattern)
     int32_t i;
     UBool foundRepetition = false;
     for (i = 0; i < intervalPattern.length(); ++i) {
-        UChar ch = intervalPattern.charAt(i);
+        char16_t ch = intervalPattern.charAt(i);
 
         if (ch != prevCh && count > 0) {
             // check the repeativeness of pattern letter
@@ -1682,7 +1682,7 @@ UBool  U_EXPORT2
 DateIntervalFormat::fieldExistsInSkeleton(UCalendarDateFields field,
                                           const UnicodeString& skeleton)
 {
-    const UChar fieldChar = fgCalendarFieldToPatternLetter[field];
+    const char16_t fieldChar = fgCalendarFieldToPatternLetter[field];
     return ( (skeleton.indexOf(fieldChar) == -1)?false:true ) ;
 }
 
@@ -1757,17 +1757,17 @@ DateIntervalFormat::adjustFieldWidth(const UnicodeString& inputSkeleton,
      }
 
     UBool inQuote = false;
-    UChar prevCh = 0;
+    char16_t prevCh = 0;
     int32_t count = 0;
 
     // loop through the pattern string character by character
     int32_t adjustedPtnLength = adjustedPtn.length();
     int32_t i;
     for (i = 0; i < adjustedPtnLength; ++i) {
-        UChar ch = adjustedPtn.charAt(i);
+        char16_t ch = adjustedPtn.charAt(i);
         if (ch != prevCh && count > 0) {
             // check the repeativeness of pattern letter
-            UChar skeletonChar = prevCh;
+            char16_t skeletonChar = prevCh;
             if ( skeletonChar ==  CAP_L ) {
                 // there is no "L" (always be "M") in skeleton,
                 // but there is "L" in pattern.
@@ -1806,7 +1806,7 @@ DateIntervalFormat::adjustFieldWidth(const UnicodeString& inputSkeleton,
     if ( count > 0 ) {
         // last item
         // check the repeativeness of pattern letter
-        UChar skeletonChar = prevCh;
+        char16_t skeletonChar = prevCh;
         if ( skeletonChar == CAP_L ) {
             // there is no "L" (always be "M") in skeleton,
             // but there is "L" in pattern.
@@ -1889,7 +1889,7 @@ DateIntervalFormat::concatSingleDate2TimeInterval(UnicodeString& format,
 
 
 
-const UChar
+const char16_t
 DateIntervalFormat::fgCalendarFieldToPatternLetter[] =
 {
     /*GyM*/ CAP_G, LOW_Y, CAP_M,
index 09ce68fe7100ed39d82eb2be2e6262e59cdc0bc8..3733d04518d2b20e424d362f2ed97bf788757456 100644 (file)
@@ -55,12 +55,12 @@ static const char gIntervalDateTimePatternTag[]="intervalFormats";
 static const char gFallbackPatternTag[]="fallback";
 
 // {0}
-static const UChar gFirstPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET};
+static const char16_t gFirstPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET};
 // {1}
-static const UChar gSecondPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET};
+static const char16_t gSecondPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET};
 
 // default fall-back
-static const UChar gDefaultFallbackPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, EN_DASH, SPACE, LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET, 0};
+static const char16_t gDefaultFallbackPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, EN_DASH, SPACE, LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET, 0};
 
 DateIntervalInfo::DateIntervalInfo(UErrorCode& status)
 :   fFallbackIntervalPattern(gDefaultFallbackPattern),
@@ -218,10 +218,10 @@ DateIntervalInfo::getFallbackIntervalPattern(UnicodeString& result) const {
 
 
 static const int32_t PATH_PREFIX_LENGTH = 17;
-static const UChar PATH_PREFIX[] = {SOLIDUS, CAP_L, CAP_O, CAP_C, CAP_A, CAP_L, CAP_E, SOLIDUS,
+static const char16_t PATH_PREFIX[] = {SOLIDUS, CAP_L, CAP_O, CAP_C, CAP_A, CAP_L, CAP_E, SOLIDUS,
                                     LOW_C, LOW_A, LOW_L, LOW_E, LOW_N, LOW_D, LOW_A, LOW_R, SOLIDUS};
 static const int32_t PATH_SUFFIX_LENGTH = 16;
-static const UChar PATH_SUFFIX[] = {SOLIDUS, LOW_I, LOW_N, LOW_T, LOW_E, LOW_R, LOW_V, LOW_A,
+static const char16_t PATH_SUFFIX[] = {SOLIDUS, LOW_I, LOW_N, LOW_T, LOW_E, LOW_R, LOW_V, LOW_A,
                                     LOW_L, CAP_F, LOW_O, LOW_R, LOW_M, LOW_A, LOW_T, LOW_S};
 
 /**
@@ -424,7 +424,7 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& status)
         UResourceBundle *calTypeBundle, *itvDtPtnResource;
 
         // Get the fallback pattern
-        const UChar* resStr = nullptr;
+        const char16_t* resStr = nullptr;
         int32_t resStrLen = 0;
         calTypeBundle = ures_getByKeyWithFallback(calBundle, calendarTypeToUse, nullptr, &status);
         itvDtPtnResource = ures_getByKeyWithFallback(calTypeBundle,
index f8c051fdeb30edd436e68ebc3d6b42c5f4d64f86..6d89acf99689c9a1a008e101f9997597b85cd63d 100644 (file)
@@ -58,7 +58,7 @@
 #include "uarrsort.h"
 
 struct UResAEntry {
-    UChar *key;
+    char16_t *key;
     UResourceBundle *item;
 };
 
@@ -97,7 +97,7 @@ static void ures_a_open(UResourceBundleAIterator *aiter, UResourceBundle *bund,
         aiter->entries[i].item = ures_getByIndex(aiter->bund, i, nullptr, status);
         const char *akey = ures_getKey(aiter->entries[i].item);
         int32_t len = uprv_strlen(akey)+1;
-        aiter->entries[i].key = (UChar*)uprv_malloc(len*sizeof(UChar));
+        aiter->entries[i].key = (char16_t*)uprv_malloc(len*sizeof(char16_t));
         u_charsToUChars(akey, aiter->entries[i].key, len);
     }
     uprv_sortArray(aiter->entries, aiter->num, sizeof(UResAEntry), ures_a_codepointSort, nullptr, true, status);
@@ -113,13 +113,13 @@ static void ures_a_close(UResourceBundleAIterator *aiter) {
 #endif
 }
 
-static const UChar *ures_a_getNextString(UResourceBundleAIterator *aiter, int32_t *len, const char **key, UErrorCode *err) {
+static const char16_t *ures_a_getNextString(UResourceBundleAIterator *aiter, int32_t *len, const char **key, UErrorCode *err) {
 #if !defined(U_SORT_ASCII_BUNDLE_ITERATOR)
     return ures_getNextString(aiter->bund, len, key, err);
 #else
     if(U_FAILURE(*err)) return nullptr;
     UResourceBundle *item = aiter->entries[aiter->cursor].item;
-    const UChar* ret = ures_getString(item, len, err);
+    const char16_t* ret = ures_getString(item, len, err);
     *key = ures_getKey(item);
     aiter->cursor++;
     return ret;
@@ -135,7 +135,7 @@ U_NAMESPACE_BEGIN
 // *****************************************************************************
 // class DateTimePatternGenerator
 // *****************************************************************************
-static const UChar Canonical_Items[] = {
+static const char16_t Canonical_Items[] = {
     // GyQMwWEDFdaHmsSv
     CAP_G, LOW_Y, CAP_Q, CAP_M, LOW_W, CAP_W, CAP_E,
     CAP_D, CAP_F, LOW_D, LOW_A, // The UDATPG_x_FIELD constants and these fields have a different order than in ICU4J
@@ -277,10 +277,10 @@ static constexpr UDateTimePGDisplayWidth UDATPG_WIDTH_APPENDITEM = UDATPG_WIDE;
 static constexpr int32_t UDATPG_FIELD_KEY_MAX = 24; // max length of CLDR field tag (type + width)
 
 // For appendItems
-static const UChar UDATPG_ItemFormat[]= {0x7B, 0x30, 0x7D, 0x20, 0x251C, 0x7B, 0x32, 0x7D, 0x3A,
+static const char16_t UDATPG_ItemFormat[]= {0x7B, 0x30, 0x7D, 0x20, 0x251C, 0x7B, 0x32, 0x7D, 0x3A,
     0x20, 0x7B, 0x31, 0x7D, 0x2524, 0};  // {0} \u251C{2}: {1}\u2524
 
-//static const UChar repeatedPatterns[6]={CAP_G, CAP_E, LOW_Z, LOW_V, CAP_Q, 0}; // "GEzvQ"
+//static const char16_t repeatedPatterns[6]={CAP_G, CAP_E, LOW_Z, LOW_V, CAP_Q, 0}; // "GEzvQ"
 
 static const char DT_DateTimePatternsTag[]="DateTimePatterns";
 static const char DT_DateAtTimePatternsTag[]="DateTimePatterns%atTime";
@@ -864,7 +864,7 @@ DateTimePatternGenerator::hackTimes(const UnicodeString& hackPattern, UErrorCode
                 mmss+=field;
             }
             else {
-                UChar ch=field.charAt(0);
+                char16_t ch=field.charAt(0);
                 if (ch==LOW_M) {
                     gotMm=true;
                     mmss+=field;
@@ -1001,11 +1001,11 @@ struct DateTimePatternGenerator::AppendItemNamesSink : public ResourceSink {
                 U_ASSERT(i < 20);
                 if (i < 10) {
                     // F0, F1, ..., F9
-                    valueStr += (UChar)(i+0x30);
+                    valueStr += (char16_t)(i+0x30);
                 } else {
                     // F10, F11, ...
-                    valueStr += (UChar)0x31;
-                    valueStr += (UChar)(i-10 + 0x30);
+                    valueStr += (char16_t)0x31;
+                    valueStr += (char16_t)(i-10 + 0x30);
                 }
                 // NUL-terminate for the C API.
                 valueStr.getTerminatedBuffer();
@@ -1250,7 +1250,7 @@ DateTimePatternGenerator::mapSkeletonMetacharacters(const UnicodeString& pattern
     UBool inQuoted = false;
     int32_t patPos, patLen = patternForm.length();
     for (patPos = 0; patPos < patLen; patPos++) {
-        UChar patChr = patternForm.charAt(patPos);
+        char16_t patChr = patternForm.charAt(patPos);
         if (patChr == SINGLE_QUOTE) {
             inQuoted = !inQuoted;
         } else if (!inQuoted) {
@@ -1268,8 +1268,8 @@ DateTimePatternGenerator::mapSkeletonMetacharacters(const UnicodeString& pattern
                 }
                 int32_t hourLen = 1 + (extraLen & 1);
                 int32_t dayPeriodLen = (extraLen < 2)? 1: 3 + (extraLen >> 1);
-                UChar hourChar = LOW_H;
-                UChar dayPeriodChar = LOW_A;
+                char16_t hourChar = LOW_H;
+                char16_t dayPeriodChar = LOW_A;
                 if (patChr == LOW_J) {
                     hourChar = fDefaultHourFormatChar;
                 } else {
@@ -1414,7 +1414,7 @@ void
 DateTimePatternGenerator::setDateTimeFromCalendar(const Locale& locale, UErrorCode& status) {
     if (U_FAILURE(status)) { return; }
 
-    const UChar *resStr;
+    const char16_t *resStr;
     int32_t resStrLen = 0;
 
     LocalUResourceBundlePointer calData(ures_open(nullptr, locale.getBaseName(), &status));
@@ -1719,7 +1719,7 @@ DateTimePatternGenerator::adjustFieldTypes(const UnicodeString& pattern,
                     //    a) The length of the field in the skeleton (skelFieldLen) is equal to reqFieldLen.
                     //    b) The pattern field is numeric and the skeleton field is not, or vice versa.
 
-                    UChar reqFieldChar = dtMatcher->skeleton.original.getFieldChar(typeValue);
+                    char16_t reqFieldChar = dtMatcher->skeleton.original.getFieldChar(typeValue);
                     int32_t reqFieldLen = dtMatcher->skeleton.original.getFieldLength(typeValue);
                     if (reqFieldChar == CAP_E && reqFieldLen < 3)
                         reqFieldLen = 3; // 1-3 for E are equivalent to 3 for c,e
@@ -1741,7 +1741,7 @@ DateTimePatternGenerator::adjustFieldTypes(const UnicodeString& pattern,
                             adjFieldLen = field.length();
                         }
                     }
-                    UChar c = (typeValue!= UDATPG_HOUR_FIELD
+                    char16_t c = (typeValue!= UDATPG_HOUR_FIELD
                             && typeValue!= UDATPG_MONTH_FIELD
                             && typeValue!= UDATPG_WEEKDAY_FIELD
                             && (typeValue!= UDATPG_YEAR_FIELD || reqFieldChar==CAP_Y))
@@ -2051,7 +2051,7 @@ PatternMap::copyFrom(const PatternMap& other, UErrorCode& status) {
 }
 
 PtnElem*
-PatternMap::getHeader(UChar baseChar) const {
+PatternMap::getHeader(char16_t baseChar) const {
     PtnElem* curElem;
 
     if ( (baseChar >= CAP_A) && (baseChar <= CAP_Z) ) {
@@ -2083,7 +2083,7 @@ PatternMap::add(const UnicodeString& basePattern,
                 const UnicodeString& value,// mapped pattern value
                 UBool skeletonWasSpecified,
                 UErrorCode &status) {
-    UChar baseChar = basePattern.charAt(0);
+    char16_t baseChar = basePattern.charAt(0);
     PtnElem *curElem, *baseElem;
     status = U_ZERO_ERROR;
 
@@ -2191,7 +2191,7 @@ PatternMap::getPatternFromSkeleton(const PtnSkeleton& skeleton, const PtnSkeleto
    }
 
    // find boot entry
-   UChar baseChar = skeleton.getFirstChar();
+   char16_t baseChar = skeleton.getFirstChar();
    if ((curElem=getHeader(baseChar))==nullptr) {
        return nullptr;  // no match
    }
@@ -2335,7 +2335,7 @@ DateTimeMatcher::set(const UnicodeString& pattern, FormatParser* fp, PtnSkeleton
         const dtTypeElem *row = &dtTypes[canonicalIndex];
         int32_t field = row->field;
         skeletonResult.original.populate(field, value);
-        UChar repeatChar = row->patternChar;
+        char16_t repeatChar = row->patternChar;
         int32_t repeatCount = row->minLen;
         skeletonResult.baseOriginal.populate(field, repeatChar, repeatCount);
         int16_t subField = row->type;
@@ -2493,7 +2493,7 @@ FormatParser::setTokens(const UnicodeString& pattern, int32_t startPos, int32_t
     }
     // check the current char is between A-Z or a-z
     do {
-        UChar c=pattern.charAt(curLoc);
+        char16_t c=pattern.charAt(curLoc);
         if ( (c>=CAP_A && c<=CAP_Z) || (c>=LOW_A && c<=LOW_Z) ) {
            curLoc++;
         }
@@ -2537,7 +2537,7 @@ FormatParser::getCanonicalIndex(const UnicodeString& s, UBool strict) {
     if (len == 0) {
         return -1;
     }
-    UChar ch = s.charAt(0);
+    char16_t ch = s.charAt(0);
 
     // Verify that all are the same character.
     for (int32_t l = 1; l < len; l++) {
@@ -2605,7 +2605,7 @@ FormatParser::getQuoteLiteral(UnicodeString& quote, int32_t *itemIndex) {
 UBool
 FormatParser::isPatternSeparator(const UnicodeString& field) const {
     for (int32_t i=0; i<field.length(); ++i ) {
-        UChar c= field.charAt(i);
+        char16_t c= field.charAt(i);
         if ( (c==SINGLE_QUOTE) || (c==BACKSLASH) || (c==SPACE) || (c==COLON) ||
              (c==QUOTATION_MARK) || (c==COMMA) || (c==HYPHEN) ||(items[i].charAt(0)==DOT) ) {
             continue;
@@ -2737,7 +2737,7 @@ void SkeletonFields::clearField(int32_t field) {
     lengths[field] = 0;
 }
 
-UChar SkeletonFields::getFieldChar(int32_t field) const {
+char16_t SkeletonFields::getFieldChar(int32_t field) const {
     return chars[field];
 }
 
@@ -2749,7 +2749,7 @@ void SkeletonFields::populate(int32_t field, const UnicodeString& value) {
     populate(field, value.charAt(0), value.length());
 }
 
-void SkeletonFields::populate(int32_t field, UChar ch, int32_t length) {
+void SkeletonFields::populate(int32_t field, char16_t ch, int32_t length) {
     chars[field] = (int8_t) ch;
     lengths[field] = (int8_t) length;
 }
@@ -2766,7 +2766,7 @@ UnicodeString& SkeletonFields::appendTo(UnicodeString& string) const {
 }
 
 UnicodeString& SkeletonFields::appendFieldTo(int32_t field, UnicodeString& string) const {
-    UChar ch(chars[field]);
+    char16_t ch(chars[field]);
     int32_t length = (int32_t) lengths[field];
 
     for (int32_t i=0; i<length; i++) {
@@ -2775,7 +2775,7 @@ UnicodeString& SkeletonFields::appendFieldTo(int32_t field, UnicodeString& strin
     return string;
 }
 
-UChar SkeletonFields::getFirstChar() const {
+char16_t SkeletonFields::getFirstChar() const {
     for (int32_t i = 0; i < UDATPG_FIELD_COUNT; ++i) {
         if (lengths[i] != 0) {
             return chars[i];
@@ -2839,7 +2839,7 @@ PtnSkeleton::getBaseSkeleton() const {
     return result;
 }
 
-UChar
+char16_t
 PtnSkeleton::getFirstChar() const {
     return baseOriginal.getFirstChar();
 }
index 5caae11654bb199b595d73f41e20faf66077f6e7..027b734a5c963a4def93be3242af2d8e05e262e8 100644 (file)
 #define EXTRA_FIELD   0x10000
 #define MISSING_FIELD  0x1000
 #define MAX_STRING_ENUMERATION  200
-#define SINGLE_QUOTE      ((UChar)0x0027)
-#define FORWARDSLASH      ((UChar)0x002F)
-#define BACKSLASH         ((UChar)0x005C)
-#define SPACE             ((UChar)0x0020)
-#define QUOTATION_MARK    ((UChar)0x0022)
-#define ASTERISK          ((UChar)0x002A)
-#define PLUSSITN          ((UChar)0x002B)
-#define COMMA             ((UChar)0x002C)
-#define HYPHEN            ((UChar)0x002D)
-#define DOT               ((UChar)0x002E)
-#define COLON             ((UChar)0x003A)
-#define CAP_A             ((UChar)0x0041)
-#define CAP_B             ((UChar)0x0042)
-#define CAP_C             ((UChar)0x0043)
-#define CAP_D             ((UChar)0x0044)
-#define CAP_E             ((UChar)0x0045)
-#define CAP_F             ((UChar)0x0046)
-#define CAP_G             ((UChar)0x0047)
-#define CAP_H             ((UChar)0x0048)
-#define CAP_J             ((UChar)0x004A)
-#define CAP_K             ((UChar)0x004B)
-#define CAP_L             ((UChar)0x004C)
-#define CAP_M             ((UChar)0x004D)
-#define CAP_O             ((UChar)0x004F)
-#define CAP_Q             ((UChar)0x0051)
-#define CAP_S             ((UChar)0x0053)
-#define CAP_T             ((UChar)0x0054)
-#define CAP_U             ((UChar)0x0055)
-#define CAP_V             ((UChar)0x0056)
-#define CAP_W             ((UChar)0x0057)
-#define CAP_X             ((UChar)0x0058)
-#define CAP_Y             ((UChar)0x0059)
-#define CAP_Z             ((UChar)0x005A)
-#define LOWLINE           ((UChar)0x005F)
-#define LOW_A             ((UChar)0x0061)
-#define LOW_B             ((UChar)0x0062)
-#define LOW_C             ((UChar)0x0063)
-#define LOW_D             ((UChar)0x0064)
-#define LOW_E             ((UChar)0x0065)
-#define LOW_F             ((UChar)0x0066)
-#define LOW_G             ((UChar)0x0067)
-#define LOW_H             ((UChar)0x0068)
-#define LOW_I             ((UChar)0x0069)
-#define LOW_J             ((UChar)0x006A)
-#define LOW_K             ((UChar)0x006B)
-#define LOW_L             ((UChar)0x006C)
-#define LOW_M             ((UChar)0x006D)
-#define LOW_N             ((UChar)0x006E)
-#define LOW_O             ((UChar)0x006F)
-#define LOW_P             ((UChar)0x0070)
-#define LOW_Q             ((UChar)0x0071)
-#define LOW_R             ((UChar)0x0072)
-#define LOW_S             ((UChar)0x0073)
-#define LOW_T             ((UChar)0x0074)
-#define LOW_U             ((UChar)0x0075)
-#define LOW_V             ((UChar)0x0076)
-#define LOW_W             ((UChar)0x0077)
-#define LOW_X             ((UChar)0x0078)
-#define LOW_Y             ((UChar)0x0079)
-#define LOW_Z             ((UChar)0x007A)
+#define SINGLE_QUOTE      ((char16_t)0x0027)
+#define FORWARDSLASH      ((char16_t)0x002F)
+#define BACKSLASH         ((char16_t)0x005C)
+#define SPACE             ((char16_t)0x0020)
+#define QUOTATION_MARK    ((char16_t)0x0022)
+#define ASTERISK          ((char16_t)0x002A)
+#define PLUSSITN          ((char16_t)0x002B)
+#define COMMA             ((char16_t)0x002C)
+#define HYPHEN            ((char16_t)0x002D)
+#define DOT               ((char16_t)0x002E)
+#define COLON             ((char16_t)0x003A)
+#define CAP_A             ((char16_t)0x0041)
+#define CAP_B             ((char16_t)0x0042)
+#define CAP_C             ((char16_t)0x0043)
+#define CAP_D             ((char16_t)0x0044)
+#define CAP_E             ((char16_t)0x0045)
+#define CAP_F             ((char16_t)0x0046)
+#define CAP_G             ((char16_t)0x0047)
+#define CAP_H             ((char16_t)0x0048)
+#define CAP_J             ((char16_t)0x004A)
+#define CAP_K             ((char16_t)0x004B)
+#define CAP_L             ((char16_t)0x004C)
+#define CAP_M             ((char16_t)0x004D)
+#define CAP_O             ((char16_t)0x004F)
+#define CAP_Q             ((char16_t)0x0051)
+#define CAP_S             ((char16_t)0x0053)
+#define CAP_T             ((char16_t)0x0054)
+#define CAP_U             ((char16_t)0x0055)
+#define CAP_V             ((char16_t)0x0056)
+#define CAP_W             ((char16_t)0x0057)
+#define CAP_X             ((char16_t)0x0058)
+#define CAP_Y             ((char16_t)0x0059)
+#define CAP_Z             ((char16_t)0x005A)
+#define LOWLINE           ((char16_t)0x005F)
+#define LOW_A             ((char16_t)0x0061)
+#define LOW_B             ((char16_t)0x0062)
+#define LOW_C             ((char16_t)0x0063)
+#define LOW_D             ((char16_t)0x0064)
+#define LOW_E             ((char16_t)0x0065)
+#define LOW_F             ((char16_t)0x0066)
+#define LOW_G             ((char16_t)0x0067)
+#define LOW_H             ((char16_t)0x0068)
+#define LOW_I             ((char16_t)0x0069)
+#define LOW_J             ((char16_t)0x006A)
+#define LOW_K             ((char16_t)0x006B)
+#define LOW_L             ((char16_t)0x006C)
+#define LOW_M             ((char16_t)0x006D)
+#define LOW_N             ((char16_t)0x006E)
+#define LOW_O             ((char16_t)0x006F)
+#define LOW_P             ((char16_t)0x0070)
+#define LOW_Q             ((char16_t)0x0071)
+#define LOW_R             ((char16_t)0x0072)
+#define LOW_S             ((char16_t)0x0073)
+#define LOW_T             ((char16_t)0x0074)
+#define LOW_U             ((char16_t)0x0075)
+#define LOW_V             ((char16_t)0x0076)
+#define LOW_W             ((char16_t)0x0077)
+#define LOW_X             ((char16_t)0x0078)
+#define LOW_Y             ((char16_t)0x0079)
+#define LOW_Z             ((char16_t)0x007A)
 #define DT_NARROW         -0x101
 #define DT_SHORTER        -0x102
 #define DT_SHORT          -0x103
@@ -111,7 +111,7 @@ typedef enum dtStrEnum {
 }dtStrEnum;
 
 typedef struct dtTypeElem {
-    UChar                  patternChar;
+    char16_t               patternChar;
     UDateTimePatternField  field;
     int16_t                type;
     int16_t                minLen;
@@ -126,14 +126,14 @@ public:
     void clear();
     void copyFrom(const SkeletonFields& other);
     void clearField(int32_t field);
-    UChar getFieldChar(int32_t field) const;
+    char16_t getFieldChar(int32_t field) const;
     int32_t getFieldLength(int32_t field) const;
     void populate(int32_t field, const UnicodeString& value);
-    void populate(int32_t field, UChar repeatChar, int32_t repeatCount);
+    void populate(int32_t field, char16_t repeatChar, int32_t repeatCount);
     UBool isFieldEmpty(int32_t field) const;
     UnicodeString& appendTo(UnicodeString& string) const;
     UnicodeString& appendFieldTo(int32_t field, UnicodeString& string) const;
-    UChar getFirstChar() const;
+    char16_t getFirstChar() const;
     inline bool operator==(const SkeletonFields& other) const;
     inline bool operator!=(const SkeletonFields& other) const;
 
@@ -165,7 +165,7 @@ public:
     UBool equals(const PtnSkeleton& other) const;
     UnicodeString getSkeleton() const;
     UnicodeString getBaseSkeleton() const;
-    UChar getFirstChar() const;
+    char16_t getFirstChar() const;
 
     // TODO: Why is this virtual, as well as the other destructors in this file? We don't want
     // vtables when we don't use class objects polymorphically.
@@ -252,7 +252,7 @@ public:
     const UnicodeString* getPatternFromBasePattern(const UnicodeString& basePattern, UBool& skeletonWasSpecified) const;
     const UnicodeString* getPatternFromSkeleton(const PtnSkeleton& skeleton, const PtnSkeleton** specifiedSkeletonPtr = 0) const;
     void copyFrom(const PatternMap& other, UErrorCode& status);
-    PtnElem* getHeader(UChar baseChar) const;
+    PtnElem* getHeader(char16_t baseChar) const;
     UBool equals(const PatternMap& other) const;
 private:
     UBool isDupAllowed;
index ffc7c993a2206972c3b016fb7c3d88d2f63e1cd6..8fccb31565c875696ea8edaa674e61159135dab6 100644 (file)
@@ -31,8 +31,8 @@ static const int32_t DAY_MASK = 0x000000FF;
 static const int32_t MAX_INT32 = 0x7FFFFFFF;
 static const int32_t MIN_INT32 = 0xFFFFFFFF;
 
-static const UChar VAL_FALSE[] = {0x66, 0x61, 0x6c, 0x73, 0x65};    // "false"
-static const UChar VAL_FALSE_LEN = 5;
+static const char16_t VAL_FALSE[] = {0x66, 0x61, 0x6c, 0x73, 0x65};    // "false"
+static const char16_t VAL_FALSE_LEN = 5;
 
 static UBool isSet(int startDate) {
     return startDate != 0;
@@ -176,7 +176,7 @@ EraRules* EraRules::createInstance(const char *calType, UBool includeTentativeEr
                 }
                 startDates[eraIdx] = encodeDate(fields[0], fields[1], fields[2]);
             } else if (uprv_strcmp(key, "named") == 0) {
-                const UChar *val = ures_getString(res.getAlias(), &len, &status);
+                const char16_t *val = ures_getString(res.getAlias(), &len, &status);
                 if (u_strncmp(val, VAL_FALSE, VAL_FALSE_LEN) == 0) {
                     hasName = false;
                 }
index c331cda2549853cc420a1a9f13ae6df4ce8ddf91..24fa6f58e45f39aec69f968623840bf7e7aeed83 100644 (file)
 
 U_NAMESPACE_BEGIN
 
-static const UChar UNIPRE[] = {85,43,0}; // "U+"
-static const UChar BS_u[] = {92,117,0}; // "\\u"
-static const UChar BS_U[] = {92,85,0}; // "\\U"
-static const UChar XMLPRE[] = {38,35,120,0}; // "&#x"
-static const UChar XML10PRE[] = {38,35,0}; // "&#"
-static const UChar PERLPRE[] = {92,120,123,0}; // "\\x{"
-static const UChar SEMI[] = {59,0}; // ";"
-static const UChar RBRACE[] = {125,0}; // "}"
+static const char16_t UNIPRE[] = {85,43,0}; // "U+"
+static const char16_t BS_u[] = {92,117,0}; // "\\u"
+static const char16_t BS_U[] = {92,85,0}; // "\\U"
+static const char16_t XMLPRE[] = {38,35,120,0}; // "&#x"
+static const char16_t XML10PRE[] = {38,35,0}; // "&#"
+static const char16_t PERLPRE[] = {92,120,123,0}; // "\\x{"
+static const char16_t SEMI[] = {59,0}; // ";"
+static const char16_t RBRACE[] = {125,0}; // "}"
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(EscapeTransliterator)
 
index 25b4ce7aed1bca747a44708252cec23dfd3b961a..618868c0a2f347860ada3bf17b072d7ea37b493d 100644 (file)
@@ -966,7 +966,7 @@ ufmt_getObject(const UFormattable *fmt, UErrorCode *status) {
   return ret;
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 ufmt_getUChars(UFormattable *fmt, int32_t *len, UErrorCode *status) {
   Formattable *obj = Formattable::fromUFormattable(fmt);
 
index f103c015b8e7cf4f5b76338fa0e0ce33e4183e44..aacd6ac70e090fed3153bbad89f2a3e57d15590e 100644 (file)
@@ -193,7 +193,7 @@ ucfpos_close(UConstrainedFieldPosition* ptr) {
 }
 
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 ufmtval_getString(
         const UFormattedValue* ufmtval,
         int32_t* pLength,
index 7dd54ed8d2b6a7649143e0a109be46ab076380b6..f093a1e437988e1798b4efadf7f02ace234103f7 100644 (file)
@@ -18,9 +18,9 @@
 #include "unicode/uniset.h"
 #include "funcrepl.h"
 
-static const UChar AMPERSAND = 38; // '&'
-static const UChar OPEN[]    = {40,32,0}; // "( "
-static const UChar CLOSE[]   = {32,41,0}; // " )"
+static const char16_t AMPERSAND = 38; // '&'
+static const char16_t OPEN[]    = {40,32,0}; // "( "
+static const char16_t CLOSE[]   = {32,41,0}; // " )"
 
 U_NAMESPACE_BEGIN
 
index fada578e07b26e2adb25acd636ed030e9b201769..04615799279461e49c1b01368e1cc7ed139b63ba 100644 (file)
@@ -145,7 +145,7 @@ const GenderInfo* GenderInfo::loadInstance(const Locale& locale, UErrorCode& sta
   int32_t resLen = 0;
   const char* curLocaleName = locale.getName();
   UErrorCode key_status = U_ZERO_ERROR;
-  const UChar* s = ures_getStringByKey(locRes.getAlias(), curLocaleName, &resLen, &key_status);
+  const char16_t* s = ures_getStringByKey(locRes.getAlias(), curLocaleName, &resLen, &key_status);
   if (s == nullptr) {
     key_status = U_ZERO_ERROR;
     char parentLocaleName[ULOC_FULLNAME_CAPACITY];
index 8ce3172ec4ce669f44152eecb89689ddb5a933fc..b8ba699bb5f2722e6fb51c20e2901d38fb1c4392 100644 (file)
@@ -75,7 +75,7 @@ UBool JapaneseCalendar::enableTentativeEra() {
 
 #if U_PLATFORM_HAS_WINUWP_API == 1
     // UWP doesn't allow access to getenv(), but we can call GetEnvironmentVariableW to do the same thing.
-    UChar varName[26] = {};
+    char16_t varName[26] = {};
     u_charsToUChars(TENTATIVE_ERA_VAR_NAME, varName, static_cast<int32_t>(uprv_strlen(TENTATIVE_ERA_VAR_NAME)));
     WCHAR varValue[5] = {};
     DWORD ret = GetEnvironmentVariableW(reinterpret_cast<WCHAR*>(varName), varValue, UPRV_LENGTHOF(varValue));
index 4142fa461dada86fee748ea15b839bc05f326ea7..9fe0fa199a4254d88723c61d02f1dd5ac23447fd 100644 (file)
@@ -396,8 +396,8 @@ static const char* typeWidthToStyleString(UListFormatterType type, UListFormatte
     return nullptr;
 }
 
-static const UChar solidus = 0x2F;
-static const UChar aliasPrefix[] = { 0x6C,0x69,0x73,0x74,0x50,0x61,0x74,0x74,0x65,0x72,0x6E,0x2F }; // "listPattern/"
+static const char16_t solidus = 0x2F;
+static const char16_t aliasPrefix[] = { 0x6C,0x69,0x73,0x74,0x50,0x61,0x74,0x74,0x65,0x72,0x6E,0x2F }; // "listPattern/"
 enum {
     kAliasPrefixLen = UPRV_LENGTHOF(aliasPrefix),
     kStyleLenMax = 24 // longest currently is 14
index 98320d3f2b0f524ac97fa19693891324073db95c..da4e69b49b7dfc066f7ca6569612fd1458c188c2 100644 (file)
@@ -181,7 +181,7 @@ static UBool getString(
         UnicodeString &result,
         UErrorCode &status) {
     int32_t len = 0;
-    const UChar *resStr = ures_getString(resource, &len, &status);
+    const char16_t *resStr = ures_getString(resource, &len, &status);
     if (U_FAILURE(status)) {
         return false;
     }
@@ -212,7 +212,7 @@ static UnicodeString loadNumericDateFormatterPattern(
     getString(patternBundle.getAlias(), result, status);
     // Replace 'h' with 'H'
     int32_t len = result.length();
-    UChar *buffer = result.getBuffer(len);
+    char16_t *buffer = result.getBuffer(len);
     for (int32_t i = 0; i < len; ++i) {
         if (buffer[i] == 0x68) { // 'h'
             buffer[i] = 0x48; // 'H'
@@ -683,7 +683,7 @@ UnicodeString &MeasureFormat::formatMeasure(
     const Formattable& amtNumber = measure.getNumber();
     const MeasureUnit& amtUnit = measure.getUnit();
     if (isCurrency(amtUnit)) {
-        UChar isoCode[4];
+        char16_t isoCode[4];
         u_charsToUChars(amtUnit.getSubtype(), isoCode, 4);
         return cache->getCurrencyFormat(fWidth)->format(
                 new CurrencyAmount(amtNumber, isoCode, status),
index cfd9c759856c2d3eb5ac5626688a703738bd37bc..8e86eb5710cbcfcf581f85bf7c9a9c6dcabb44b2 100644 (file)
@@ -220,7 +220,7 @@ class SimpleUnitIdentifiersSink : public icu::ResourceSink {
                 break;
             }
             int32_t len;
-            const UChar* uTarget = value.getString(len, status);
+            const char16_t* uTarget = value.getString(len, status);
             CharString target;
             target.appendInvariantChars(uTarget, len, status);
             if (U_FAILURE(status)) { return; }
@@ -255,15 +255,15 @@ class SimpleUnitIdentifiersSink : public icu::ResourceSink {
  *
  * For example: "kilogram" -> "mass", "meter-per-second" -> "speed".
  *
- * In C++ unitQuantity values are collected in order into a UChar* array, while
+ * In C++ unitQuantity values are collected in order into a char16_t* array, while
  * unitQuantity keys are added added to a TrieBuilder, with associated values
- * being the index into the aforementioned UChar* array.
+ * being the index into the aforementioned char16_t* array.
  */
 class CategoriesSink : public icu::ResourceSink {
   public:
     /**
      * Constructor.
-     * @param out Array of UChar* to which unitQuantity values will be saved.
+     * @param out Array of char16_t* to which unitQuantity values will be saved.
      *     The pointers returned  not owned: they point directly at the resource
      *     strings in static memory.
      * @param outSize The size of the `out` array.
@@ -271,7 +271,7 @@ class CategoriesSink : public icu::ResourceSink {
      *     each unitQuantity will be added, each with value being the offset
      *     into `out`.
      */
-    explicit CategoriesSink(const UChar **out, int32_t &outSize, BytesTrieBuilder &trieBuilder)
+    explicit CategoriesSink(const char16_t **out, int32_t &outSize, BytesTrieBuilder &trieBuilder)
         : outQuantitiesArray(out), outSize(outSize), trieBuilder(trieBuilder), outIndex(0) {}
 
     void put(const char * /*key*/, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) override {
@@ -305,7 +305,7 @@ class CategoriesSink : public icu::ResourceSink {
     }
 
   private:
-    const UChar **outQuantitiesArray;
+    const char16_t **outQuantitiesArray;
     int32_t &outSize;
     BytesTrieBuilder &trieBuilder;
 
@@ -327,11 +327,11 @@ int32_t *gSimpleUnitCategories = nullptr;
 
 char *gSerializedUnitExtrasStemTrie = nullptr;
 
-// Array of UChar* pointing at the unit categories (aka "quantities", aka
+// Array of char16_t* pointing at the unit categories (aka "quantities", aka
 // "types"), as found in the `unitQuantities` resource. The array memory itself
-// is owned by this pointer, but the individual UChar* in that array point at
+// is owned by this pointer, but the individual char16_t* in that array point at
 // static memory.
-const UChar **gCategories = nullptr;
+const char16_t **gCategories = nullptr;
 // Number of items in `gCategories`.
 int32_t gCategoriesCount = 0;
 // Serialized BytesTrie for mapping from base units to indices into gCategories.
@@ -362,8 +362,8 @@ void U_CALLCONV initUnitExtras(UErrorCode& status) {
         ures_getByKey(unitsBundle.getAlias(), CATEGORY_TABLE_NAME, nullptr, &status));
     if (U_FAILURE(status)) { return; }
     gCategoriesCount = unitQuantities.getAlias()->fSize;
-    size_t quantitiesMallocSize = sizeof(UChar *) * gCategoriesCount;
-    gCategories = static_cast<const UChar **>(uprv_malloc(quantitiesMallocSize));
+    size_t quantitiesMallocSize = sizeof(char16_t *) * gCategoriesCount;
+    gCategories = static_cast<const char16_t **>(uprv_malloc(quantitiesMallocSize));
     if (gCategories == nullptr) {
         status = U_MEMORY_ALLOCATION_ERROR;
         return;
index 95395e7dabbf67fe766182eda794a9c290b6e835..c9a3f82e059b307500f6af2cb43677536fe41032 100644 (file)
 // class MessageFormat
 // *****************************************************************************
 
-#define SINGLE_QUOTE      ((UChar)0x0027)
-#define COMMA             ((UChar)0x002C)
-#define LEFT_CURLY_BRACE  ((UChar)0x007B)
-#define RIGHT_CURLY_BRACE ((UChar)0x007D)
+#define SINGLE_QUOTE      ((char16_t)0x0027)
+#define COMMA             ((char16_t)0x002C)
+#define LEFT_CURLY_BRACE  ((char16_t)0x007B)
+#define RIGHT_CURLY_BRACE ((char16_t)0x007D)
 
 //---------------------------------------
 // static data
 
-static const UChar ID_NUMBER[]    = {
+static const char16_t ID_NUMBER[]    = {
     0x6E, 0x75, 0x6D, 0x62, 0x65, 0x72, 0  /* "number" */
 };
-static const UChar ID_DATE[]      = {
+static const char16_t ID_DATE[]      = {
     0x64, 0x61, 0x74, 0x65, 0              /* "date" */
 };
-static const UChar ID_TIME[]      = {
+static const char16_t ID_TIME[]      = {
     0x74, 0x69, 0x6D, 0x65, 0              /* "time" */
 };
-static const UChar ID_SPELLOUT[]  = {
+static const char16_t ID_SPELLOUT[]  = {
     0x73, 0x70, 0x65, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0 /* "spellout" */
 };
-static const UChar ID_ORDINAL[]   = {
+static const char16_t ID_ORDINAL[]   = {
     0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0 /* "ordinal" */
 };
-static const UChar ID_DURATION[]  = {
+static const char16_t ID_DURATION[]  = {
     0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0 /* "duration" */
 };
 
 // MessageFormat Type List  Number, Date, Time or Choice
-static const UChar * const TYPE_IDS[] = {
+static const char16_t * const TYPE_IDS[] = {
     ID_NUMBER,
     ID_DATE,
     ID_TIME,
@@ -93,21 +93,21 @@ static const UChar * const TYPE_IDS[] = {
     nullptr,
 };
 
-static const UChar ID_EMPTY[]     = {
+static const char16_t ID_EMPTY[]     = {
     0 /* empty string, used for default so that null can mark end of list */
 };
-static const UChar ID_CURRENCY[]  = {
+static const char16_t ID_CURRENCY[]  = {
     0x63, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x63, 0x79, 0  /* "currency" */
 };
-static const UChar ID_PERCENT[]   = {
+static const char16_t ID_PERCENT[]   = {
     0x70, 0x65, 0x72, 0x63, 0x65, 0x6E, 0x74, 0        /* "percent" */
 };
-static const UChar ID_INTEGER[]   = {
+static const char16_t ID_INTEGER[]   = {
     0x69, 0x6E, 0x74, 0x65, 0x67, 0x65, 0x72, 0        /* "integer" */
 };
 
 // NumberFormat modifier list, default, currency, percent or integer
-static const UChar * const NUMBER_STYLE_IDS[] = {
+static const char16_t * const NUMBER_STYLE_IDS[] = {
     ID_EMPTY,
     ID_CURRENCY,
     ID_PERCENT,
@@ -115,21 +115,21 @@ static const UChar * const NUMBER_STYLE_IDS[] = {
     nullptr,
 };
 
-static const UChar ID_SHORT[]     = {
+static const char16_t ID_SHORT[]     = {
     0x73, 0x68, 0x6F, 0x72, 0x74, 0        /* "short" */
 };
-static const UChar ID_MEDIUM[]    = {
+static const char16_t ID_MEDIUM[]    = {
     0x6D, 0x65, 0x64, 0x69, 0x75, 0x6D, 0  /* "medium" */
 };
-static const UChar ID_LONG[]      = {
+static const char16_t ID_LONG[]      = {
     0x6C, 0x6F, 0x6E, 0x67, 0              /* "long" */
 };
-static const UChar ID_FULL[]      = {
+static const char16_t ID_FULL[]      = {
     0x66, 0x75, 0x6C, 0x6C, 0              /* "full" */
 };
 
 // DateFormat modifier list, default, short, medium, long or full
-static const UChar * const DATE_STYLE_IDS[] = {
+static const char16_t * const DATE_STYLE_IDS[] = {
     ID_EMPTY,
     ID_SHORT,
     ID_MEDIUM,
@@ -148,11 +148,11 @@ static const icu::DateFormat::EStyle DATE_STYLES[] = {
 
 static const int32_t DEFAULT_INITIAL_CAPACITY = 10;
 
-static const UChar NULL_STRING[] = {
+static const char16_t NULL_STRING[] = {
     0x6E, 0x75, 0x6C, 0x6C, 0  // "null"
 };
 
-static const UChar OTHER_STRING[] = {
+static const char16_t OTHER_STRING[] = {
     0x6F, 0x74, 0x68, 0x65, 0x72, 0  // "other"
 };
 
@@ -177,7 +177,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(FormatNameEnumeration)
  * the given UnicodeString.
  */
 static UnicodeString& itos(int32_t i, UnicodeString& appendTo) {
-    UChar temp[16];
+    char16_t temp[16];
     uprv_itou(temp,16,i,10,0); // 10 == radix
     appendTo.append(temp, -1);
     return appendTo;
@@ -194,7 +194,7 @@ public:
         app.appendString(s.getBuffer(), s.length());
         len += s.length();
     }
-    void append(const UChar* s, const int32_t sLength) {
+    void append(const char16_t* s, const int32_t sLength) {
         app.appendString(s, sLength);
         len += sLength;
     }
@@ -1554,9 +1554,9 @@ MessageFormat::autoQuoteApostrophe(const UnicodeString& pattern, UErrorCode& sta
     UnicodeString result;
     if (U_SUCCESS(status)) {
         int32_t plen = pattern.length();
-        const UChar* pat = pattern.getBuffer();
+        const char16_t* pat = pattern.getBuffer();
         int32_t blen = plen * 2 + 1; // space for null termination, convenience
-        UChar* buf = result.getBuffer(blen);
+        char16_t* buf = result.getBuffer(blen);
         if (buf == nullptr) {
             status = U_MEMORY_ALLOCATION_ERROR;
         } else {
@@ -1781,14 +1781,14 @@ Format* MessageFormat::createAppropriateFormat(UnicodeString& type, UnicodeStrin
 //-------------------------------------
 // Finds the string, s, in the string array, list.
 int32_t MessageFormat::findKeyword(const UnicodeString& s,
-                                   const UChar * const *list)
+                                   const char16_t * const *list)
 {
     if (s.isEmpty()) {
         return 0; // default
     }
 
     int32_t length = s.length();
-    const UChar *ps = PatternProps::trimWhiteSpace(s.getBuffer(), length);
+    const char16_t *ps = PatternProps::trimWhiteSpace(s.getBuffer(), length);
     UnicodeString buffer(false, ps, length);
     // Trims the space characters and turns all characters
     // in s to lower case.
index 4cdac1503dc665cc9934761aa8ea8fd7e66f8a00..2d26dba812c46d8857a4f9b84d4149aad247118f 100644 (file)
@@ -29,10 +29,10 @@ U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NameUnicodeTransliterator)
 
-static const UChar OPEN[] = {92,78,126,123,126,0}; // "\N~{~"
-static const UChar OPEN_DELIM  = 92;  // '\\' first char of OPEN
-static const UChar CLOSE_DELIM = 125; // '}'
-static const UChar SPACE       = 32;  // ' '
+static const char16_t OPEN[] = {92,78,126,123,126,0}; // "\N~{~"
+static const char16_t OPEN_DELIM  = 92;  // '\\' first char of OPEN
+static const char16_t CLOSE_DELIM = 125; // '}'
+static const char16_t SPACE       = 32;  // ' '
 
 U_CDECL_BEGIN
 
@@ -50,7 +50,7 @@ _set_addRange(USet *set, UChar32 start, UChar32 end) {
 }
 
 static void U_CALLCONV
-_set_addString(USet *set, const UChar *str, int32_t length) {
+_set_addString(USet *set, const char16_t *str, int32_t length) {
     ((UnicodeSet *)set)->add(UnicodeString((UBool)(length<0), str, length));
 }*/
 
index 709aff0328f04eebb76444a2996476806deff861..1f4b9b9d2945d8aafde778219aa814f825548cef 100644 (file)
@@ -118,17 +118,17 @@ util_lcm(int64_t x, int64_t y)
 }
 #endif
 
-static const UChar gPercent = 0x0025;
-static const UChar gColon = 0x003a;
-static const UChar gSemicolon = 0x003b;
-static const UChar gLineFeed = 0x000a;
+static const char16_t gPercent = 0x0025;
+static const char16_t gColon = 0x003a;
+static const char16_t gSemicolon = 0x003b;
+static const char16_t gLineFeed = 0x000a;
 
-static const UChar gPercentPercent[] =
+static const char16_t gPercentPercent[] =
 {
     0x25, 0x25, 0
 }; /* "%%" */
 
-static const UChar gNoparse[] =
+static const char16_t gNoparse[] =
 {
     0x40, 0x6E, 0x6F, 0x70, 0x61, 0x72, 0x73, 0x65, 0
 }; /* "@noparse" */
@@ -860,7 +860,7 @@ static const uint8_t asciiDigits[] = {
     0x77u, 0x78u, 0x79u, 0x7au,  
 };
 
-static const UChar kUMinus = (UChar)0x002d;
+static const char16_t kUMinus = (char16_t)0x002d;
 
 #ifdef RBNF_DEBUG
 static const char kMinus = '-';
@@ -910,7 +910,7 @@ int64_t util64_atoi(const char* str, uint32_t radix)
     return result;
 }
 
-int64_t util64_utoi(const UChar* str, uint32_t radix)
+int64_t util64_utoi(const char16_t* str, uint32_t radix)
 {
     if (radix > 36) {
         radix = 36;
@@ -925,7 +925,7 @@ int64_t util64_utoi(const UChar* str, uint32_t radix)
         neg = 1;
     }
     int64_t result = 0;
-    UChar c;
+    char16_t c;
     uint8_t b;
     while (((c = *str++) < 0x0080) && (b = digitInfo[c]) && ((b &= 0x7f) < radix)) {
         result *= lradix;
@@ -983,7 +983,7 @@ uint32_t util64_toa(int64_t w, char* buf, uint32_t len, uint32_t radix, UBool ra
 }
 #endif
 
-uint32_t util64_tou(int64_t w, UChar* buf, uint32_t len, uint32_t radix, UBool raw)
+uint32_t util64_tou(int64_t w, char16_t* buf, uint32_t len, uint32_t radix, UBool raw)
 {    
     if (radix > 36) {
         radix = 36;
@@ -992,13 +992,13 @@ uint32_t util64_tou(int64_t w, UChar* buf, uint32_t len, uint32_t radix, UBool r
     }
     int64_t base = radix;
 
-    UChar* p = buf;
+    char16_t* p = buf;
     if (len && (w < 0) && (radix == 10) && !raw) {
         w = -w;
         *p++ = kUMinus;
         --len;
     } else if (len && (w == 0)) {
-        *p++ = (UChar)raw ? 0 : asciiDigits[0];
+        *p++ = (char16_t)raw ? 0 : asciiDigits[0];
         --len;
     }
 
@@ -1006,7 +1006,7 @@ uint32_t util64_tou(int64_t w, UChar* buf, uint32_t len, uint32_t radix, UBool r
         int64_t n = w / base;
         int64_t m = n * base;
         int32_t d = (int32_t)(w-m);
-        *p++ = (UChar)(raw ? d : asciiDigits[d]);
+        *p++ = (char16_t)(raw ? d : asciiDigits[d]);
         w = n;
         --len;
     }
@@ -1019,7 +1019,7 @@ uint32_t util64_tou(int64_t w, UChar* buf, uint32_t len, uint32_t radix, UBool r
         ++buf;
     }
     while (--p > buf) {
-        UChar c = *p;
+        char16_t c = *p;
         *p = *buf;
         *buf = c;
         ++buf;
index a6ad3a3bb7f05decd68274cb542ecc4aa68aa50e..a1beedda17d79e986a68c0c4173a3453b72cc449 100644 (file)
@@ -93,10 +93,10 @@ int64_t util64_fromDouble(double d);
 uint64_t util64_pow(uint32_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);
+uint32_t util64_tou(int64_t n, char16_t* buffer, uint32_t buflen, uint32_t radix = 10, UBool raw = false);
 
 #ifdef RBNF_DEBUG
-int64_t util64_utoi(const UChar* str, uint32_t radix = 10);
+int64_t util64_utoi(const char16_t* str, uint32_t radix = 10);
 uint32_t util64_toa(int64_t n, char* buffer, uint32_t buflen, uint32_t radix = 10, UBool raw = false);
 int64_t util64_atoi(const char* str, uint32_t radix);
 #endif
index 8e9040b59e3979c9d758d537a35e43dc58555248..51bd4c974f4aa383896d5baf6c8689cce8ae23be 100644 (file)
@@ -62,43 +62,43 @@ NFRule::~NFRule()
     rulePatternFormat = nullptr;
 }
 
-static const UChar gLeftBracket = 0x005b;
-static const UChar gRightBracket = 0x005d;
-static const UChar gColon = 0x003a;
-static const UChar gZero = 0x0030;
-static const UChar gNine = 0x0039;
-static const UChar gSpace = 0x0020;
-static const UChar gSlash = 0x002f;
-static const UChar gGreaterThan = 0x003e;
-static const UChar gLessThan = 0x003c;
-static const UChar gComma = 0x002c;
-static const UChar gDot = 0x002e;
-static const UChar gTick = 0x0027;
-//static const UChar gMinus = 0x002d;
-static const UChar gSemicolon = 0x003b;
-static const UChar gX = 0x0078;
-
-static const UChar gMinusX[] =                  {0x2D, 0x78, 0};    /* "-x" */
-static const UChar gInf[] =                     {0x49, 0x6E, 0x66, 0}; /* "Inf" */
-static const UChar gNaN[] =                     {0x4E, 0x61, 0x4E, 0}; /* "NaN" */
-
-static const UChar gDollarOpenParenthesis[] =   {0x24, 0x28, 0}; /* "$(" */
-static const UChar gClosedParenthesisDollar[] = {0x29, 0x24, 0}; /* ")$" */
-
-static const UChar gLessLess[] =                {0x3C, 0x3C, 0};    /* "<<" */
-static const UChar gLessPercent[] =             {0x3C, 0x25, 0};    /* "<%" */
-static const UChar gLessHash[] =                {0x3C, 0x23, 0};    /* "<#" */
-static const UChar gLessZero[] =                {0x3C, 0x30, 0};    /* "<0" */
-static const UChar gGreaterGreater[] =          {0x3E, 0x3E, 0};    /* ">>" */
-static const UChar gGreaterPercent[] =          {0x3E, 0x25, 0};    /* ">%" */
-static const UChar gGreaterHash[] =             {0x3E, 0x23, 0};    /* ">#" */
-static const UChar gGreaterZero[] =             {0x3E, 0x30, 0};    /* ">0" */
-static const UChar gEqualPercent[] =            {0x3D, 0x25, 0};    /* "=%" */
-static const UChar gEqualHash[] =               {0x3D, 0x23, 0};    /* "=#" */
-static const UChar gEqualZero[] =               {0x3D, 0x30, 0};    /* "=0" */
-static const UChar gGreaterGreaterGreater[] =   {0x3E, 0x3E, 0x3E, 0}; /* ">>>" */
-
-static const UChar * const RULE_PREFIXES[] = {
+static const char16_t gLeftBracket = 0x005b;
+static const char16_t gRightBracket = 0x005d;
+static const char16_t gColon = 0x003a;
+static const char16_t gZero = 0x0030;
+static const char16_t gNine = 0x0039;
+static const char16_t gSpace = 0x0020;
+static const char16_t gSlash = 0x002f;
+static const char16_t gGreaterThan = 0x003e;
+static const char16_t gLessThan = 0x003c;
+static const char16_t gComma = 0x002c;
+static const char16_t gDot = 0x002e;
+static const char16_t gTick = 0x0027;
+//static const char16_t gMinus = 0x002d;
+static const char16_t gSemicolon = 0x003b;
+static const char16_t gX = 0x0078;
+
+static const char16_t gMinusX[] =                  {0x2D, 0x78, 0};    /* "-x" */
+static const char16_t gInf[] =                     {0x49, 0x6E, 0x66, 0}; /* "Inf" */
+static const char16_t gNaN[] =                     {0x4E, 0x61, 0x4E, 0}; /* "NaN" */
+
+static const char16_t gDollarOpenParenthesis[] =   {0x24, 0x28, 0}; /* "$(" */
+static const char16_t gClosedParenthesisDollar[] = {0x29, 0x24, 0}; /* ")$" */
+
+static const char16_t gLessLess[] =                {0x3C, 0x3C, 0};    /* "<<" */
+static const char16_t gLessPercent[] =             {0x3C, 0x25, 0};    /* "<%" */
+static const char16_t gLessHash[] =                {0x3C, 0x23, 0};    /* "<#" */
+static const char16_t gLessZero[] =                {0x3C, 0x30, 0};    /* "<0" */
+static const char16_t gGreaterGreater[] =          {0x3E, 0x3E, 0};    /* ">>" */
+static const char16_t gGreaterPercent[] =          {0x3E, 0x25, 0};    /* ">%" */
+static const char16_t gGreaterHash[] =             {0x3E, 0x23, 0};    /* ">#" */
+static const char16_t gGreaterZero[] =             {0x3E, 0x30, 0};    /* ">0" */
+static const char16_t gEqualPercent[] =            {0x3D, 0x25, 0};    /* "=%" */
+static const char16_t gEqualHash[] =               {0x3D, 0x23, 0};    /* "=#" */
+static const char16_t gEqualZero[] =               {0x3D, 0x30, 0};    /* "=0" */
+static const char16_t gGreaterGreaterGreater[] =   {0x3E, 0x3E, 0x3E, 0}; /* ">>>" */
+
+static const char16_t * const RULE_PREFIXES[] = {
     gLessLess, gLessPercent, gLessHash, gLessZero,
     gGreaterGreater, gGreaterPercent,gGreaterHash, gGreaterZero,
     gEqualPercent, gEqualHash, gEqualZero, nullptr
@@ -270,8 +270,8 @@ NFRule::parseRuleDescriptor(UnicodeString& description, UErrorCode& status)
         // for one of the special rules.  If it does, set the base
         // value to the correct identifier value
         int descriptorLength = descriptor.length();
-        UChar firstChar = descriptor.charAt(0);
-        UChar lastChar = descriptor.charAt(descriptorLength - 1);
+        char16_t firstChar = descriptor.charAt(0);
+        char16_t lastChar = descriptor.charAt(descriptorLength - 1);
         if (firstChar >= gZero && firstChar <= gNine && lastChar != gX) {
             // if the rule descriptor begins with a digit, it's a descriptor
             // for a normal rule
@@ -279,7 +279,7 @@ NFRule::parseRuleDescriptor(UnicodeString& description, UErrorCode& status)
             // just build up the value as we encounter the digits.
             int64_t val = 0;
             p = 0;
-            UChar c = gSpace;
+            char16_t c = gSpace;
 
             // begin parsing the descriptor: copy digits
             // into "tempValue", skip periods, commas, and spaces,
@@ -490,7 +490,7 @@ NFRule::extractSubstitution(const NFRuleSet* ruleSet,
         // otherwise the substitution token ends with the same character
         // it began with
     } else {
-        UChar c = fRuleText.charAt(subStart);
+        char16_t c = fRuleText.charAt(subStart);
         subEnd = fRuleText.indexOf(c, subStart + 1);
         // special case for '<%foo<<'
         if (c == gLessThan && subEnd != -1 && subEnd < fRuleText.length() - 1 && fRuleText.charAt(subEnd+1) == c) {
@@ -650,7 +650,7 @@ NFRule::operator==(const NFRule& rhs) const
 */
 static void util_append64(UnicodeString& result, int64_t n)
 {
-    UChar buffer[256];
+    char16_t buffer[256];
     int32_t len = util64_tou(n, buffer, sizeof(buffer));
     UnicodeString temp(buffer, len);
     result.append(temp);
index 5e615e485c807758b709512ace65dbea0cc9504e..fda74fabf2c578a9747e928f7c615bfe654004b0 100644 (file)
@@ -63,7 +63,7 @@ public:
     int64_t getBaseValue() const { return baseValue; }
     void setBaseValue(int64_t value, UErrorCode& status);
 
-    UChar getDecimalPoint() const { return decimalPoint; }
+    char16_t getDecimalPoint() const { return decimalPoint; }
 
     int64_t getDivisor() const;
 
@@ -108,7 +108,7 @@ private:
     int64_t baseValue;
     int32_t radix;
     int16_t exponent;
-    UChar decimalPoint;
+    char16_t decimalPoint;
     UnicodeString fRuleText;
     NFSubstitution* sub1;
     NFSubstitution* sub2;
index 113bb529ee6471955ae73fa6be9f6245dfdad0d9..48de7dadc0c2b22ca12da8f33724def2f4d101b6 100644 (file)
 
 #if U_HAVE_RBNF
 
-static const UChar gLessThan = 0x003c;
-static const UChar gEquals = 0x003d;
-static const UChar gGreaterThan = 0x003e;
-static const UChar gPercent = 0x0025;
-static const UChar gPound = 0x0023;
-static const UChar gZero = 0x0030;
-static const UChar gSpace = 0x0020;
-
-static const UChar gEqualsEquals[] =
+static const char16_t gLessThan = 0x003c;
+static const char16_t gEquals = 0x003d;
+static const char16_t gGreaterThan = 0x003e;
+static const char16_t gPercent = 0x0025;
+static const char16_t gPound = 0x0023;
+static const char16_t gZero = 0x0030;
+static const char16_t gSpace = 0x0020;
+
+static const char16_t gEqualsEquals[] =
 {
     0x3D, 0x3D, 0
 }; /* "==" */
-static const UChar gGreaterGreaterGreaterThan[] =
+static const char16_t gGreaterGreaterGreaterThan[] =
 {
     0x3E, 0x3E, 0x3E, 0
 }; /* ">>>" */
-static const UChar gGreaterGreaterThan[] =
+static const char16_t gGreaterGreaterThan[] =
 {
     0x3E, 0x3E, 0
 }; /* ">>" */
@@ -62,7 +62,7 @@ public:
     virtual double transformNumber(double number) const override { return number; }
     virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const override { return newRuleValue; }
     virtual double calcUpperBound(double oldUpperBound) const override { return oldUpperBound; }
-    virtual UChar tokenChar() const override { return (UChar)0x003d; } // '='
+    virtual char16_t tokenChar() const override { return (char16_t)0x003d; } // '='
 
 public:
     static UClassID getStaticClassID(void);
@@ -116,7 +116,7 @@ public:
 
     virtual double calcUpperBound(double /*oldUpperBound*/) const override { return static_cast<double>(divisor); }
 
-    virtual UChar tokenChar() const override { return (UChar)0x003c; } // '<'
+    virtual char16_t tokenChar() const override { return (char16_t)0x003c; } // '<'
 
 public:
     static UClassID getStaticClassID(void);
@@ -169,7 +169,7 @@ public:
 
     virtual UBool isModulusSubstitution() const override { return true; }
 
-    virtual UChar tokenChar() const override { return (UChar)0x003e; } // '>'
+    virtual char16_t tokenChar() const override { return (char16_t)0x003e; } // '>'
 
     virtual void toString(UnicodeString& result) const override;
 
@@ -193,7 +193,7 @@ public:
     virtual double transformNumber(double number) const override { return uprv_floor(number); }
     virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return newRuleValue + oldRuleValue; }
     virtual double calcUpperBound(double /*oldUpperBound*/) const override { return DBL_MAX; }
-    virtual UChar tokenChar() const override { return (UChar)0x003c; } // '<'
+    virtual char16_t tokenChar() const override { return (char16_t)0x003c; } // '<'
 
 public:
     static UClassID getStaticClassID(void);
@@ -230,7 +230,7 @@ public:
 
     virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return newRuleValue + oldRuleValue; }
     virtual double calcUpperBound(double /*oldUpperBound*/) const override { return 0.0; }
-    virtual UChar tokenChar() const override { return (UChar)0x003e; } // '>'
+    virtual char16_t tokenChar() const override { return (char16_t)0x003e; } // '>'
 
 public:
     static UClassID getStaticClassID(void);
@@ -252,7 +252,7 @@ public:
     virtual double transformNumber(double number) const override { return uprv_fabs(number); }
     virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const override { return -newRuleValue; }
     virtual double calcUpperBound(double /*oldUpperBound*/) const override { return DBL_MAX; }
-    virtual UChar tokenChar() const override { return (UChar)0x003e; } // '>'
+    virtual char16_t tokenChar() const override { return (char16_t)0x003e; } // '>'
 
 public:
     static UClassID getStaticClassID(void);
@@ -302,9 +302,9 @@ public:
 
     virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return newRuleValue / oldRuleValue; }
     virtual double calcUpperBound(double /*oldUpperBound*/) const override { return denominator; }
-    virtual UChar tokenChar() const override { return (UChar)0x003c; } // '<'
+    virtual char16_t tokenChar() const override { return (char16_t)0x003c; } // '<'
 private:
-    static const UChar LTLT[2];
+    static const char16_t LTLT[2];
 
 public:
     static UClassID getStaticClassID(void);
@@ -1334,7 +1334,7 @@ NumeratorSubstitution::operator==(const NFSubstitution& rhs) const
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NumeratorSubstitution)
 
-const UChar NumeratorSubstitution::LTLT[] = { 0x003c, 0x003c };
+const char16_t NumeratorSubstitution::LTLT[] = { 0x003c, 0x003c };
         
 U_NAMESPACE_END
 
index a38a3722a59d243b94711852fea910d280e1bc3c..e36f3a668bffadb3a1f872844650f67fc2a7eec4 100644 (file)
@@ -234,7 +234,7 @@ public:
      * substitutions of this type.  Used by toString().
      * @return This substitution's token character.
      */
-    virtual UChar tokenChar() const = 0;
+    virtual char16_t tokenChar() const = 0;
     
     /**
      * Returns true if this is a modulus substitution.  (We didn't do this
index bc08989fc95d63485e13438bbbe79c32ed8ef206..155f28afaffbacbbecc629aa8b0dfbc6339e76fa 100644 (file)
@@ -108,7 +108,7 @@ const DecimalQuantity* icu::number::impl::validateUFormattedNumberToDecimalQuant
 
 
 U_CAPI UNumberFormatter* U_EXPORT2
-unumf_openForSkeletonAndLocale(const UChar* skeleton, int32_t skeletonLen, const char* locale,
+unumf_openForSkeletonAndLocale(const char16_t* skeleton, int32_t skeletonLen, const char* locale,
                                UErrorCode* ec) {
     auto* impl = new UNumberFormatterData();
     if (impl == nullptr) {
@@ -122,7 +122,7 @@ unumf_openForSkeletonAndLocale(const UChar* skeleton, int32_t skeletonLen, const
 }
 
 U_CAPI UNumberFormatter* U_EXPORT2
-unumf_openForSkeletonAndLocaleWithError(const UChar* skeleton, int32_t skeletonLen, const char* locale,
+unumf_openForSkeletonAndLocaleWithError(const char16_t* skeleton, int32_t skeletonLen, const char* locale,
                                          UParseError* perror, UErrorCode* ec) {
     auto* impl = new UNumberFormatterData();
     if (impl == nullptr) {
@@ -176,7 +176,7 @@ unumf_formatDecimal(const UNumberFormatter* uformatter, const char* value, int32
 }
 
 U_CAPI int32_t U_EXPORT2
-unumf_resultToString(const UFormattedNumber* uresult, UChar* buffer, int32_t bufferCapacity,
+unumf_resultToString(const UFormattedNumber* uresult, char16_t* buffer, int32_t bufferCapacity,
                      UErrorCode* ec) {
     const auto* result = UFormattedNumberApiHelper::validate(uresult, *ec);
     if (U_FAILURE(*ec)) { return 0; }
index 4dc96e7ea1b91e852fadf410c774ed94a91e1ab9..2cfa65a031ddde06551d36a856579a30ca9eb461 100644 (file)
@@ -22,7 +22,7 @@ namespace {
 
 // A dummy object used when a "0" compact decimal entry is encountered. This is necessary
 // in order to prevent falling back to root. Object equality ("==") is intended.
-const UChar *USE_FALLBACK = u"<USE FALLBACK>";
+const char16_t *USE_FALLBACK = u"<USE FALLBACK>";
 
 /** Produces a string like "NumberElements/latn/patternsShort/decimalFormat". */
 void getResourceBundleKey(const char *nsName, CompactStyle compactStyle, CompactType compactType,
@@ -38,7 +38,7 @@ int32_t getIndex(int32_t magnitude, StandardPlural::Form plural) {
     return magnitude * StandardPlural::COUNT + plural;
 }
 
-int32_t countZeros(const UChar *patternString, int32_t patternLength) {
+int32_t countZeros(const char16_t *patternString, int32_t patternLength) {
     // NOTE: This strategy for computing the number of zeros is a hack for efficiency.
     // It could break if there are any 0s that aren't part of the main pattern.
     int32_t numZeros = 0;
@@ -104,7 +104,7 @@ int32_t CompactData::getMultiplier(int32_t magnitude) const {
     return multipliers[magnitude];
 }
 
-const UChar *CompactData::getPattern(
+const char16_t *CompactData::getPattern(
         int32_t magnitude,
         const PluralRules *rules,
         const DecimalQuantity &dq) const {
@@ -114,7 +114,7 @@ const UChar *CompactData::getPattern(
     if (magnitude > largestMagnitude) {
         magnitude = largestMagnitude;
     }
-    const UChar *patternString = nullptr;
+    const char16_t *patternString = nullptr;
     if (dq.hasIntegerValue()) {
         int64_t i = dq.toLong(true);
         if (i == 0) {
@@ -151,14 +151,14 @@ void CompactData::getUniquePatterns(UVector &output, UErrorCode &status) const {
         // Insert pattern into the UVector if the UVector does not already contain the pattern.
         // Search the UVector from the end since identical patterns are likely to be adjacent.
         for (int32_t i = output.size() - 1; i >= 0; i--) {
-            if (u_strcmp(pattern, static_cast<const UChar *>(output[i])) == 0) {
+            if (u_strcmp(pattern, static_cast<const char16_t *>(output[i])) == 0) {
                 goto continue_outer;
             }
         }
 
         // The string was not found; add it to the UVector.
         // Note: must cast off const from pattern to store it in a UVector, which expects (void *)
-        output.addElement(const_cast<UChar *>(pattern), status);
+        output.addElement(const_cast<char16_t *>(pattern), status);
 
         continue_outer:
         continue;
@@ -197,7 +197,7 @@ void CompactData::CompactDataSink::put(const char *key, ResourceValue &value, UB
             // The value "0" means that we need to use the default pattern and not fall back
             // to parent locales. Example locale where this is relevant: 'it'.
             int32_t patternLength;
-            const UChar *patternString = value.getString(patternLength, status);
+            const char16_t *patternString = value.getString(patternLength, status);
             if (U_FAILURE(status)) { return; }
             if (u_strcmp(patternString, u"0") == 0) {
                 patternString = USE_FALLBACK;
@@ -279,7 +279,7 @@ void CompactHandler::precomputeAllModifiers(MutablePatternModifier &buildReferen
     }
 
     for (int32_t i = 0; i < precomputedModsLength; i++) {
-        auto patternString = static_cast<const UChar *>(allPatterns[i]);
+        auto patternString = static_cast<const char16_t *>(allPatterns[i]);
         UnicodeString hello(patternString);
         CompactModInfo &info = precomputedMods[i];
         ParsedPatternInfo patternInfo;
@@ -310,7 +310,7 @@ void CompactHandler::processQuantity(DecimalQuantity &quantity, MicroProps &micr
         magnitude -= multiplier;
     }
 
-    const UChar *patternString = data.getPattern(magnitude, rules, quantity);
+    const char16_t *patternString = data.getPattern(magnitude, rules, quantity);
     if (patternString == nullptr) {
         // Use the default (non-compact) modifier.
         // No need to take any action.
index fa29744c103a3827d493ef5ec0efe16c58315275..3c05e0d3bd577c76e770593dbe77ad15e7553c11 100644 (file)
@@ -28,7 +28,7 @@ class CompactData : public MultiplierProducer {
 
     int32_t getMultiplier(int32_t magnitude) const U_OVERRIDE;
 
-    const UChar *getPattern(
+    const char16_t *getPattern(
         int32_t magnitude,
         const PluralRules *rules,
         const DecimalQuantity &dq) const;
@@ -36,7 +36,7 @@ class CompactData : public MultiplierProducer {
     void getUniquePatterns(UVector &output, UErrorCode &status) const;
 
   private:
-    const UChar *patterns[(COMPACT_MAX_DIGITS + 1) * StandardPlural::COUNT];
+    const char16_t *patterns[(COMPACT_MAX_DIGITS + 1) * StandardPlural::COUNT];
     int8_t multipliers[COMPACT_MAX_DIGITS + 1];
     int8_t largestMagnitude;
     UBool isEmpty;
@@ -54,7 +54,7 @@ class CompactData : public MultiplierProducer {
 
 struct CompactModInfo {
     const ImmutablePatternModifier *mod;
-    const UChar* patternString;
+    const char16_t* patternString;
 };
 
 class CompactHandler : public MicroPropsGenerator, public UMemory {
index 237abdde311317021d672a5470ca84db40d64852..abeec2bcad439ffe73a158df15796cf67f71f878 100644 (file)
@@ -151,7 +151,7 @@ enum PlaceholderPosition { PH_EMPTY, PH_NONE, PH_BEGINNING, PH_MIDDLE, PH_END };
 void extractCorePattern(const UnicodeString &pattern,
                         UnicodeString &coreUnit,
                         PlaceholderPosition &placeholderPosition,
-                        UChar &joinerChar) {
+                        char16_t &joinerChar) {
     joinerChar = 0;
     int32_t len = pattern.length();
     if (pattern.startsWith(u"{0}", 3)) {
@@ -209,7 +209,7 @@ getGenderForBuiltin(const Locale &locale, const MeasureUnit &builtinUnit, UError
 
     UErrorCode localStatus = status;
     int32_t resultLen = 0;
-    const UChar *result =
+    const char16_t *result =
         ures_getStringByKeyWithFallback(unitsBundle.getAlias(), key.data(), &resultLen, &localStatus);
     if (U_SUCCESS(localStatus)) {
         status = localStatus;
@@ -560,7 +560,7 @@ UnicodeString getCompoundValue(StringPiece compoundKey,
 
     UErrorCode localStatus = status;
     int32_t len = 0;
-    const UChar *ptr =
+    const char16_t *ptr =
         ures_getStringByKeyWithFallback(unitsBundle.getAlias(), key.data(), &len, &localStatus);
     if (U_FAILURE(localStatus) && width != UNUM_UNIT_WIDTH_SHORT) {
         // Fall back to short, which contains more compound data
@@ -759,7 +759,7 @@ UnicodeString getDerivedGender(Locale locale,
 ////////////////////////
 
 // TODO: promote this somewhere? It's based on patternprops.cpp' trimWhitespace
-const UChar *trimSpaceChars(const UChar *s, int32_t &length) {
+const char16_t *trimSpaceChars(const char16_t *s, int32_t &length) {
     if (length <= 0 || (!u_isJavaSpaceChar(s[0]) && !u_isJavaSpaceChar(s[length - 1]))) {
         return s;
     }
@@ -1053,7 +1053,7 @@ void LongNameHandler::forArbitraryUnit(const Locale &loc,
         }
         UnicodeString denominatorPattern = denominatorFormatter.getTextWithNoArguments();
         int32_t trimmedLen = denominatorPattern.length();
-        const UChar *trimmed = trimSpaceChars(denominatorPattern.getBuffer(), trimmedLen);
+        const char16_t *trimmed = trimSpaceChars(denominatorPattern.getBuffer(), trimmedLen);
         UnicodeString denominatorString(false, trimmed, trimmedLen);
         // 9. If the denominatorString is empty, set result to
         //    [numeratorString], otherwise set result to format(perPattern,
@@ -1144,7 +1144,7 @@ void LongNameHandler::processPatternTimes(MeasureUnitImpl &&productUnit,
     }
 
     PlaceholderPosition globalPlaceholder[ARRAY_LENGTH];
-    UChar globalJoinerChar = 0;
+    char16_t globalJoinerChar = 0;
     // Numbered list items are from the algorithms at
     // https://unicode.org/reports/tr35/tr35-general.html#compound-units:
     //
@@ -1341,7 +1341,7 @@ void LongNameHandler::processPatternTimes(MeasureUnitImpl &&productUnit,
             // 4.6. Extract(corePattern, coreUnit, placeholder, placeholderPosition) from that pattern.
             UnicodeString coreUnit;
             PlaceholderPosition placeholderPosition;
-            UChar joinerChar;
+            char16_t joinerChar;
             extractCorePattern(getWithPlural(singleUnitArray, plural, status), coreUnit,
                                placeholderPosition, joinerChar);
 
index 557a7320856562c6dddfeeec5dba509ec34e6f3e..aa082be5a8732ebbabfee6bd65230b6ec5fbba1a 100644 (file)
@@ -968,7 +968,7 @@ PatternStringUtils::convertLocalized(const UnicodeString& input, const DecimalFo
     UnicodeString result;
     int state = 0;
     for (int offset = 0; offset < input.length(); offset++) {
-        UChar ch = input.charAt(offset);
+        char16_t ch = input.charAt(offset);
 
         // Handle a quote character (state shift)
         if (ch == u'\'') {
index a9b3f16c050d946c9084fe2dd3b5c567726e185f..e6bb509ffd75a409faa03ea471bb97b84d2f61de 100644 (file)
@@ -28,7 +28,7 @@ using icu::StringSegment;
 void number::impl::parseIncrementOption(const StringSegment &segment,
                                         Precision &outPrecision,
                                         UErrorCode &status) {
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     U_ASSERT(U_SUCCESS(status));
     CharString buffer;
     SKELETON_UCHAR_TO_CHAR(buffer, segment.toTempUnicodeString(), 0, segment.length(), status);
index 3db50369cb667b64404e70e6572d3594c090de1e..ef3befbffad365306672319cbb88adeff1f3abc3 100644 (file)
@@ -1022,7 +1022,7 @@ void blueprint_helpers::parseCurrencyOption(const StringSegment& segment, MacroP
         status = U_NUMBER_SKELETON_SYNTAX_ERROR;
         return;
     }
-    const UChar* currencyCode = segment.toTempUnicodeString().getBuffer();
+    const char16_t* currencyCode = segment.toTempUnicodeString().getBuffer();
     UErrorCode localStatus = U_ZERO_ERROR;
     CurrencyUnit currency(currencyCode, localStatus);
     if (U_FAILURE(localStatus)) {
@@ -1057,7 +1057,7 @@ void blueprint_helpers::parseMeasureUnitOption(const StringSegment& segment, Mac
         return;
     }
 
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     CharString type;
     SKELETON_UCHAR_TO_CHAR(type, stemString, 0, firstHyphen, status);
     CharString subType;
@@ -1098,7 +1098,7 @@ void blueprint_helpers::parseMeasurePerUnitOption(const StringSegment& segment,
 
 void blueprint_helpers::parseIdentifierUnitOption(const StringSegment& segment, MacroProps& macros,
                                                   UErrorCode& status) {
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     U_ASSERT(U_SUCCESS(status));
     CharString buffer;
     SKELETON_UCHAR_TO_CHAR(buffer, segment.toTempUnicodeString(), 0, segment.length(), status);
@@ -1114,7 +1114,7 @@ void blueprint_helpers::parseIdentifierUnitOption(const StringSegment& segment,
 
 void blueprint_helpers::parseUnitUsageOption(const StringSegment &segment, MacroProps &macros,
                                              UErrorCode &status) {
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     U_ASSERT(U_SUCCESS(status));
     CharString buffer;
     SKELETON_UCHAR_TO_CHAR(buffer, segment.toTempUnicodeString(), 0, segment.length(), status);
@@ -1466,7 +1466,7 @@ void blueprint_helpers::generateIntegerWidthOption(int32_t minInt, int32_t maxIn
 
 void blueprint_helpers::parseNumberingSystemOption(const StringSegment& segment, MacroProps& macros,
                                                    UErrorCode& status) {
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     U_ASSERT(U_SUCCESS(status));
     CharString buffer;
     SKELETON_UCHAR_TO_CHAR(buffer, segment.toTempUnicodeString(), 0, segment.length(), status);
@@ -1483,13 +1483,13 @@ void blueprint_helpers::parseNumberingSystemOption(const StringSegment& segment,
 
 void blueprint_helpers::generateNumberingSystemOption(const NumberingSystem& ns, UnicodeString& sb,
                                                       UErrorCode&) {
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     sb.append(UnicodeString(ns.getName(), -1, US_INV));
 }
 
 void blueprint_helpers::parseScaleOption(const StringSegment& segment, MacroProps& macros,
                                               UErrorCode& status) {
-    // Need to do char <-> UChar conversion...
+    // Need to do char <-> char16_t conversion...
     U_ASSERT(U_SUCCESS(status));
     CharString buffer;
     SKELETON_UCHAR_TO_CHAR(buffer, segment.toTempUnicodeString(), 0, segment.length(), status);
index fd8788317990bcc63c826289d1810362ac8ee00f..fa8eb1f483ca1e2b4450f3638c48501bc0d0e99b 100644 (file)
@@ -74,32 +74,32 @@ static inline void debugout(UnicodeString s) {
 
 // If no number pattern can be located for a locale, this is the last
 // resort. The patterns are same as the ones in root locale.
-static const UChar gLastResortDecimalPat[] = {
+static const char16_t gLastResortDecimalPat[] = {
     0x23, 0x2C, 0x23, 0x23, 0x30, 0x2E, 0x23, 0x23, 0x23, 0 /* "#,##0.###" */
 };
-static const UChar gLastResortCurrencyPat[] = {
+static const char16_t gLastResortCurrencyPat[] = {
     0xA4, 0xA0, 0x23, 0x2C, 0x23, 0x23, 0x30, 0x2E, 0x30, 0x30, 0 /* "\u00A4\u00A0#,##0.00" */
 };
-static const UChar gLastResortPercentPat[] = {
+static const char16_t gLastResortPercentPat[] = {
     0x23, 0x2C, 0x23, 0x23, 0x30, 0x25, 0 /* "#,##0%" */
 };
-static const UChar gLastResortScientificPat[] = {
+static const char16_t gLastResortScientificPat[] = {
     0x23, 0x45, 0x30, 0 /* "#E0" */
 };
-static const UChar gLastResortIsoCurrencyPat[] = {
+static const char16_t gLastResortIsoCurrencyPat[] = {
     0xA4, 0xA4, 0xA0, 0x23, 0x2C, 0x23, 0x23, 0x30, 0x2E, 0x30, 0x30, 0  /* "\u00A4\u00A4\u00A0#,##0.00" */
 };
-static const UChar gLastResortPluralCurrencyPat[] = {
+static const char16_t gLastResortPluralCurrencyPat[] = {
     0x23, 0x2C, 0x23, 0x23, 0x30, 0x2E, 0x23, 0x23, 0x23, 0x20, 0xA4, 0xA4, 0xA4, 0 /* "#,##0.### \u00A4\u00A4\u00A4*/
 };
-static const UChar gLastResortAccountingCurrencyPat[] =  {
+static const char16_t gLastResortAccountingCurrencyPat[] =  {
     0xA4, 0xA0, 0x23, 0x2C, 0x23, 0x23, 0x30, 0x2E, 0x30, 0x30, 0 /* "\u00A4\u00A0#,##0.00" */
 };
 
-static const UChar gSingleCurrencySign[] = {0xA4, 0};
-static const UChar gDoubleCurrencySign[] = {0xA4, 0xA4, 0};
+static const char16_t gSingleCurrencySign[] = {0xA4, 0};
+static const char16_t gDoubleCurrencySign[] = {0xA4, 0xA4, 0};
 
-static const UChar gSlash = 0x2f;
+static const char16_t gSlash = 0x2f;
 
 // If the maximum base 10 exponent were 4, then the largest number would
 // be 99,999 which has 5 digits.
@@ -108,7 +108,7 @@ static const UChar gSlash = 0x2f;
 const int32_t icu::NumberFormat::gDefaultMaxIntegerDigits = 2000000000;
 const int32_t icu::NumberFormat::gDefaultMinIntegerDigits = 127;
 
-static const UChar * const gLastResortNumberPatterns[UNUM_FORMAT_STYLE_COUNT] = {
+static const char16_t * const gLastResortNumberPatterns[UNUM_FORMAT_STYLE_COUNT] = {
     nullptr,  // UNUM_PATTERN_DECIMAL
     gLastResortDecimalPat,  // UNUM_DECIMAL
     gLastResortCurrencyPat,  // UNUM_CURRENCY
@@ -474,7 +474,7 @@ NumberFormat::format(StringPiece decimalNum,
 */
 class ArgExtractor {
   const Formattable* num;
-  UChar save[4];
+  char16_t save[4];
   UBool fWasCurrency;
 
  public:
@@ -482,7 +482,7 @@ class ArgExtractor {
   ~ArgExtractor();
 
   const Formattable* number(void) const;
-  const UChar *iso(void) const;
+  const char16_t *iso(void) const;
   UBool wasCurrency(void) const;
 };
 
@@ -496,7 +496,7 @@ ArgExtractor::wasCurrency(void) const {
   return fWasCurrency;
 }
 
-inline const UChar *
+inline const char16_t *
 ArgExtractor::iso(void) const {
   return save;
 }
@@ -509,7 +509,7 @@ ArgExtractor::ArgExtractor(const NumberFormat& /*nf*/, const Formattable& obj, U
     if (o != nullptr && (amt = dynamic_cast<const CurrencyAmount*>(o)) != nullptr) {
         // getISOCurrency() returns a pointer to internal storage, so we
         // copy it to retain it across the call to setCurrency().
-        //const UChar* curr = amt->getISOCurrency();
+        //const char16_t* curr = amt->getISOCurrency();
         u_strcpy(save, amt->getISOCurrency());
         num = &amt->getNumber();
         fWasCurrency=true;
@@ -564,7 +564,7 @@ NumberFormat::format(const Formattable& obj,
 
     ArgExtractor arg(*this, obj, status);
     const Formattable *n = arg.number();
-    const UChar *iso = arg.iso();
+    const char16_t *iso = arg.iso();
 
     if(arg.wasCurrency() && u_strcmp(iso, getCurrency())) {
       // trying to format a different currency.
@@ -619,7 +619,7 @@ NumberFormat::format(const Formattable& obj,
 
     ArgExtractor arg(*this, obj, status);
     const Formattable *n = arg.number();
-    const UChar *iso = arg.iso();
+    const char16_t *iso = arg.iso();
 
     if(arg.wasCurrency() && u_strcmp(iso, getCurrency())) {
       // trying to format a different currency.
@@ -733,7 +733,7 @@ CurrencyAmount* NumberFormat::parseCurrency(const UnicodeString& text,
     int32_t start = pos.getIndex();
     parse(text, parseResult, pos);
     if (pos.getIndex() != start) {
-        UChar curr[4];
+        char16_t curr[4];
         UErrorCode ec = U_ZERO_ERROR;
         getEffectiveCurrency(curr, ec);
         if (U_SUCCESS(ec)) {
@@ -1177,7 +1177,7 @@ NumberFormat::setMinimumFractionDigits(int32_t newValue)
 
 // -------------------------------------
 
-void NumberFormat::setCurrency(const UChar* theCurrency, UErrorCode& ec) {
+void NumberFormat::setCurrency(const char16_t* theCurrency, UErrorCode& ec) {
     if (U_FAILURE(ec)) {
         return;
     }
@@ -1193,8 +1193,8 @@ const char16_t* NumberFormat::getCurrency() const {
     return fCurrency;
 }
 
-void NumberFormat::getEffectiveCurrency(UChar* result, UErrorCode& ec) const {
-    const UChar* c = getCurrency();
+void NumberFormat::getEffectiveCurrency(char16_t* result, UErrorCode& ec) const {
+    const char16_t* c = getCurrency();
     if (*c != 0) {
         u_strncpy(result, c, 3);
         result[3] = 0;
@@ -1422,7 +1422,7 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
     }
     if(style==UNUM_CURRENCY || style == UNUM_CURRENCY_ISO || style == UNUM_CURRENCY_ACCOUNTING 
         || style == UNUM_CASH_CURRENCY || style == UNUM_CURRENCY_STANDARD){
-        const UChar* currPattern = symbolsToAdopt->getCurrencyPattern();
+        const char16_t* currPattern = symbolsToAdopt->getCurrencyPattern();
         if(currPattern!=nullptr){
             pattern.setTo(currPattern, u_strlen(currPattern));
         }
index ad731ed5d80e94a85ddba9048c7ecae61315a200..81b633c2626c38ed1a742d842245035dd7c1c48c 100644 (file)
@@ -53,7 +53,7 @@ class U_I18N_API CodePointMatcher : public NumberParseMatcher, public UMemory {
 // Note: These need to be outside of the numparse::impl namespace, or Clang will generate a compile error.
 #if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
 template class U_I18N_API MaybeStackArray<numparse::impl::CodePointMatcher*, 8>; 
-template class U_I18N_API MaybeStackArray<UChar, 4>;
+template class U_I18N_API MaybeStackArray<char16_t, 4>;
 template class U_I18N_API MemoryPool<numparse::impl::CodePointMatcher, 8>;
 template class U_I18N_API numparse::impl::CompactUnicodeString<4>;
 #endif
index a94943312fde9dfc8180dd5192cd520151453370..4e99334a31bc782490aaf07f7868452e800d1b4e 100644 (file)
@@ -44,7 +44,7 @@ class U_I18N_API CombinedCurrencyMatcher : public NumberParseMatcher, public UMe
     UnicodeString toString() const override;
 
   private:
-    UChar fCurrencyCode[4];
+    char16_t fCurrencyCode[4];
     UnicodeString fCurrency1;
     UnicodeString fCurrency2;
 
index 623f0e80f1668a574f1657a7e09da55d511ec944..8e881793fd3e8c6e6e9acefdeefc9d4bc731d46d 100644 (file)
@@ -67,7 +67,7 @@ class CompactUnicodeString {
     CompactUnicodeString(const UnicodeString& text, UErrorCode& status)
             : fBuffer(text.length() + 1, status) {
         if (U_FAILURE(status)) { return; }
-        uprv_memcpy(fBuffer.getAlias(), text.getBuffer(), sizeof(UChar) * text.length());
+        uprv_memcpy(fBuffer.getAlias(), text.getBuffer(), sizeof(char16_t) * text.length());
         fBuffer[text.length()] = 0;
     }
 
@@ -81,7 +81,7 @@ class CompactUnicodeString {
     }
 
   private:
-    MaybeStackArray<UChar, stackCapacity> fBuffer;
+    MaybeStackArray<char16_t, stackCapacity> fBuffer;
 };
 
 
@@ -125,7 +125,7 @@ class U_I18N_API ParsedNumber {
     /**
      * The currency that got consumed.
      */
-    UChar currencyCode[4];
+    char16_t currencyCode[4];
 
     ParsedNumber();
 
index 162954bae0944443cb4028c215918a4f814ecaa3..8fda4f4369b071bf0485a861c69b9af479e1b133 100644 (file)
@@ -28,8 +28,8 @@ inline static void putLeadCodePoint(const UnicodeString& input, UnicodeSet* outp
     }
 }
 
-inline static void copyCurrencyCode(UChar* dest, const UChar* src) {
-    uprv_memcpy(dest, src, sizeof(UChar) * 3);
+inline static void copyCurrencyCode(char16_t* dest, const char16_t* src) {
+    uprv_memcpy(dest, src, sizeof(char16_t) * 3);
     dest[3] = 0;
 }
 
index bd3a9ef5e82528c65aac0eafead899f82b9d5dc0..5f1d45854dfcac0ecefd5ca956330e3ae212533f 100644 (file)
@@ -83,7 +83,7 @@ const UFormattedNumberRangeData* number::impl::validateUFormattedNumberRange(
 
 U_CAPI UNumberRangeFormatter* U_EXPORT2
 unumrf_openForSkeletonWithCollapseAndIdentityFallback(
-        const UChar* skeleton,
+        const char16_t* skeleton,
         int32_t skeletonLen,
         UNumberRangeCollapse collapse,
         UNumberRangeIdentityFallback identityFallback,
index 015d2a4cb69a6ea3685d667c0d640359e56939d1..0d5c43e4b2744436a221826f81153e6ecc60afb8 100644 (file)
@@ -149,7 +149,7 @@ NumberingSystem::createInstance(const Locale & inLocale, UErrorCode& status) {
         while (!nsResolved) {
             localStatus = U_ZERO_ERROR;
             count = 0;
-            const UChar *nsName = ures_getStringByKeyWithFallback(numberElementsRes.getAlias(), buffer, &count, &localStatus);
+            const char16_t *nsName = ures_getStringByKeyWithFallback(numberElementsRes.getAlias(), buffer, &count, &localStatus);
             // Don't stomp on the catastrophic failure of OOM.
             if (localStatus == U_MEMORY_ALLOCATION_ERROR) {
                 status = U_MEMORY_ALLOCATION_ERROR;
index b651115595143a23baf5705938c78f5dc72b0cc1..d1d01463f16e1e2a443758bfa45f4635124a7bec 100644 (file)
@@ -198,7 +198,7 @@ OlsonTimeZone::OlsonTimeZone(const UResourceBundle* top,
 
         // Process final rule and data, if any
         if (U_SUCCESS(ec)) {
-            const UChar *ruleIdUStr = ures_getStringByKey(res, kFINALRULE, &len, &ec);
+            const char16_t *ruleIdUStr = ures_getStringByKey(res, kFINALRULE, &len, &ec);
             ures_getByKey(res, kFINALRAW, r.getAlias(), &ec);
             int32_t ruleRaw = ures_getInt(r.getAlias(), &ec);
             ures_getByKey(res, kFINALYEAR, r.getAlias(), &ec);
index 728f94460efed50ca4b799ec99e88cc783e49c8c..06b24db317016791f6c5328bea532e296e67542e 100644 (file)
@@ -282,7 +282,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone {
      * Internal API returning the canonical ID of this zone.
      * This ID won't be affected by setID().
      */
-    const UChar *getCanonicalID() const;
+    const char16_t *getCanonicalID() const;
 
 private:
     /**
@@ -382,7 +382,7 @@ private:
     /*
      * Canonical (CLDR) ID of this zone
      */
-    const UChar *canonicalID;
+    const char16_t *canonicalID;
 
     /* BasicTimeZone support */
     void clearTransitionRules(void);
@@ -441,7 +441,7 @@ OlsonTimeZone::initialDstOffset() const {
     return typeOffsets[1];
 }
 
-inline const UChar*
+inline const char16_t*
 OlsonTimeZone::getCanonicalID() const {
     return canonicalID;
 }
index da10e2117d04ad42a42772d0ff347d8d8b996a66..6e7d0d3325828e3ffa2f7f94f750b417d63269fd 100644 (file)
@@ -66,7 +66,7 @@ void getPluralRangesData(const Locale& locale, StandardPluralRanges& output, UEr
     int32_t setLen;
     // Not all languages are covered: fail gracefully
     UErrorCode internalStatus = U_ZERO_ERROR;
-    const UChar* set = ures_getStringByKeyWithFallback(rb.getAlias(), dataPath.data(), &setLen, &internalStatus);
+    const char16_t* set = ures_getStringByKeyWithFallback(rb.getAlias(), dataPath.data(), &setLen, &internalStatus);
     if (U_FAILURE(internalStatus)) { return; }
 
     dataPath.clear();
index 5ce4d8b1b4f64badf96c27120f05e865a0e3b2e0..33a539cd198d6ac6680e3258956af68d8ef31568 100644 (file)
@@ -31,7 +31,7 @@ U_NAMESPACE_BEGIN
 
 using number::impl::DecimalQuantity;
 
-static const UChar OTHER_STRING[] = {
+static const char16_t OTHER_STRING[] = {
     0x6F, 0x74, 0x68, 0x65, 0x72, 0  // "other"
 };
 
index a76cb6c1fdbe638c8f7dad09d0026ab52e997815..9c37b09e2533f9513d50f985a890fdc11549175c 100644 (file)
@@ -50,24 +50,24 @@ using icu::number::impl::DecNum;
 using icu::number::impl::DecimalQuantity;
 using icu::number::impl::RoundingMode;
 
-static const UChar PLURAL_KEYWORD_OTHER[]={LOW_O,LOW_T,LOW_H,LOW_E,LOW_R,0};
-static const UChar PLURAL_DEFAULT_RULE[]={LOW_O,LOW_T,LOW_H,LOW_E,LOW_R,COLON,SPACE,LOW_N,0};
-static const UChar PK_IN[]={LOW_I,LOW_N,0};
-static const UChar PK_NOT[]={LOW_N,LOW_O,LOW_T,0};
-static const UChar PK_IS[]={LOW_I,LOW_S,0};
-static const UChar PK_MOD[]={LOW_M,LOW_O,LOW_D,0};
-static const UChar PK_AND[]={LOW_A,LOW_N,LOW_D,0};
-static const UChar PK_OR[]={LOW_O,LOW_R,0};
-static const UChar PK_VAR_N[]={LOW_N,0};
-static const UChar PK_VAR_I[]={LOW_I,0};
-static const UChar PK_VAR_F[]={LOW_F,0};
-static const UChar PK_VAR_T[]={LOW_T,0};
-static const UChar PK_VAR_E[]={LOW_E,0};
-static const UChar PK_VAR_C[]={LOW_C,0};
-static const UChar PK_VAR_V[]={LOW_V,0};
-static const UChar PK_WITHIN[]={LOW_W,LOW_I,LOW_T,LOW_H,LOW_I,LOW_N,0};
-static const UChar PK_DECIMAL[]={LOW_D,LOW_E,LOW_C,LOW_I,LOW_M,LOW_A,LOW_L,0};
-static const UChar PK_INTEGER[]={LOW_I,LOW_N,LOW_T,LOW_E,LOW_G,LOW_E,LOW_R,0};
+static const char16_t PLURAL_KEYWORD_OTHER[]={LOW_O,LOW_T,LOW_H,LOW_E,LOW_R,0};
+static const char16_t PLURAL_DEFAULT_RULE[]={LOW_O,LOW_T,LOW_H,LOW_E,LOW_R,COLON,SPACE,LOW_N,0};
+static const char16_t PK_IN[]={LOW_I,LOW_N,0};
+static const char16_t PK_NOT[]={LOW_N,LOW_O,LOW_T,0};
+static const char16_t PK_IS[]={LOW_I,LOW_S,0};
+static const char16_t PK_MOD[]={LOW_M,LOW_O,LOW_D,0};
+static const char16_t PK_AND[]={LOW_A,LOW_N,LOW_D,0};
+static const char16_t PK_OR[]={LOW_O,LOW_R,0};
+static const char16_t PK_VAR_N[]={LOW_N,0};
+static const char16_t PK_VAR_I[]={LOW_I,0};
+static const char16_t PK_VAR_F[]={LOW_F,0};
+static const char16_t PK_VAR_T[]={LOW_T,0};
+static const char16_t PK_VAR_E[]={LOW_E,0};
+static const char16_t PK_VAR_C[]={LOW_C,0};
+static const char16_t PK_VAR_V[]={LOW_V,0};
+static const char16_t PK_WITHIN[]={LOW_W,LOW_I,LOW_T,LOW_H,LOW_I,LOW_N,0};
+static const char16_t PK_DECIMAL[]={LOW_D,LOW_E,LOW_C,LOW_I,LOW_M,LOW_A,LOW_L,0};
+static const char16_t PK_INTEGER[]={LOW_I,LOW_N,LOW_T,LOW_E,LOW_G,LOW_E,LOW_R,0};
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(PluralRules)
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(PluralKeywordEnumeration)
@@ -822,7 +822,7 @@ PluralRules::getRuleFromResource(const Locale& locale, UPluralType type, UErrorC
     }
     int32_t resLen=0;
     const char *curLocaleName=locale.getBaseName();
-    const UChar* s = ures_getStringByKey(locRes.getAlias(), curLocaleName, &resLen, &errCode);
+    const char16_t* s = ures_getStringByKey(locRes.getAlias(), curLocaleName, &resLen, &errCode);
 
     if (s == nullptr) {
         // Check parent locales.
@@ -1114,7 +1114,7 @@ static UnicodeString tokenString(tokenType tok) {
 
 void
 RuleChain::dumpRules(UnicodeString& result) {
-    UChar digitString[16];
+    char16_t digitString[16];
 
     if ( ruleHeader != nullptr ) {
         result +=  fKeyword;
@@ -1378,7 +1378,7 @@ PluralRuleParser::getNextToken(UErrorCode &status)
         return;
     }
 
-    UChar ch;
+    char16_t ch;
     while (ruleIndex < ruleSrc->length()) {
         ch = ruleSrc->charAt(ruleIndex);
         type = charType(ch);
@@ -1459,7 +1459,7 @@ PluralRuleParser::getNextToken(UErrorCode &status)
 }
 
 tokenType
-PluralRuleParser::charType(UChar ch) {
+PluralRuleParser::charType(char16_t ch) {
     if ((ch>=U_ZERO) && (ch<=U_NINE)) {
         return tNumber;
     }
index c27b655fcde43f3ba1a170720abe2e2a8553af0f..e07ebe343950e843c514965925436b1bc6e05b6b 100644 (file)
@@ -50,67 +50,67 @@ namespace pluralimpl {
 
 // TODO: Remove this and replace with u"" literals. Was for EBCDIC compatibility.
 
-static const UChar DOT = ((UChar) 0x002E);
-static const UChar SINGLE_QUOTE = ((UChar) 0x0027);
-static const UChar SLASH = ((UChar) 0x002F);
-static const UChar BACKSLASH = ((UChar) 0x005C);
-static const UChar SPACE = ((UChar) 0x0020);
-static const UChar EXCLAMATION = ((UChar) 0x0021);
-static const UChar QUOTATION_MARK = ((UChar) 0x0022);
-static const UChar NUMBER_SIGN = ((UChar) 0x0023);
-static const UChar PERCENT_SIGN = ((UChar) 0x0025);
-static const UChar ASTERISK = ((UChar) 0x002A);
-static const UChar COMMA = ((UChar) 0x002C);
-static const UChar HYPHEN = ((UChar) 0x002D);
-static const UChar U_ZERO = ((UChar) 0x0030);
-static const UChar U_ONE = ((UChar) 0x0031);
-static const UChar U_TWO = ((UChar) 0x0032);
-static const UChar U_THREE = ((UChar) 0x0033);
-static const UChar U_FOUR = ((UChar) 0x0034);
-static const UChar U_FIVE = ((UChar) 0x0035);
-static const UChar U_SIX = ((UChar) 0x0036);
-static const UChar U_SEVEN = ((UChar) 0x0037);
-static const UChar U_EIGHT = ((UChar) 0x0038);
-static const UChar U_NINE = ((UChar) 0x0039);
-static const UChar COLON = ((UChar) 0x003A);
-static const UChar SEMI_COLON = ((UChar) 0x003B);
-static const UChar EQUALS = ((UChar) 0x003D);
-static const UChar AT = ((UChar) 0x0040);
-static const UChar CAP_A = ((UChar) 0x0041);
-static const UChar CAP_B = ((UChar) 0x0042);
-static const UChar CAP_R = ((UChar) 0x0052);
-static const UChar CAP_Z = ((UChar) 0x005A);
-static const UChar LOWLINE = ((UChar) 0x005F);
-static const UChar LEFTBRACE = ((UChar) 0x007B);
-static const UChar RIGHTBRACE = ((UChar) 0x007D);
-static const UChar TILDE = ((UChar) 0x007E);
-static const UChar ELLIPSIS = ((UChar) 0x2026);
-
-static const UChar LOW_A = ((UChar) 0x0061);
-static const UChar LOW_B = ((UChar) 0x0062);
-static const UChar LOW_C = ((UChar) 0x0063);
-static const UChar LOW_D = ((UChar) 0x0064);
-static const UChar LOW_E = ((UChar) 0x0065);
-static const UChar LOW_F = ((UChar) 0x0066);
-static const UChar LOW_G = ((UChar) 0x0067);
-static const UChar LOW_H = ((UChar) 0x0068);
-static const UChar LOW_I = ((UChar) 0x0069);
-static const UChar LOW_J = ((UChar) 0x006a);
-static const UChar LOW_K = ((UChar) 0x006B);
-static const UChar LOW_L = ((UChar) 0x006C);
-static const UChar LOW_M = ((UChar) 0x006D);
-static const UChar LOW_N = ((UChar) 0x006E);
-static const UChar LOW_O = ((UChar) 0x006F);
-static const UChar LOW_P = ((UChar) 0x0070);
-static const UChar LOW_Q = ((UChar) 0x0071);
-static const UChar LOW_R = ((UChar) 0x0072);
-static const UChar LOW_S = ((UChar) 0x0073);
-static const UChar LOW_T = ((UChar) 0x0074);
-static const UChar LOW_U = ((UChar) 0x0075);
-static const UChar LOW_V = ((UChar) 0x0076);
-static const UChar LOW_W = ((UChar) 0x0077);
-static const UChar LOW_Y = ((UChar) 0x0079);
-static const UChar LOW_Z = ((UChar) 0x007A);
+static const char16_t DOT = ((char16_t) 0x002E);
+static const char16_t SINGLE_QUOTE = ((char16_t) 0x0027);
+static const char16_t SLASH = ((char16_t) 0x002F);
+static const char16_t BACKSLASH = ((char16_t) 0x005C);
+static const char16_t SPACE = ((char16_t) 0x0020);
+static const char16_t EXCLAMATION = ((char16_t) 0x0021);
+static const char16_t QUOTATION_MARK = ((char16_t) 0x0022);
+static const char16_t NUMBER_SIGN = ((char16_t) 0x0023);
+static const char16_t PERCENT_SIGN = ((char16_t) 0x0025);
+static const char16_t ASTERISK = ((char16_t) 0x002A);
+static const char16_t COMMA = ((char16_t) 0x002C);
+static const char16_t HYPHEN = ((char16_t) 0x002D);
+static const char16_t U_ZERO = ((char16_t) 0x0030);
+static const char16_t U_ONE = ((char16_t) 0x0031);
+static const char16_t U_TWO = ((char16_t) 0x0032);
+static const char16_t U_THREE = ((char16_t) 0x0033);
+static const char16_t U_FOUR = ((char16_t) 0x0034);
+static const char16_t U_FIVE = ((char16_t) 0x0035);
+static const char16_t U_SIX = ((char16_t) 0x0036);
+static const char16_t U_SEVEN = ((char16_t) 0x0037);
+static const char16_t U_EIGHT = ((char16_t) 0x0038);
+static const char16_t U_NINE = ((char16_t) 0x0039);
+static const char16_t COLON = ((char16_t) 0x003A);
+static const char16_t SEMI_COLON = ((char16_t) 0x003B);
+static const char16_t EQUALS = ((char16_t) 0x003D);
+static const char16_t AT = ((char16_t) 0x0040);
+static const char16_t CAP_A = ((char16_t) 0x0041);
+static const char16_t CAP_B = ((char16_t) 0x0042);
+static const char16_t CAP_R = ((char16_t) 0x0052);
+static const char16_t CAP_Z = ((char16_t) 0x005A);
+static const char16_t LOWLINE = ((char16_t) 0x005F);
+static const char16_t LEFTBRACE = ((char16_t) 0x007B);
+static const char16_t RIGHTBRACE = ((char16_t) 0x007D);
+static const char16_t TILDE = ((char16_t) 0x007E);
+static const char16_t ELLIPSIS = ((char16_t) 0x2026);
+
+static const char16_t LOW_A = ((char16_t) 0x0061);
+static const char16_t LOW_B = ((char16_t) 0x0062);
+static const char16_t LOW_C = ((char16_t) 0x0063);
+static const char16_t LOW_D = ((char16_t) 0x0064);
+static const char16_t LOW_E = ((char16_t) 0x0065);
+static const char16_t LOW_F = ((char16_t) 0x0066);
+static const char16_t LOW_G = ((char16_t) 0x0067);
+static const char16_t LOW_H = ((char16_t) 0x0068);
+static const char16_t LOW_I = ((char16_t) 0x0069);
+static const char16_t LOW_J = ((char16_t) 0x006a);
+static const char16_t LOW_K = ((char16_t) 0x006B);
+static const char16_t LOW_L = ((char16_t) 0x006C);
+static const char16_t LOW_M = ((char16_t) 0x006D);
+static const char16_t LOW_N = ((char16_t) 0x006E);
+static const char16_t LOW_O = ((char16_t) 0x006F);
+static const char16_t LOW_P = ((char16_t) 0x0070);
+static const char16_t LOW_Q = ((char16_t) 0x0071);
+static const char16_t LOW_R = ((char16_t) 0x0072);
+static const char16_t LOW_S = ((char16_t) 0x0073);
+static const char16_t LOW_T = ((char16_t) 0x0074);
+static const char16_t LOW_U = ((char16_t) 0x0075);
+static const char16_t LOW_V = ((char16_t) 0x0076);
+static const char16_t LOW_W = ((char16_t) 0x0077);
+static const char16_t LOW_Y = ((char16_t) 0x0079);
+static const char16_t LOW_Z = ((char16_t) 0x007A);
 
 }
 
@@ -164,7 +164,7 @@ public:
 
 private:
     static tokenType getKeyType(const UnicodeString& token, tokenType type);
-    static tokenType charType(UChar ch);
+    static tokenType charType(char16_t ch);
     static UBool isValidKeyword(const UnicodeString& token);
 
     const UnicodeString  *ruleSrc;  // The rules string.
index ed3393338775e9403341bcc99e0e59dc097ea6a3..4a45db1bf5c268ca29ae49ac63e3226563171192 100644 (file)
@@ -103,21 +103,21 @@ UnicodeString& Quantifier::toPattern(UnicodeString& result,
     matcher->toMatcher()->toPattern(result, escapeUnprintable);
     if (minCount == 0) {
         if (maxCount == 1) {
-            return result.append((UChar)63); /*?*/
+            return result.append((char16_t)63); /*?*/
         } else if (maxCount == MAX) {
-            return result.append((UChar)42); /***/
+            return result.append((char16_t)42); /***/
         }
         // else fall through
     } else if (minCount == 1 && maxCount == MAX) {
-        return result.append((UChar)43); /*+*/
+        return result.append((char16_t)43); /*+*/
     }
-    result.append((UChar)123); /*{*/
+    result.append((char16_t)123); /*{*/
     ICU_Utility::appendNumber(result, minCount);
-    result.append((UChar)44); /*,*/
+    result.append((char16_t)44); /*,*/
     if (maxCount != MAX) {
         ICU_Utility::appendNumber(result, maxCount);
     }
-    result.append((UChar)125); /*}*/
+    result.append((char16_t)125); /*}*/
     return result;
 }
 
index ea503a0e4b8b3f02fd4a52b5745feae6d379905b..0b0cefaea25dd212b176a82b9328889891bfe5cb 100644 (file)
 
 #define U_ICUDATA_RBNF U_ICUDATA_NAME U_TREE_SEPARATOR_STRING "rbnf"
 
-static const UChar gPercentPercent[] =
+static const char16_t gPercentPercent[] =
 {
     0x25, 0x25, 0
 }; /* "%%" */
 
 // All urbnf objects are created through openRules, so we init all of the
 // Unicode string constants required by rbnf, nfrs, or nfr here.
-static const UChar gLenientParse[] =
+static const char16_t gLenientParse[] =
 {
     0x25, 0x25, 0x6C, 0x65, 0x6E, 0x69, 0x65, 0x6E, 0x74, 0x2D, 0x70, 0x61, 0x72, 0x73, 0x65, 0x3A, 0
 }; /* "%%lenient-parse:" */
-static const UChar gSemiColon = 0x003B;
-static const UChar gSemiPercent[] =
+static const char16_t gSemiColon = 0x003B;
+static const char16_t gSemiPercent[] =
 {
     0x3B, 0x25, 0
 }; /* ";%" */
@@ -103,13 +103,13 @@ public:
     inline  bool operator!=(const LocalizationInfo* rhs) const { return !operator==(rhs); }
     
     virtual int32_t getNumberOfRuleSets(void) const = 0;
-    virtual const UChar* getRuleSetName(int32_t index) const = 0;
+    virtual const char16_t* getRuleSetName(int32_t index) const = 0;
     virtual int32_t getNumberOfDisplayLocales(void) const = 0;
-    virtual const UChar* getLocaleName(int32_t index) const = 0;
-    virtual const UChar* getDisplayName(int32_t localeIndex, int32_t ruleIndex) const = 0;
+    virtual const char16_t* getLocaleName(int32_t index) const = 0;
+    virtual const char16_t* getDisplayName(int32_t localeIndex, int32_t ruleIndex) const = 0;
     
-    virtual int32_t indexForLocale(const UChar* locale) const;
-    virtual int32_t indexForRuleSet(const UChar* ruleset) const;
+    virtual int32_t indexForLocale(const char16_t* locale) const;
+    virtual int32_t indexForRuleSet(const char16_t* ruleset) const;
     
 //    virtual UClassID getDynamicClassID() const = 0;
 //    static UClassID getStaticClassID(void);
@@ -121,7 +121,7 @@ LocalizationInfo::~LocalizationInfo() {}
 
 // if both strings are nullptr, this returns true
 static UBool 
-streq(const UChar* lhs, const UChar* rhs) {
+streq(const char16_t* lhs, const char16_t* rhs) {
     if (rhs == lhs) {
         return true;
     }
@@ -148,7 +148,7 @@ LocalizationInfo::operator==(const LocalizationInfo* rhs) const {
             int32_t dlc = getNumberOfDisplayLocales();
             if (dlc == rhs->getNumberOfDisplayLocales()) {
                 for (int i = 0; i < dlc; ++i) {
-                    const UChar* locale = getLocaleName(i);
+                    const char16_t* locale = getLocaleName(i);
                     int32_t ix = rhs->indexForLocale(locale);
                     // if no locale, ix is -1, getLocaleName returns null, so streq returns false
                     if (!streq(locale, rhs->getLocaleName(ix))) {
@@ -168,7 +168,7 @@ LocalizationInfo::operator==(const LocalizationInfo* rhs) const {
 }
 
 int32_t
-LocalizationInfo::indexForLocale(const UChar* locale) const {
+LocalizationInfo::indexForLocale(const char16_t* locale) const {
     for (int i = 0; i < getNumberOfDisplayLocales(); ++i) {
         if (streq(locale, getLocaleName(i))) {
             return i;
@@ -178,7 +178,7 @@ LocalizationInfo::indexForLocale(const UChar* locale) const {
 }
 
 int32_t
-LocalizationInfo::indexForRuleSet(const UChar* ruleset) const {
+LocalizationInfo::indexForRuleSet(const char16_t* ruleset) const {
     if (ruleset) {
         for (int i = 0; i < getNumberOfRuleSets(); ++i) {
             if (streq(ruleset, getRuleSetName(i))) {
@@ -255,14 +255,14 @@ public:
 class LocDataParser;
 
 class StringLocalizationInfo : public LocalizationInfo {
-    UChar* info;
-    UChar*** data;
+    char16_t* info;
+    char16_t*** data;
     int32_t numRuleSets;
     int32_t numLocales;
 
 friend class LocDataParser;
 
-    StringLocalizationInfo(UChar* i, UChar*** d, int32_t numRS, int32_t numLocs)
+    StringLocalizationInfo(char16_t* i, char16_t*** d, int32_t numRS, int32_t numLocs)
         : info(i), data(d), numRuleSets(numRS), numLocales(numLocs)
     {
     }
@@ -272,10 +272,10 @@ public:
     
     virtual ~StringLocalizationInfo();
     virtual int32_t getNumberOfRuleSets(void) const override { return numRuleSets; }
-    virtual const UChar* getRuleSetName(int32_t index) const override;
+    virtual const char16_t* getRuleSetName(int32_t index) const override;
     virtual int32_t getNumberOfDisplayLocales(void) const override { return numLocales; }
-    virtual const UChar* getLocaleName(int32_t index) const override;
-    virtual const UChar* getDisplayName(int32_t localeIndex, int32_t ruleIndex) const override;
+    virtual const char16_t* getLocaleName(int32_t index) const override;
+    virtual const char16_t* getDisplayName(int32_t localeIndex, int32_t ruleIndex) const override;
     
 //    virtual UClassID getDynamicClassID() const;
 //    static UClassID getStaticClassID(void);
@@ -298,10 +298,10 @@ enum {
  * Utility for parsing a localization string and returning a StringLocalizationInfo*.
  */
 class LocDataParser {
-    UChar* data;
-    const UChar* e;
-    UChar* p;
-    UChar ch;
+    char16_t* data;
+    const char16_t* e;
+    char16_t* p;
+    char16_t ch;
     UParseError& pe;
     UErrorCode& ec;
     
@@ -314,7 +314,7 @@ public:
     * On a successful parse, return a StringLocalizationInfo*, otherwise delete locData, set perror and status,
     * and return nullptr.  The StringLocalizationInfo will adopt locData if it is created.
     */
-    StringLocalizationInfo* parse(UChar* data, int32_t len);
+    StringLocalizationInfo* parse(char16_t* data, int32_t len);
     
 private:
     
@@ -322,14 +322,14 @@ private:
         ++p;
         ch = 0xffff;
     }
-    inline UBool checkInc(UChar c) {
+    inline UBool checkInc(char16_t c) {
         if (p < e && (ch == c || *p == c)) {
             inc();
             return true;
         }
         return false;
     }
-    inline UBool check(UChar c) {
+    inline UBool check(char16_t c) {
         return p < e && (ch == c || *p == c);
     }
     inline void skipWhitespace(void) {
@@ -337,7 +337,7 @@ private:
             inc();
         }
     }
-    inline UBool inList(UChar c, const UChar* list) const {
+    inline UBool inList(char16_t c, const char16_t* list) const {
         if (*list == SPACE && PatternProps::isWhiteSpace(c)) {
             return true;
         }
@@ -350,8 +350,8 @@ private:
     
     StringLocalizationInfo* doParse(void);
         
-    UChar** nextArray(int32_t& requiredLength);
-    UChar*  nextString(void);
+    char16_t** nextArray(int32_t& requiredLength);
+    char16_t*  nextString(void);
 };
 
 #ifdef RBNF_DEBUG
@@ -369,15 +369,15 @@ private:
 #endif
         
 
-static const UChar DQUOTE_STOPLIST[] = { 
+static const char16_t DQUOTE_STOPLIST[] = {
     QUOTE, 0
 };
 
-static const UChar SQUOTE_STOPLIST[] = { 
+static const char16_t SQUOTE_STOPLIST[] = {
     TICK, 0
 };
 
-static const UChar NOQUOTE_STOPLIST[] = { 
+static const char16_t NOQUOTE_STOPLIST[] = {
     SPACE, COMMA, CLOSE_ANGLE, OPEN_ANGLE, TICK, QUOTE, 0
 };
 
@@ -387,7 +387,7 @@ DeleteFn(void* p) {
 }
 
 StringLocalizationInfo*
-LocDataParser::parse(UChar* _data, int32_t len) {
+LocDataParser::parse(char16_t* _data, int32_t len) {
     if (U_FAILURE(ec)) {
         if (_data) uprv_free(_data);
         return nullptr;
@@ -429,7 +429,7 @@ LocDataParser::doParse(void) {
         int32_t requiredLength = -1;
         while (mightHaveNext) {
             mightHaveNext = false;
-            UChar** elem = nextArray(requiredLength);
+            char16_t** elem = nextArray(requiredLength);
             skipWhitespace();
             UBool haveComma = check(COMMA);
             if (elem) {
@@ -460,7 +460,7 @@ LocDataParser::doParse(void) {
         array.add(nullptr, ec);
         if (U_SUCCESS(ec)) {
             int32_t numLocs = array.length() - 2; // subtract first, nullptr
-            UChar*** result = (UChar***)array.release();
+            char16_t*** result = (char16_t***)array.release();
             
             return new StringLocalizationInfo(data, result, requiredLength-2, numLocs); // subtract first, nullptr
         }
@@ -469,7 +469,7 @@ LocDataParser::doParse(void) {
     ERROR("Unknown error");
 }
 
-UChar**
+char16_t**
 LocDataParser::nextArray(int32_t& requiredLength) {
     if (U_FAILURE(ec)) {
         return nullptr;
@@ -484,7 +484,7 @@ LocDataParser::nextArray(int32_t& requiredLength) {
     UBool mightHaveNext = true;
     while (mightHaveNext) {
         mightHaveNext = false;
-        UChar* elem = nextString();
+        char16_t* elem = nextString();
         skipWhitespace();
         UBool haveComma = check(COMMA);
         if (elem) {
@@ -515,19 +515,19 @@ LocDataParser::nextArray(int32_t& requiredLength) {
             ERROR("Array not of required length");
         }
         
-        return (UChar**)array.release();
+        return (char16_t**)array.release();
     }
     ERROR("Unknown Error");
 }
 
-UChar*
+char16_t*
 LocDataParser::nextString() {
-    UChar* result = nullptr;
+    char16_t* result = nullptr;
     
     skipWhitespace();
     if (p < e) {
-        const UChar* terminators;
-        UChar c = *p;
+        const char16_t* terminators;
+        char16_t c = *p;
         UBool haveQuote = c == QUOTE || c == TICK;
         if (haveQuote) {
             inc();
@@ -535,13 +535,13 @@ LocDataParser::nextString() {
         } else {
             terminators = NOQUOTE_STOPLIST;
         }
-        UChar* start = p;
+        char16_t* start = p;
         while (p < e && !inList(*p, terminators)) ++p;
         if (p == e) {
             ERROR("Unexpected end of data");
         }
         
-        UChar x = *p;
+        char16_t x = *p;
         if (p > start) {
             ch = x;
             *p = 0x0; // terminate by writing to data
@@ -569,17 +569,17 @@ void LocDataParser::parseError(const char* EXPLANATION_ARG)
         return;
     }
 
-    const UChar* start = p - U_PARSE_CONTEXT_LEN - 1;
+    const char16_t* start = p - U_PARSE_CONTEXT_LEN - 1;
     if (start < data) {
         start = data;
     }
-    for (UChar* x = p; --x >= start;) {
+    for (char16_t* x = p; --x >= start;) {
         if (!*x) {
             start = x+1;
             break;
         }
     }
-    const UChar* limit = p + U_PARSE_CONTEXT_LEN - 1;
+    const char16_t* limit = p + U_PARSE_CONTEXT_LEN - 1;
     if (limit > e) {
         limit = e;
     }
@@ -594,7 +594,7 @@ void LocDataParser::parseError(const char* EXPLANATION_ARG)
 
     UnicodeString msg;
     msg.append(start, p - start);
-    msg.append((UChar)0x002f); /* SOLIDUS/SLASH */
+    msg.append((char16_t)0x002f); /* SOLIDUS/SLASH */
     msg.append(p, limit-p);
     msg.append(UNICODE_STRING_SIMPLE("'"));
     
@@ -632,7 +632,7 @@ StringLocalizationInfo::create(const UnicodeString& info, UParseError& perror, U
         return nullptr; // no error;
     }
     
-    UChar* p = (UChar*)uprv_malloc(len * sizeof(UChar));
+    char16_t* p = (char16_t*)uprv_malloc(len * sizeof(char16_t));
     if (!p) {
         status = U_MEMORY_ALLOCATION_ERROR;
         return nullptr;
@@ -647,7 +647,7 @@ StringLocalizationInfo::create(const UnicodeString& info, UParseError& perror, U
 }
 
 StringLocalizationInfo::~StringLocalizationInfo() {
-    for (UChar*** p = (UChar***)data; *p; ++p) {
+    for (char16_t*** p = (char16_t***)data; *p; ++p) {
         // remaining data is simply pointer into our unicode string data.
         if (*p) uprv_free(*p);
     }
@@ -656,7 +656,7 @@ StringLocalizationInfo::~StringLocalizationInfo() {
 }
 
 
-const UChar*
+const char16_t*
 StringLocalizationInfo::getRuleSetName(int32_t index) const {
     if (index >= 0 && index < getNumberOfRuleSets()) {
         return data[0][index];
@@ -664,7 +664,7 @@ StringLocalizationInfo::getRuleSetName(int32_t index) const {
     return nullptr;
 }
 
-const UChar*
+const char16_t*
 StringLocalizationInfo::getLocaleName(int32_t index) const {
     if (index >= 0 && index < getNumberOfDisplayLocales()) {
         return data[index+1][0];
@@ -672,7 +672,7 @@ StringLocalizationInfo::getLocaleName(int32_t index) const {
     return nullptr;
 }
 
-const UChar*
+const char16_t*
 StringLocalizationInfo::getDisplayName(int32_t localeIndex, int32_t ruleIndex) const {
     if (localeIndex >= 0 && localeIndex < getNumberOfDisplayLocales() &&
         ruleIndex >= 0 && ruleIndex < getNumberOfRuleSets()) {
@@ -1068,7 +1068,7 @@ RuleBasedNumberFormat::getRuleSetDisplayName(int32_t index, const Locale& locale
     if (localizations && index >= 0 && index < localizations->getNumberOfRuleSets()) {
         UnicodeString localeName(localeParam.getBaseName(), -1, UnicodeString::kInvariant); 
         int32_t len = localeName.length();
-        UChar* localeStr = localeName.getBuffer(len + 1);
+        char16_t* localeStr = localeName.getBuffer(len + 1);
         while (len >= 0) {
             localeStr[len] = 0;
             int32_t ix = localizations->indexForLocale(localeStr);
index 39fea53d0dc25b698931745c22e31197540faa65..43cbb4795b6b4969307b7732e3eaa857d876b222 100644 (file)
@@ -67,7 +67,7 @@ public:
     Hashtable variableNames;
 
     /**
-     * Map category variable (UChar) to set (UnicodeFunctor).
+     * Map category variable (char16_t) to set (UnicodeFunctor).
      * Variables that correspond to a set of characters are mapped
      * from variable name to a stand-in character in data.variableNames.
      * The stand-in then serves as a key in this hash to lookup the
@@ -91,7 +91,7 @@ public:
      * variablesBase through variablesBase +
      * variablesLength - 1 represent UnicodeFunctor objects.
      */
-    UChar variablesBase;
+    char16_t variablesBase;
 
     /**
      * The length of variables.
index 9933043bbae9f40e04cc51a5976efffee8dab70e..10482d5edb19c673bb5d63d17379c3ed7741f6ab 100644 (file)
 #include "putilimp.h"
 
 // Operators
-#define VARIABLE_DEF_OP ((UChar)0x003D) /*=*/
-#define FORWARD_RULE_OP ((UChar)0x003E) /*>*/
-#define REVERSE_RULE_OP ((UChar)0x003C) /*<*/
-#define FWDREV_RULE_OP  ((UChar)0x007E) /*~*/ // internal rep of <> op
+#define VARIABLE_DEF_OP ((char16_t)0x003D) /*=*/
+#define FORWARD_RULE_OP ((char16_t)0x003E) /*>*/
+#define REVERSE_RULE_OP ((char16_t)0x003C) /*<*/
+#define FWDREV_RULE_OP  ((char16_t)0x007E) /*~*/ // internal rep of <> op
 
 // Other special characters
-#define QUOTE             ((UChar)0x0027) /*'*/
-#define ESCAPE            ((UChar)0x005C) /*\*/
-#define END_OF_RULE       ((UChar)0x003B) /*;*/
-#define RULE_COMMENT_CHAR ((UChar)0x0023) /*#*/
-
-#define SEGMENT_OPEN       ((UChar)0x0028) /*(*/
-#define SEGMENT_CLOSE      ((UChar)0x0029) /*)*/
-#define CONTEXT_ANTE       ((UChar)0x007B) /*{*/
-#define CONTEXT_POST       ((UChar)0x007D) /*}*/
-#define CURSOR_POS         ((UChar)0x007C) /*|*/
-#define CURSOR_OFFSET      ((UChar)0x0040) /*@*/
-#define ANCHOR_START       ((UChar)0x005E) /*^*/
-#define KLEENE_STAR        ((UChar)0x002A) /***/
-#define ONE_OR_MORE        ((UChar)0x002B) /*+*/
-#define ZERO_OR_ONE        ((UChar)0x003F) /*?*/
-
-#define DOT                ((UChar)46)     /*.*/
-
-static const UChar DOT_SET[] = { // "[^[:Zp:][:Zl:]\r\n$]";
+#define QUOTE             ((char16_t)0x0027) /*'*/
+#define ESCAPE            ((char16_t)0x005C) /*\*/
+#define END_OF_RULE       ((char16_t)0x003B) /*;*/
+#define RULE_COMMENT_CHAR ((char16_t)0x0023) /*#*/
+
+#define SEGMENT_OPEN       ((char16_t)0x0028) /*(*/
+#define SEGMENT_CLOSE      ((char16_t)0x0029) /*)*/
+#define CONTEXT_ANTE       ((char16_t)0x007B) /*{*/
+#define CONTEXT_POST       ((char16_t)0x007D) /*}*/
+#define CURSOR_POS         ((char16_t)0x007C) /*|*/
+#define CURSOR_OFFSET      ((char16_t)0x0040) /*@*/
+#define ANCHOR_START       ((char16_t)0x005E) /*^*/
+#define KLEENE_STAR        ((char16_t)0x002A) /***/
+#define ONE_OR_MORE        ((char16_t)0x002B) /*+*/
+#define ZERO_OR_ONE        ((char16_t)0x003F) /*?*/
+
+#define DOT                ((char16_t)46)     /*.*/
+
+static const char16_t DOT_SET[] = { // "[^[:Zp:][:Zl:]\r\n$]";
     91, 94, 91, 58, 90, 112, 58, 93, 91, 58, 90,
     108, 58, 93, 92, 114, 92, 110, 36, 93, 0
 };
 
 // A function is denoted &Source-Target/Variant(text)
-#define FUNCTION           ((UChar)38)     /*&*/
+#define FUNCTION           ((char16_t)38)     /*&*/
 
 // Aliases for some of the syntax characters. These are provided so
 // transliteration rules can be expressed in XML without clashing with
 // XML syntax characters '<', '>', and '&'.
-#define ALT_REVERSE_RULE_OP ((UChar)0x2190) // Left Arrow
-#define ALT_FORWARD_RULE_OP ((UChar)0x2192) // Right Arrow
-#define ALT_FWDREV_RULE_OP  ((UChar)0x2194) // Left Right Arrow
-#define ALT_FUNCTION        ((UChar)0x2206) // Increment (~Greek Capital Delta)
+#define ALT_REVERSE_RULE_OP ((char16_t)0x2190) // Left Arrow
+#define ALT_FORWARD_RULE_OP ((char16_t)0x2192) // Right Arrow
+#define ALT_FWDREV_RULE_OP  ((char16_t)0x2194) // Left Right Arrow
+#define ALT_FUNCTION        ((char16_t)0x2206) // Increment (~Greek Capital Delta)
 
 // Special characters disallowed at the top level
-static const UChar ILLEGAL_TOP[] = {41,0}; // ")"
+static const char16_t ILLEGAL_TOP[] = {41,0}; // ")"
 
 // Special characters disallowed within a segment
-static const UChar ILLEGAL_SEG[] = {123,125,124,64,0}; // "{}|@"
+static const char16_t ILLEGAL_SEG[] = {123,125,124,64,0}; // "{}|@"
 
 // Special characters disallowed within a function argument
-static const UChar ILLEGAL_FUNC[] = {94,40,46,42,43,63,123,125,124,64,0}; // "^(.*+?{}|@"
+static const char16_t ILLEGAL_FUNC[] = {94,40,46,42,43,63,123,125,124,64,0}; // "^(.*+?{}|@"
 
 // By definition, the ANCHOR_END special character is a
 // trailing SymbolTable.SYMBOL_REF character.
 // private static final char ANCHOR_END       = '$';
 
-static const UChar gOPERATORS[] = { // "=><"
+static const char16_t gOPERATORS[] = { // "=><"
     VARIABLE_DEF_OP, FORWARD_RULE_OP, REVERSE_RULE_OP,
     ALT_FORWARD_RULE_OP, ALT_REVERSE_RULE_OP, ALT_FWDREV_RULE_OP,
     0
 };
 
-static const UChar HALF_ENDERS[] = { // "=><;"
+static const char16_t HALF_ENDERS[] = { // "=><;"
     VARIABLE_DEF_OP, FORWARD_RULE_OP, REVERSE_RULE_OP,
     ALT_FORWARD_RULE_OP, ALT_REVERSE_RULE_OP, ALT_FWDREV_RULE_OP,
     END_OF_RULE,
@@ -111,15 +111,15 @@ static const UChar HALF_ENDERS[] = { // "=><;"
 
 // These are also used in Transliterator::toRules()
 static const int32_t ID_TOKEN_LEN = 2;
-static const UChar   ID_TOKEN[]   = { 0x3A, 0x3A }; // ':', ':'
+static const char16_t   ID_TOKEN[]   = { 0x3A, 0x3A }; // ':', ':'
 
 /*
 commented out until we do real ::BEGIN/::END functionality
 static const int32_t BEGIN_TOKEN_LEN = 5;
-static const UChar BEGIN_TOKEN[] = { 0x42, 0x45, 0x47, 0x49, 0x4e }; // 'BEGIN'
+static const char16_t BEGIN_TOKEN[] = { 0x42, 0x45, 0x47, 0x49, 0x4e }; // 'BEGIN'
 
 static const int32_t END_TOKEN_LEN = 3;
-static const UChar END_TOKEN[] = { 0x45, 0x4e, 0x44 }; // 'END'
+static const char16_t END_TOKEN[] = { 0x45, 0x4e, 0x44 }; // 'END'
 */
 
 U_NAMESPACE_BEGIN
@@ -211,7 +211,7 @@ UnicodeString ParseData::parseReference(const UnicodeString& text,
     int32_t i = start;
     UnicodeString result;
     while (i < limit) {
-        UChar c = text.charAt(i);
+        char16_t c = text.charAt(i);
         if ((i==start && !u_isIDStart(c)) || !u_isIDPart(c)) {
             break;
         }
@@ -413,7 +413,7 @@ int32_t RuleHalf::parseSection(const UnicodeString& rule, int32_t pos, int32_t l
     while (pos < limit && !done) {
         // Since all syntax characters are in the BMP, fetching
         // 16-bit code units suffices here.
-        UChar c = rule.charAt(pos++);
+        char16_t c = rule.charAt(pos++);
         if (PatternProps::isWhiteSpace(c)) {
             // Ignore whitespace.  Note that this is not Unicode
             // spaces, but Java spaces -- a subset, representing
@@ -919,7 +919,7 @@ void TransliteratorParser::parseRules(const UnicodeString& rule,
         return;
     }
 
-    dotStandIn = (UChar) -1;
+    dotStandIn = (char16_t) -1;
 
     UnicodeString *tempstr = nullptr; // used for memory allocation error checking
     UnicodeString str; // scratch
@@ -936,14 +936,14 @@ void TransliteratorParser::parseRules(const UnicodeString& rule,
     int32_t compoundFilterOffset = -1;
 
     while (pos < limit && U_SUCCESS(status)) {
-        UChar c = rule.charAt(pos++);
+        char16_t c = rule.charAt(pos++);
         if (PatternProps::isWhiteSpace(c)) {
             // Ignore leading whitespace.
             continue;
         }
         // Skip lines starting with the comment character
         if (c == RULE_COMMENT_CHAR) {
-            pos = rule.indexOf((UChar)0x000A /*\n*/, pos) + 1;
+            pos = rule.indexOf((char16_t)0x000A /*\n*/, pos) + 1;
             if (pos == 0) {
                 break; // No "\n" found; rest of rule is a comment
             }
@@ -1168,10 +1168,10 @@ void TransliteratorParser::setVariableRange(int32_t start, int32_t end, UErrorCo
         return;
     }
     
-    curData->variablesBase = (UChar) start;
+    curData->variablesBase = (char16_t) start;
     if (dataVector.size() == 0) {
-        variableNext = (UChar) start;
-        variableLimit = (UChar) (end + 1);
+        variableNext = (char16_t) start;
+        variableLimit = (char16_t) (end + 1);
     }
 }
 
@@ -1200,15 +1200,15 @@ void TransliteratorParser::pragmaNormalizeRules(UNormalizationMode /*mode*/) {
     //TODO Finish
 }
 
-static const UChar PRAGMA_USE[] = {0x75,0x73,0x65,0x20,0}; // "use "
+static const char16_t PRAGMA_USE[] = {0x75,0x73,0x65,0x20,0}; // "use "
 
-static const UChar PRAGMA_VARIABLE_RANGE[] = {0x7E,0x76,0x61,0x72,0x69,0x61,0x62,0x6C,0x65,0x20,0x72,0x61,0x6E,0x67,0x65,0x20,0x23,0x20,0x23,0x7E,0x3B,0}; // "~variable range # #~;"
+static const char16_t PRAGMA_VARIABLE_RANGE[] = {0x7E,0x76,0x61,0x72,0x69,0x61,0x62,0x6C,0x65,0x20,0x72,0x61,0x6E,0x67,0x65,0x20,0x23,0x20,0x23,0x7E,0x3B,0}; // "~variable range # #~;"
 
-static const UChar PRAGMA_MAXIMUM_BACKUP[] = {0x7E,0x6D,0x61,0x78,0x69,0x6D,0x75,0x6D,0x20,0x62,0x61,0x63,0x6B,0x75,0x70,0x20,0x23,0x7E,0x3B,0}; // "~maximum backup #~;"
+static const char16_t PRAGMA_MAXIMUM_BACKUP[] = {0x7E,0x6D,0x61,0x78,0x69,0x6D,0x75,0x6D,0x20,0x62,0x61,0x63,0x6B,0x75,0x70,0x20,0x23,0x7E,0x3B,0}; // "~maximum backup #~;"
 
-static const UChar PRAGMA_NFD_RULES[] = {0x7E,0x6E,0x66,0x64,0x20,0x72,0x75,0x6C,0x65,0x73,0x7E,0x3B,0}; // "~nfd rules~;"
+static const char16_t PRAGMA_NFD_RULES[] = {0x7E,0x6E,0x66,0x64,0x20,0x72,0x75,0x6C,0x65,0x73,0x7E,0x3B,0}; // "~nfd rules~;"
 
-static const UChar PRAGMA_NFC_RULES[] = {0x7E,0x6E,0x66,0x63,0x20,0x72,0x75,0x6C,0x65,0x73,0x7E,0x3B,0}; // "~nfc rules~;"
+static const char16_t PRAGMA_NFC_RULES[] = {0x7E,0x6E,0x66,0x63,0x20,0x72,0x75,0x6C,0x65,0x73,0x7E,0x3B,0}; // "~nfc rules~;"
 
 /**
  * Return true if the given rule looks like a pragma.
@@ -1287,7 +1287,7 @@ int32_t TransliteratorParser::parsePragma(const UnicodeString& rule, int32_t pos
 int32_t TransliteratorParser::parseRule(const UnicodeString& rule, int32_t pos, int32_t limit, UErrorCode& status) {
     // Locate the left side, operator, and right side
     int32_t start = pos;
-    UChar op = 0;
+    char16_t op = 0;
     int32_t i;
 
     // Set up segments data
@@ -1522,14 +1522,14 @@ int32_t TransliteratorParser::syntaxError(UErrorCode parseErrorCode,
  * Parse a UnicodeSet out, store it, and return the stand-in character
  * used to represent it.
  */
-UChar TransliteratorParser::parseSet(const UnicodeString& rule,
+char16_t TransliteratorParser::parseSet(const UnicodeString& rule,
                                           ParsePosition& pos,
                                           UErrorCode& status) {
     UnicodeSet* set = new UnicodeSet(rule, pos, USET_IGNORE_SPACE, parseData, status);
     // Null pointer check
     if (set == nullptr) {
         status = U_MEMORY_ALLOCATION_ERROR;
-        return (UChar)0x0000; // Return empty character with error.
+        return (char16_t)0x0000; // Return empty character with error.
     }
     set->compact();
     return generateStandInFor(set, status);
@@ -1539,14 +1539,14 @@ UChar TransliteratorParser::parseSet(const UnicodeString& rule,
  * Generate and return a stand-in for a new UnicodeFunctor.  Store
  * the matcher (adopt it).
  */
-UChar TransliteratorParser::generateStandInFor(UnicodeFunctor* adopted, UErrorCode& status) {
+char16_t TransliteratorParser::generateStandInFor(UnicodeFunctor* adopted, UErrorCode& status) {
     // assert(obj != null);
     
     // Look up previous stand-in, if any.  This is a short list
     // (typical n is 0, 1, or 2); linear search is optimal.
     for (int32_t i=0; i<variablesVector.size(); ++i) {
         if (variablesVector.elementAt(i) == adopted) { // [sic] pointer comparison
-            return (UChar) (curData->variablesBase + i);
+            return (char16_t) (curData->variablesBase + i);
         }
     }
     
@@ -1566,13 +1566,13 @@ UChar TransliteratorParser::generateStandInFor(UnicodeFunctor* adopted, UErrorCo
 /**
  * Return the standin for segment seg (1-based).
  */
-UChar TransliteratorParser::getSegmentStandin(int32_t seg, UErrorCode& status) {
+char16_t TransliteratorParser::getSegmentStandin(int32_t seg, UErrorCode& status) {
     // Special character used to indicate an empty spot
-    UChar empty = curData->variablesBase - 1;
+    char16_t empty = curData->variablesBase - 1;
     while (segmentStandins.length() < seg) {
         segmentStandins.append(empty);
     }
-    UChar c = segmentStandins.charAt(seg-1);
+    char16_t c = segmentStandins.charAt(seg-1);
     if (c == empty) {
         if (variableNext >= variableLimit) {
             status = U_VARIABLE_RANGE_EXHAUSTED;
@@ -1618,13 +1618,13 @@ void TransliteratorParser::setSegmentObject(int32_t seg, StringMatcher* adopted,
  * Return the stand-in for the dot set.  It is allocated the first
  * time and reused thereafter.
  */
-UChar TransliteratorParser::getDotStandIn(UErrorCode& status) {
-    if (dotStandIn == (UChar) -1) {
+char16_t TransliteratorParser::getDotStandIn(UErrorCode& status) {
+    if (dotStandIn == (char16_t) -1) {
         UnicodeSet* tempus = new UnicodeSet(UnicodeString(true, DOT_SET, -1), status);
         // Null pointer check.
         if (tempus == nullptr) {
             status = U_MEMORY_ALLOCATION_ERROR;
-            return (UChar)0x0000;
+            return (char16_t)0x0000;
         }
         dotStandIn = generateStandInFor(tempus, status);
     }
@@ -1651,7 +1651,7 @@ void TransliteratorParser::appendVariableDef(const UnicodeString& name,
                 status = U_ILLEGAL_ARGUMENT_ERROR;
                 return;
             }
-            buf.append((UChar) --variableLimit);
+            buf.append((char16_t) --variableLimit);
         } else {
             //throw new IllegalArgumentException("Undefined variable $"
             //                                   + name);
@@ -1673,13 +1673,13 @@ void TransliteratorParser::appendVariableDef(const UnicodeString& name,
 U_NAMESPACE_END
 
 U_CAPI int32_t
-utrans_stripRules(const UChar *source, int32_t sourceLen, UChar *target, UErrorCode *status) {
+utrans_stripRules(const char16_t *source, int32_t sourceLen, char16_t *target, UErrorCode *status) {
     U_NAMESPACE_USE
 
-    //const UChar *sourceStart = source;
-    const UChar *targetStart = target;
-    const UChar *sourceLimit = source+sourceLen;
-    UChar *targetLimit = target+sourceLen;
+    //const char16_t *sourceStart = source;
+    const char16_t *targetStart = target;
+    const char16_t *sourceLimit = source+sourceLen;
+    char16_t *targetLimit = target+sourceLen;
     UChar32 c = 0;
     UBool quoted = false;
     int32_t index;
@@ -1759,7 +1759,7 @@ utrans_stripRules(const UChar *source, int32_t sourceLen, UChar *target, UErrorC
             continue;
         }
 
-        /* Append UChar * after dissembling if c > 0xffff*/
+        /* Append char16_t * after dissembling if c > 0xffff*/
         index=0;
         U16_APPEND_UNSAFE(target, index, c);
         target+=index;
index d1a4cd6997c6da541dbb1ab4d490fc758938b989..11cf50e756c0d607e630533f95b5a18a479e0274 100644 (file)
@@ -107,14 +107,14 @@ class TransliteratorParser : public UMemory {
      * <code>variableLimit</code>.  At any point during parsing, available
      * variables are <code>variableNext..variableLimit-1</code>.
      */
-    UChar variableNext;
+    char16_t variableNext;
 
     /**
      * The last available stand-in for variables.  This is discovered
      * dynamically.  At any point during parsing, available variables are
      * <code>variableNext..variableLimit-1</code>.
      */
-    UChar variableLimit;
+    char16_t variableLimit;
 
     /**
      * When we encounter an undefined variable, we do not immediately signal
@@ -130,7 +130,7 @@ class TransliteratorParser : public UMemory {
      * patterns.  This is allocated the first time it is needed, and
      * reused thereafter.
      */
-    UChar dotStandIn;
+    char16_t dotStandIn;
 
 public:
 
@@ -272,9 +272,9 @@ private:
      * @param pos     the position in pattern at which to start parsing.
      * @return        the stand-in character used to represent it.
      */
-    UChar parseSet(const UnicodeString& rule,
-                   ParsePosition& pos,
-                   UErrorCode& status);
+    char16_t parseSet(const UnicodeString& rule,
+                      ParsePosition& pos,
+                      UErrorCode& status);
 
     /**
      * Generate and return a stand-in for a new UnicodeFunctor.  Store
@@ -282,14 +282,14 @@ private:
      * @param adopted the UnicodeFunctor to be adopted.
      * @return        a stand-in for a new UnicodeFunctor.
      */
-    UChar generateStandInFor(UnicodeFunctor* adopted, UErrorCode& status);
+    char16_t generateStandInFor(UnicodeFunctor* adopted, UErrorCode& status);
 
     /**
      * Return the standin for segment seg (1-based).
      * @param seg    the given segment.
      * @return       the standIn character for the given segment.
      */
-    UChar getSegmentStandin(int32_t seg, UErrorCode& status);
+    char16_t getSegmentStandin(int32_t seg, UErrorCode& status);
 
     /**
      * Set the object for segment seg (1-based).
@@ -303,7 +303,7 @@ private:
      * time and reused thereafter.
      * @return    the stand-in for the dot set.
      */
-    UChar getDotStandIn(UErrorCode& status);
+    char16_t getDotStandIn(UErrorCode& status);
 
     /**
      * Append the value of the given variable name to the given
index 27cdf9dd8e742f9f3262a59a7391e406d2985c7d..2340151766026af56cc10861ae6276970bff56aa 100644 (file)
@@ -26,7 +26,7 @@
 #include "util.h"
 #include "putilimp.h"
 
-static const UChar FORWARD_OP[] = {32,62,32,0}; // " > "
+static const char16_t FORWARD_OP[] = {32,62,32,0}; // " > "
 
 U_NAMESPACE_BEGIN
 
@@ -481,27 +481,27 @@ UnicodeString& TransliterationRule::toRule(UnicodeString& rule,
 
     // Emit start anchor
     if ((flags & ANCHOR_START) != 0) {
-        rule.append((UChar)94/*^*/);
+        rule.append((char16_t)94/*^*/);
     }
 
     // Emit the input pattern
     ICU_Utility::appendToRule(rule, anteContext, escapeUnprintable, quoteBuf);
 
     if (emitBraces) {
-        ICU_Utility::appendToRule(rule, (UChar) 0x007B /*{*/, true, escapeUnprintable, quoteBuf);
+        ICU_Utility::appendToRule(rule, (char16_t) 0x007B /*{*/, true, escapeUnprintable, quoteBuf);
     }
 
     ICU_Utility::appendToRule(rule, key, escapeUnprintable, quoteBuf);
 
     if (emitBraces) {
-        ICU_Utility::appendToRule(rule, (UChar) 0x007D /*}*/, true, escapeUnprintable, quoteBuf);
+        ICU_Utility::appendToRule(rule, (char16_t) 0x007D /*}*/, true, escapeUnprintable, quoteBuf);
     }
 
     ICU_Utility::appendToRule(rule, postContext, escapeUnprintable, quoteBuf);
 
     // Emit end anchor
     if ((flags & ANCHOR_END) != 0) {
-        rule.append((UChar)36/*$*/);
+        rule.append((char16_t)36/*$*/);
     }
 
     ICU_Utility::appendToRule(rule, UnicodeString(true, FORWARD_OP, 3), true, escapeUnprintable, quoteBuf);
@@ -511,7 +511,7 @@ UnicodeString& TransliterationRule::toRule(UnicodeString& rule,
     ICU_Utility::appendToRule(rule, output->toReplacer()->toReplacerPattern(str, escapeUnprintable),
                               true, escapeUnprintable, quoteBuf);
 
-    ICU_Utility::appendToRule(rule, (UChar) 0x003B /*;*/, true, escapeUnprintable, quoteBuf);
+    ICU_Utility::appendToRule(rule, (char16_t) 0x003B /*;*/, true, escapeUnprintable, quoteBuf);
 
     return rule;
 }
index 29dde8a9bbadaddf16d77b6071b89ec1c1d1a8fd..9423ecaba84483608170450a7c39561d0404d017 100644 (file)
@@ -61,9 +61,9 @@ static UnicodeString& _formatInput(UnicodeString &appendTo,
         input.extractBetween(pos.start, pos.limit, c);
         input.extractBetween(pos.limit, pos.contextLimit, d);
         input.extractBetween(pos.contextLimit, input.length(), e);
-        appendTo.append(a).append((UChar)123/*{*/).append(b).
-            append((UChar)124/*|*/).append(c).append((UChar)124/*|*/).append(d).
-            append((UChar)125/*}*/).append(e);
+        appendTo.append(a).append((char16_t)123/*{*/).append(b).
+            append((char16_t)124/*|*/).append(c).append((char16_t)124/*|*/).append(d).
+            append((char16_t)125/*}*/).append(e);
     } else {
         appendTo.append("INVALID UTransPosition");
         //appendTo.append((UnicodeString)"INVALID UTransPosition {cs=" +
@@ -78,7 +78,7 @@ static UnicodeString& _formatInput(UnicodeString &appendTo,
 UnicodeString& _appendHex(uint32_t number,
                           int32_t digits,
                           UnicodeString& target) {
-    static const UChar digitString[] = {
+    static const char16_t digitString[] = {
         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
         0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0
     };
@@ -115,7 +115,7 @@ inline void _debugOut(const char* msg, TransliterationRule* rule,
     if (rule) {
         UnicodeString r;
         rule->toRule(r, true);
-        buf.append((UChar)32).append(r);
+        buf.append((char16_t)32).append(r);
     }
     buf.append(UnicodeString(" => ", ""));
     UnicodeString* text = (UnicodeString*)&theText;
@@ -431,7 +431,7 @@ UnicodeString& TransliterationRuleSet::toRules(UnicodeString& ruleSource,
     ruleSource.truncate(0);
     for (i=0; i<count; ++i) {
         if (i != 0) {
-            ruleSource.append((UChar) 0x000A /*\n*/);
+            ruleSource.append((char16_t) 0x000A /*\n*/);
         }
         TransliterationRule *r =
             (TransliterationRule*) ruleVector->elementAt(i);
index df315174ca878da04e9ab0e85bfb33c608d5f7d7..0a0d095ca462f84eac7cfa0b752ab10432bebd52 100644 (file)
@@ -81,8 +81,8 @@ RegexCompile::RegexCompile(RegexPattern *rxp, UErrorCode &status) :
     }
 }
 
-static const UChar      chAmp       = 0x26;      // '&'
-static const UChar      chDash      = 0x2d;      // '-'
+static const char16_t   chAmp       = 0x26;      // '&'
+static const char16_t   chDash      = 0x2d;      // '-'
 
 
 //------------------------------------------------------------------------------
@@ -2620,7 +2620,7 @@ void  RegexCompile::findCaseInsensitiveStarters(UChar32 c, UnicodeSet *starterCh
         0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 
         0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0};
 
-    static const UChar RECaseFixData[] = {
+    static const char16_t RECaseFixData[] = {
         0x1e9a, 0xfb00, 0xfb01, 0xfb02, 0xfb03, 0xfb04, 0x1e96, 0x130, 0x1f0, 0xdf, 
         0x1e9e, 0xfb05, 0xfb06, 0x1e97, 0x1e98, 0x1e99, 0x149, 0x1fb4, 0x1fc4, 0x1fb3, 
         0x1fb6, 0x1fb7, 0x1fbc, 0x1fc3, 0x1fc6, 0x1fc7, 0x1fcc, 0x390, 0x1fd2, 0x1fd3, 
@@ -3944,25 +3944,25 @@ void RegexCompile::error(UErrorCode e) {
 //     Numeric because there is no portable way to enter them as literals.
 //     (Think EBCDIC).
 //
-static const UChar      chCR        = 0x0d;      // New lines, for terminating comments.
-static const UChar      chLF        = 0x0a;      // Line Feed
-static const UChar      chPound     = 0x23;      // '#', introduces a comment.
-static const UChar      chDigit0    = 0x30;      // '0'
-static const UChar      chDigit7    = 0x37;      // '9'
-static const UChar      chColon     = 0x3A;      // ':'
-static const UChar      chE         = 0x45;      // 'E'
-static const UChar      chQ         = 0x51;      // 'Q'
-//static const UChar      chN         = 0x4E;      // 'N'
-static const UChar      chP         = 0x50;      // 'P'
-static const UChar      chBackSlash = 0x5c;      // '\'  introduces a char escape
-//static const UChar      chLBracket  = 0x5b;      // '['
-static const UChar      chRBracket  = 0x5d;      // ']'
-static const UChar      chUp        = 0x5e;      // '^'
-static const UChar      chLowerP    = 0x70;
-static const UChar      chLBrace    = 0x7b;      // '{'
-static const UChar      chRBrace    = 0x7d;      // '}'
-static const UChar      chNEL       = 0x85;      //    NEL newline variant
-static const UChar      chLS        = 0x2028;    //    Unicode Line Separator
+static const char16_t   chCR        = 0x0d;      // New lines, for terminating comments.
+static const char16_t   chLF        = 0x0a;      // Line Feed
+static const char16_t   chPound     = 0x23;      // '#', introduces a comment.
+static const char16_t   chDigit0    = 0x30;      // '0'
+static const char16_t   chDigit7    = 0x37;      // '9'
+static const char16_t   chColon     = 0x3A;      // ':'
+static const char16_t   chE         = 0x45;      // 'E'
+static const char16_t   chQ         = 0x51;      // 'Q'
+//static const char16_t   chN         = 0x4E;      // 'N'
+static const char16_t   chP         = 0x50;      // 'P'
+static const char16_t   chBackSlash = 0x5c;      // '\'  introduces a char escape
+//static const char16_t   chLBracket  = 0x5b;      // '['
+static const char16_t   chRBracket  = 0x5d;      // ']'
+static const char16_t   chUp        = 0x5e;      // '^'
+static const char16_t   chLowerP    = 0x70;
+static const char16_t   chLBrace    = 0x7b;      // '{'
+static const char16_t   chRBrace    = 0x7d;      // '}'
+static const char16_t   chNEL       = 0x85;      //    NEL newline variant
+static const char16_t   chLS        = 0x2028;    //    Unicode Line Separator
 
 
 //------------------------------------------------------------------------------
index 764a6afc0eb2bcf6157ad72a39c6c170672d7129..86e238c0f7150cbed497fd91343aeb88a522cebc 100644 (file)
@@ -63,7 +63,7 @@ UBool CaseFoldingUTextIterator::inExpansion() {
 
 
 
-CaseFoldingUCharIterator::CaseFoldingUCharIterator(const UChar *chars, int64_t start, int64_t limit) :
+CaseFoldingUCharIterator::CaseFoldingUCharIterator(const char16_t *chars, int64_t start, int64_t limit) :
    fChars(chars), fIndex(start), fLimit(limit), fFoldChars(nullptr), fFoldLength(0) {
 }
 
index a076b5ad04b34eaec0c7c6d77455df0768ad1c9e..446cd90747c3a67e6c4fe0882431a24fe182c4a8 100644 (file)
@@ -374,21 +374,21 @@ class CaseFoldingUTextIterator: public UMemory {
                                   //  folding of the same code point from the original UText.
       private:
         UText             &fUText;
-        const  UChar      *fFoldChars;
+        const  char16_t   *fFoldChars;
         int32_t            fFoldLength;
         int32_t            fFoldIndex;
 
 };
 
 
-// Case folded UChar * string iterator.
-//  Wraps a UChar  *, provides a case-folded enumeration over its contents.
+// Case folded char16_t * string iterator.
+//  Wraps a char16_t  *, provides a case-folded enumeration over its contents.
 //  Used in implementing case insensitive matching constructs.
 //  Implementation in rematch.cpp
 
 class CaseFoldingUCharIterator: public UMemory {
       public:
-        CaseFoldingUCharIterator(const UChar *chars, int64_t start, int64_t limit);
+        CaseFoldingUCharIterator(const char16_t *chars, int64_t start, int64_t limit);
         ~CaseFoldingUCharIterator();
 
         UChar32 next();           // Next case folded character
@@ -400,10 +400,10 @@ class CaseFoldingUCharIterator: public UMemory {
         int64_t  getIndex();      // Return the current input buffer index.
 
       private:
-        const  UChar      *fChars;
+        const  char16_t   *fChars;
         int64_t            fIndex;
         int64_t            fLimit;
-        const  UChar      *fFoldChars;
+        const  char16_t   *fFoldChars;
         int32_t            fFoldLength;
         int32_t            fFoldIndex;
 
index 41bb4a944b3530559882c1f7454d0b4bf5715f8d..32d8a5c5f8278959b9c09621a81aa8afb56308a2 100644 (file)
@@ -16,7 +16,7 @@
 
 U_NAMESPACE_BEGIN
 
-U_CFUNC UChar U_CALLCONV
+U_CFUNC char16_t U_CALLCONV
 uregex_utext_unescape_charAt(int32_t offset, void *ct) {
     struct URegexUTextUnescapeCharContext *context = (struct URegexUTextUnescapeCharContext *)ct;
     UChar32 c;
@@ -34,15 +34,15 @@ uregex_utext_unescape_charAt(int32_t offset, void *ct) {
 
     // !!!: Doesn't handle characters outside BMP
     if (U_IS_BMP(c)) {
-        return (UChar)c;
+        return (char16_t)c;
     } else {
         return 0;
     }
 }
 
-U_CFUNC UChar U_CALLCONV
+U_CFUNC char16_t U_CALLCONV
 uregex_ucstr_unescape_charAt(int32_t offset, void *context) {
-    return ((UChar *)context)[offset];
+    return ((char16_t *)context)[offset];
 }
 
 U_NAMESPACE_END
index f422861320207224d0fac9cba42a903d2ce4a8d0..3b495d091f5e9eb67c659b02461a9efe502651a9 100644 (file)
@@ -61,10 +61,10 @@ static UHashtable *regionIDMap = nullptr;
 static UHashtable *numericCodeMap = nullptr;
 static UVector *allRegions = nullptr;
 
-static const UChar UNKNOWN_REGION_ID [] = { 0x5A, 0x5A, 0 };  /* "ZZ" */
-static const UChar OUTLYING_OCEANIA_REGION_ID [] = { 0x51, 0x4F, 0 };  /* "QO" */
-static const UChar WORLD_ID [] = { 0x30, 0x30, 0x31, 0 };  /* "001" */
-static const UChar RANGE_MARKER = 0x7E; /* '~' */
+static const char16_t UNKNOWN_REGION_ID [] = { 0x5A, 0x5A, 0 };  /* "ZZ" */
+static const char16_t OUTLYING_OCEANIA_REGION_ID [] = { 0x51, 0x4F, 0 };  /* "QO" */
+static const char16_t WORLD_ID [] = { 0x30, 0x30, 0x31, 0 };  /* "001" */
+static const char16_t RANGE_MARKER = 0x7E; /* '~' */
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RegionNameEnumeration)
 
@@ -118,10 +118,10 @@ void U_CALLCONV Region::loadRegionData(UErrorCode &status) {
     while (U_SUCCESS(status) && ures_hasNext(regionRegular.getAlias())) {
         UnicodeString regionName = ures_getNextUnicodeString(regionRegular.getAlias(),nullptr,&status);
         int32_t rangeMarkerLocation = regionName.indexOf(RANGE_MARKER);
-        UChar buf[6];
+        char16_t buf[6];
         regionName.extract(buf,6,status);
         if ( rangeMarkerLocation > 0 ) {
-            UChar endRange = regionName.charAt(rangeMarkerLocation+1);
+            char16_t endRange = regionName.charAt(rangeMarkerLocation+1);
             buf[rangeMarkerLocation] = 0;
             while (U_SUCCESS(status) && buf[rangeMarkerLocation-1] <= endRange) {
                 LocalPointer<UnicodeString> newRegion(new UnicodeString(buf), status);
@@ -137,10 +137,10 @@ void U_CALLCONV Region::loadRegionData(UErrorCode &status) {
     while (U_SUCCESS(status) && ures_hasNext(regionMacro.getAlias())) {
         UnicodeString regionName = ures_getNextUnicodeString(regionMacro.getAlias(),nullptr,&status);
         int32_t rangeMarkerLocation = regionName.indexOf(RANGE_MARKER);
-        UChar buf[6];
+        char16_t buf[6];
         regionName.extract(buf,6,status);
         if ( rangeMarkerLocation > 0 ) {
-            UChar endRange = regionName.charAt(rangeMarkerLocation+1);
+            char16_t endRange = regionName.charAt(rangeMarkerLocation+1);
             buf[rangeMarkerLocation] = 0;
             while ( buf[rangeMarkerLocation-1] <= endRange && U_SUCCESS(status)) {
                 LocalPointer<UnicodeString> newRegion(new UnicodeString(buf), status);
index e811eac2c8d7e6b551cfe5db3310e828fb98adcd..24d22a4b4bf254523ac9b33d0ec209a55a59da2b 100644 (file)
@@ -192,7 +192,7 @@ static UBool getStringByIndex(
         UnicodeString &result,
         UErrorCode &status) {
     int32_t len = 0;
-    const UChar *resStr = ures_getStringByIndex(
+    const char16_t *resStr = ures_getStringByIndex(
             resource, idx, &len, &status);
     if (U_FAILURE(status)) {
         return false;
@@ -372,8 +372,8 @@ struct RelDateTimeFmtDataSink : public ResourceSink {
 
     // Utility functions
     static UDateRelativeDateTimeFormatterStyle styleFromAliasUnicodeString(UnicodeString s) {
-        static const UChar narrow[7] = {0x002D, 0x006E, 0x0061, 0x0072, 0x0072, 0x006F, 0x0077};
-        static const UChar sshort[6] = {0x002D, 0x0073, 0x0068, 0x006F, 0x0072, 0x0074,};
+        static const char16_t narrow[7] = {0x002D, 0x006E, 0x0061, 0x0072, 0x0072, 0x006F, 0x0077};
+        static const char16_t sshort[6] = {0x002D, 0x0073, 0x0068, 0x006F, 0x0072, 0x0074,};
         if (s.endsWith(narrow, 7)) {
             return UDAT_STYLE_NARROW;
         }
@@ -1310,7 +1310,7 @@ U_CAPI int32_t U_EXPORT2
 ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
                     double                offset,
                     URelativeDateTimeUnit unit,
-                    UChar*                result,
+                    char16_t*                result,
                     int32_t               resultCapacity,
                     UErrorCode*           status)
 {
@@ -1353,7 +1353,7 @@ U_CAPI int32_t U_EXPORT2
 ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
                     double                offset,
                     URelativeDateTimeUnit unit,
-                    UChar*                result,
+                    char16_t*                result,
                     int32_t               resultCapacity,
                     UErrorCode*           status)
 {
@@ -1394,11 +1394,11 @@ ureldatefmt_formatToResult(
 
 U_CAPI int32_t U_EXPORT2
 ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
-                    const UChar *     relativeDateString,
+                    const char16_t *     relativeDateString,
                     int32_t           relativeDateStringLen,
-                    const UChar *     timeString,
+                    const char16_t *     timeString,
                     int32_t           timeStringLen,
-                    UChar*            result,
+                    char16_t*            result,
                     int32_t           resultCapacity,
                     UErrorCode*       status )
 {
index 62c884ded7b547f96d0f3392be4c38c3017b90fc..0c836a0b79fd51309bcc5cb05e17188765f9dff2 100644 (file)
@@ -34,7 +34,7 @@ U_NAMESPACE_BEGIN
 struct URelativeString {
     int32_t offset;         /** offset of this item, such as, the relative date **/
     int32_t len;            /** length of the string **/
-    const UChar* string;    /** string, or nullptr if not set **/
+    const char16_t* string;    /** string, or nullptr if not set **/
 };
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RelativeDateFormat)
@@ -149,7 +149,7 @@ bool RelativeDateFormat::operator==(const Format& other) const {
     return false;
 }
 
-static const UChar APOSTROPHE = (UChar)0x0027;
+static const char16_t APOSTROPHE = (char16_t)0x0027;
 
 UnicodeString& RelativeDateFormat::format(  Calendar& cal,
                                 UnicodeString& appendTo,
@@ -164,7 +164,7 @@ UnicodeString& RelativeDateFormat::format(  Calendar& cal,
 
     // look up string
     int32_t len = 0;
-    const UChar *theString = getStringForDay(dayDiff, len, status);
+    const char16_t *theString = getStringForDay(dayDiff, len, status);
     if(U_SUCCESS(status) && (theString!=nullptr)) {
         // found a relative string
         relativeDayString.setTo(theString, len);
@@ -347,7 +347,7 @@ RelativeDateFormat::parse(const UnicodeString& text, UErrorCode& status) const
 }
 
 
-const UChar *RelativeDateFormat::getStringForDay(int32_t day, int32_t &len, UErrorCode &status) const {
+const char16_t *RelativeDateFormat::getStringForDay(int32_t day, int32_t &len, UErrorCode &status) const {
     if(U_FAILURE(status)) {
         return nullptr;
     }
@@ -512,7 +512,7 @@ RelDateFmtDataSink::~RelDateFmtDataSink() {}
 }  // Namespace
 
 
-static const UChar patItem1[] = {0x7B,0x31,0x7D}; // "{1}"
+static const char16_t patItem1[] = {0x7B,0x31,0x7D}; // "{1}"
 static const int32_t patItem1Len = 3;
 
 void RelativeDateFormat::loadDates(UErrorCode &status) {
@@ -534,7 +534,7 @@ void RelativeDateFormat::loadDates(UErrorCode &status) {
                 }
             }
 
-            const UChar *resStr = ures_getStringByIndex(dateTimePatterns.getAlias(), glueIndex, &resStrLen, &status);
+            const char16_t *resStr = ures_getStringByIndex(dateTimePatterns.getAlias(), glueIndex, &resStrLen, &status);
             if (U_SUCCESS(status) && resStrLen >= patItem1Len && u_strncmp(resStr,patItem1,patItem1Len)==0) {
                 fCombinedHasDateAtStart = true;
             }
index 63ae8eb23810a34fd2a59051431c12bea35f5d02..c832ebe65317ccdb4ee6886a7def0605ab4e921b 100644 (file)
@@ -275,7 +275,7 @@ private:
      * @param len on output, length of string.
      * @return the string, or nullptr if none at that location.
      */
-    const UChar *getStringForDay(int32_t day, int32_t &len, UErrorCode &status) const;
+    const char16_t *getStringForDay(int32_t day, int32_t &len, UErrorCode &status) const;
 
     /**
      * Load the Date string array
index 2e558a2457458432dc5ab4850d8005ab6ce19e44..7a39afbf7b71d83fd3062951a574a8b54fd0e3e0 100644 (file)
@@ -266,10 +266,10 @@ void RegexMatcher::init2(UText *input, UErrorCode &status) {
 }
 
 
-static const UChar BACKSLASH  = 0x5c;
-static const UChar DOLLARSIGN = 0x24;
-static const UChar LEFTBRACKET = 0x7b;
-static const UChar RIGHTBRACKET = 0x7d;
+static const char16_t BACKSLASH  = 0x5c;
+static const char16_t DOLLARSIGN = 0x24;
+static const char16_t LEFTBRACKET = 0x7b;
+static const char16_t RIGHTBRACKET = 0x7d;
 
 //--------------------------------------------------------------------------------
 //
@@ -328,7 +328,7 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
                 UErrorCode lengthStatus = U_ZERO_ERROR;
                 len16 = utext_extract(fInputText, fAppendPosition, fMatchStart, nullptr, 0, &lengthStatus);
             }
-            UChar *inputChars = (UChar *)uprv_malloc(sizeof(UChar)*(len16+1));
+            char16_t *inputChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(len16+1));
             if (inputChars == nullptr) {
                 status = U_MEMORY_ALLOCATION_ERROR;
                 return *this;
@@ -364,10 +364,10 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
                 UChar32 escapedChar = u_unescapeAt(uregex_utext_unescape_charAt, &offset, INT32_MAX, &context);
                 if (escapedChar != (UChar32)0xFFFFFFFF) {
                     if (U_IS_BMP(escapedChar)) {
-                        UChar c16 = (UChar)escapedChar;
+                        char16_t c16 = (char16_t)escapedChar;
                         destLen += utext_replace(dest, destLen, destLen, &c16, 1, &status);
                     } else {
-                        UChar surrogate[2];
+                        char16_t surrogate[2];
                         surrogate[0] = U16_LEAD(escapedChar);
                         surrogate[1] = U16_TRAIL(escapedChar);
                         if (U_SUCCESS(status)) {
@@ -386,10 +386,10 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
                 (void)UTEXT_NEXT32(replacement);
                 // Plain backslash escape.  Just put out the escaped character.
                 if (U_IS_BMP(c)) {
-                    UChar c16 = (UChar)c;
+                    char16_t c16 = (char16_t)c;
                     destLen += utext_replace(dest, destLen, destLen, &c16, 1, &status);
                 } else {
-                    UChar surrogate[2];
+                    char16_t surrogate[2];
                     surrogate[0] = U16_LEAD(c);
                     surrogate[1] = U16_TRAIL(c);
                     if (U_SUCCESS(status)) {
@@ -400,10 +400,10 @@ RegexMatcher &RegexMatcher::appendReplacement(UText *dest,
         } else if (c != DOLLARSIGN) {
             // Normal char, not a $.  Copy it out without further checks.
             if (U_IS_BMP(c)) {
-                UChar c16 = (UChar)c;
+                char16_t c16 = (char16_t)c;
                 destLen += utext_replace(dest, destLen, destLen, &c16, 1, &status);
             } else {
-                UChar surrogate[2];
+                char16_t surrogate[2];
                 surrogate[0] = U16_LEAD(c);
                 surrogate[1] = U16_TRAIL(c);
                 if (U_SUCCESS(status)) {
@@ -528,7 +528,7 @@ UText *RegexMatcher::appendTail(UText *dest, UErrorCode &status) {
                 status = U_ZERO_ERROR; // buffer overflow
             }
 
-            UChar *inputChars = (UChar *)uprv_malloc(sizeof(UChar)*(len16));
+            char16_t *inputChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(len16));
             if (inputChars == nullptr) {
                 fDeferredStatus = U_MEMORY_ALLOCATION_ERROR;
             } else {
@@ -933,7 +933,7 @@ UBool RegexMatcher::findUsingChunk(UErrorCode &status) {
         startPos = (int32_t)fActiveStart;
     }
 
-    const UChar *inputBuf = fInputText->chunkContents;
+    const char16_t *inputBuf = fInputText->chunkContents;
 
     if (fMatch) {
         // Save the position of any previous successful match.
@@ -1226,7 +1226,7 @@ UnicodeString RegexMatcher::group(int32_t groupNum, UErrorCode &status) const {
     }
 
     status = U_ZERO_ERROR;
-    UChar *buf = result.getBuffer(length);
+    char16_t *buf = result.getBuffer(length);
     if (buf == nullptr) {
         status = U_MEMORY_ALLOCATION_ERROR;
     } else {
@@ -1294,7 +1294,7 @@ int64_t RegexMatcher::appendGroup(int32_t groupNum, UText *dest, UErrorCode &sta
             UErrorCode lengthStatus = U_ZERO_ERROR;
             len16 = utext_extract(fInputText, s, e, nullptr, 0, &lengthStatus);
         }
-        UChar *groupChars = (UChar *)uprv_malloc(sizeof(UChar)*(len16+1));
+        char16_t *groupChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(len16+1));
         if (groupChars == nullptr) {
             status = U_MEMORY_ALLOCATION_ERROR;
             return 0;
@@ -1366,7 +1366,7 @@ const UnicodeString &RegexMatcher::input() const {
         }
         UnicodeString *result = new UnicodeString(len16, 0, 0);
 
-        UChar *inputChars = result->getBuffer(len16);
+        char16_t *inputChars = result->getBuffer(len16);
         utext_extract(fInputText, 0, fInputLength, inputChars, len16, &status); // unterminated warning
         result->releaseBuffer(len16);
 
@@ -1411,7 +1411,7 @@ UText *RegexMatcher::getInput (UText *dest, UErrorCode &status) const {
                 UErrorCode lengthStatus = U_ZERO_ERROR;
                 input16Len = utext_extract(fInputText, 0, fInputLength, nullptr, 0, &lengthStatus); // buffer overflow error
             }
-            UChar *inputChars = (UChar *)uprv_malloc(sizeof(UChar)*(input16Len));
+            char16_t *inputChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(input16Len));
             if (inputChars == nullptr) {
                 return dest;
             }
@@ -1906,7 +1906,7 @@ RegexMatcher &RegexMatcher::reset(UText *input) {
     return *this;
 }
 
-/*RegexMatcher &RegexMatcher::reset(const UChar *) {
+/*RegexMatcher &RegexMatcher::reset(const char16_t *) {
     fDeferredStatus = U_INTERNAL_PROGRAM_ERROR;
     return *this;
 }*/
@@ -2002,9 +2002,9 @@ static UText *utext_extract_replace(UText *src, UText *dest, int64_t start, int6
         return dest;
     }
     *status = U_ZERO_ERROR;
-    MaybeStackArray<UChar, 40> buffer;
+    MaybeStackArray<char16_t, 40> buffer;
     if (length >= buffer.getCapacity()) {
-        UChar *newBuf = buffer.resize(length+1);   // Leave space for terminating Nul.
+        char16_t *newBuf = buffer.resize(length+1);   // Leave space for terminating Nul.
         if (newBuf == nullptr) {
             *status = U_MEMORY_ALLOCATION_ERROR;
         }
@@ -2021,7 +2021,7 @@ static UText *utext_extract_replace(UText *src, UText *dest, int64_t start, int6
         return nullptr;
     }
     int32_t ownedLength = 0;
-    UChar *ownedBuf = buffer.orphanOrClone(length+1, ownedLength);
+    char16_t *ownedBuf = buffer.orphanOrClone(length+1, ownedLength);
     if (ownedBuf == nullptr) {
         *status = U_MEMORY_ALLOCATION_ERROR;
         return nullptr;
@@ -2133,7 +2133,7 @@ int32_t  RegexMatcher::split(UText *input,
                     UErrorCode lengthStatus = U_ZERO_ERROR;
                     int32_t remaining16Length =
                         utext_extract(input, nextOutputStringStart, fActiveLimit, nullptr, 0, &lengthStatus);
-                    UChar *remainingChars = (UChar *)uprv_malloc(sizeof(UChar)*(remaining16Length+1));
+                    char16_t *remainingChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(remaining16Length+1));
                     if (remainingChars == nullptr) {
                         status = U_MEMORY_ALLOCATION_ERROR;
                         break;
@@ -2172,7 +2172,7 @@ int32_t  RegexMatcher::split(UText *input,
             } else {
                 UErrorCode lengthStatus = U_ZERO_ERROR;
                 int32_t remaining16Length = utext_extract(input, nextOutputStringStart, fMatchStart, nullptr, 0, &lengthStatus);
-                UChar *remainingChars = (UChar *)uprv_malloc(sizeof(UChar)*(remaining16Length+1));
+                char16_t *remainingChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(remaining16Length+1));
                 if (remainingChars == nullptr) {
                     status = U_MEMORY_ALLOCATION_ERROR;
                     break;
@@ -2215,7 +2215,7 @@ int32_t  RegexMatcher::split(UText *input,
                     if (dest[i] == nullptr) {
                         dest[i] = utext_openUChars(nullptr, nullptr, 0, &status);
                     } else {
-                        static const UChar emptyString[] = {(UChar)0};
+                        static const char16_t emptyString[] = {(char16_t)0};
                         utext_replace(dest[i], 0, utext_nativeLength(dest[i]), emptyString, 0, &status);
                     }
                 }
@@ -2242,7 +2242,7 @@ int32_t  RegexMatcher::split(UText *input,
             } else {
                 UErrorCode lengthStatus = U_ZERO_ERROR;
                 int32_t remaining16Length = utext_extract(input, nextOutputStringStart, fActiveLimit, nullptr, 0, &lengthStatus);
-                UChar *remainingChars = (UChar *)uprv_malloc(sizeof(UChar)*(remaining16Length+1));
+                char16_t *remainingChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(remaining16Length+1));
                 if (remainingChars == nullptr) {
                     status = U_MEMORY_ALLOCATION_ERROR;
                     break;
@@ -2584,7 +2584,7 @@ UBool RegexMatcher::isChunkWordBoundary(int32_t pos) {
     UBool isBoundary = false;
     UBool cIsWord    = false;
 
-    const UChar *inputBuf = fInputText->chunkContents;
+    const char16_t *inputBuf = fInputText->chunkContents;
 
     if (pos >= fLookLimit) {
         fHitEnd = true;
@@ -2811,7 +2811,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
     //
     int64_t             *pat           = fPattern->fCompiledPat->getBuffer();
 
-    const UChar         *litText       = fPattern->fLiteralText.getBuffer();
+    const char16_t      *litText       = fPattern->fLiteralText.getBuffer();
     UVector             *fSets         = fPattern->fSets;
 
     fFrameSize = fPattern->fFrameSize;
@@ -2892,7 +2892,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
                 U_ASSERT(opType == URX_STRING_LEN);
                 U_ASSERT(stringLen >= 2);
 
-                const UChar *patternString = litText+stringStartIdx;
+                const char16_t *patternString = litText+stringStartIdx;
                 int32_t patternStringIndex = 0;
                 UTEXT_SETNATIVEINDEX(fInputText, fp->fInputIdx);
                 UChar32 inputChar;
@@ -3836,7 +3836,7 @@ void RegexMatcher::MatchAt(int64_t startIdx, UBool toEnd, UErrorCode &status) {
                 //   offset to the string text, and one for the length.
                 //   The compiled string has already been case folded.
                 {
-                    const UChar *patternString = litText + opValue;
+                    const char16_t *patternString = litText + opValue;
                     int32_t      patternStringIdx  = 0;
 
                     op      = (int32_t)pat[fp->fPatIdx];
@@ -4319,10 +4319,10 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
     //
     int64_t             *pat           = fPattern->fCompiledPat->getBuffer();
 
-    const UChar         *litText       = fPattern->fLiteralText.getBuffer();
+    const char16_t      *litText       = fPattern->fLiteralText.getBuffer();
     UVector             *fSets         = fPattern->fSets;
 
-    const UChar         *inputBuf      = fInputText->chunkContents;
+    const char16_t      *inputBuf      = fInputText->chunkContents;
 
     fFrameSize = fPattern->fFrameSize;
     REStackFrame        *fp            = resetStack();
@@ -4402,10 +4402,10 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
                 U_ASSERT(opType == URX_STRING_LEN);
                 U_ASSERT(stringLen >= 2);
 
-                const UChar * pInp = inputBuf + fp->fInputIdx;
-                const UChar * pInpLimit = inputBuf + fActiveLimit;
-                const UChar * pPat = litText+stringStartIdx;
-                const UChar * pEnd = pInp + stringLen;
+                const char16_t * pInp = inputBuf + fp->fInputIdx;
+                const char16_t * pInpLimit = inputBuf + fActiveLimit;
+                const char16_t * pPat = litText+stringStartIdx;
+                const char16_t * pEnd = pInp + stringLen;
                 UBool success = true;
                 while (pInp < pEnd) {
                     if (pInp >= pInpLimit) {
@@ -4585,7 +4585,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
                 }
                 // Check whether character just before the current pos is a new-line
                 //   unless we are at the end of input
-                UChar  c = inputBuf[fp->fInputIdx - 1];
+                char16_t  c = inputBuf[fp->fInputIdx - 1];
                 if ((fp->fInputIdx < fAnchorLimit) &&
                     isLineTerminator(c)) {
                     //  It's a new-line.  ^ is true.  Success.
@@ -4607,7 +4607,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
                 }
                 // Check whether character just before the current pos is a new-line
                 U_ASSERT(fp->fInputIdx <= fAnchorLimit);
-                UChar  c = inputBuf[fp->fInputIdx - 1];
+                char16_t  c = inputBuf[fp->fInputIdx - 1];
                 if (c != 0x0a) {
                     // Not at the start of a line.  Back-track out.
                     fp = (REStackFrame *)fStack->popFrame(fFrameSize);
@@ -4695,7 +4695,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
                 if (isLineTerminator(c)) {
                     if (c == 0x0d && fp->fInputIdx < fActiveLimit) {
                         // Check for CR/LF sequence. Consume both together when found.
-                        UChar c2;
+                        char16_t c2;
                         U16_NEXT(inputBuf, fp->fInputIdx, fActiveLimit, c2);
                         if (c2 != 0x0a) {
                             U16_PREV(inputBuf, 0, fp->fInputIdx, c2);
@@ -5302,7 +5302,7 @@ void RegexMatcher::MatchChunkAt(int32_t startIdx, UBool toEnd, UErrorCode &statu
             //   offset to the string text, and one for the length.
             //   The compiled string has already been case folded.
             {
-                const UChar *patternString = litText + opValue;
+                const char16_t *patternString = litText + opValue;
 
                 op      = (int32_t)pat[fp->fPatIdx];
                 fp->fPatIdx++;
index 1dea638d8c6e5ea5e8dcb3f7fa43a576f24a60ad..40af1845c7beb4f726db32fb3fa9a3516d1969b7 100644 (file)
@@ -17,7 +17,7 @@
 #include "remtrans.h"
 #include "unicode/unifilt.h"
 
-static const UChar CURR_ID[] = {65, 110, 121, 45, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x00}; /* "Any-Remove" */
+static const char16_t CURR_ID[] = {65, 110, 121, 45, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x00}; /* "Any-Remove" */
 
 U_NAMESPACE_BEGIN
 
index 587a4d8b9c958e75b00dd02cdd34ac03cc10d318..c0a88f70d9256b1dfd533b33323ba8bbcb92bd47 100644 (file)
@@ -587,7 +587,7 @@ UnicodeString RegexPattern::pattern() const {
         UnicodeString result;
 
         status = U_ZERO_ERROR;
-        UChar *resultChars = result.getBuffer(len16);
+        char16_t *resultChars = result.getBuffer(len16);
         utext_extract(fPattern, 0, nativeLen, resultChars, len16, &status); // unterminated warning
         result.releaseBuffer(len16);
 
index 319d30db5b3d54c6119f65b919ebe3728e3b3f47..e9482628d9b605ceb303d6cc2ae4735e298fe56b 100644 (file)
@@ -566,7 +566,7 @@ RuleBasedCollator::getVariableTop(UErrorCode & /*errorCode*/) const {
 }
 
 uint32_t
-RuleBasedCollator::setVariableTop(const UChar *varTop, int32_t len, UErrorCode &errorCode) {
+RuleBasedCollator::setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return 0; }
     if(varTop == nullptr && len !=0) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
@@ -722,8 +722,8 @@ RuleBasedCollator::compare(const UnicodeString &left, const UnicodeString &right
 }
 
 UCollationResult
-RuleBasedCollator::compare(const UChar *left, int32_t leftLength,
-                           const UChar *right, int32_t rightLength,
+RuleBasedCollator::compare(const char16_t *left, int32_t leftLength,
+                           const char16_t *right, int32_t rightLength,
                            UErrorCode &errorCode) const {
     if(U_FAILURE(errorCode)) { return UCOL_EQUAL; }
     if((left == nullptr && leftLength != 0) || (right == nullptr && rightLength != 0)) {
@@ -821,15 +821,15 @@ protected:
      */
     virtual UChar32 nextRawCodePoint() = 0;
 private:
-    const UChar *decomp;
-    UChar buffer[4];
+    const char16_t *decomp;
+    char16_t buffer[4];
     int32_t index;
     int32_t length;
 };
 
 class UTF16NFDIterator : public NFDIterator {
 public:
-    UTF16NFDIterator(const UChar *text, const UChar *textLimit) : s(text), limit(textLimit) {}
+    UTF16NFDIterator(const char16_t *text, const char16_t *textLimit) : s(text), limit(textLimit) {}
 protected:
     virtual UChar32 nextRawCodePoint() override {
         if(s == limit) { return U_SENTINEL; }
@@ -838,7 +838,7 @@ protected:
             s = nullptr;
             return U_SENTINEL;
         }
-        UChar trail;
+        char16_t trail;
         if(U16_IS_LEAD(c) && s != limit && U16_IS_TRAIL(trail = *s)) {
             ++s;
             c = U16_GET_SUPPLEMENTARY(c, trail);
@@ -846,16 +846,16 @@ protected:
         return c;
     }
 
-    const UChar *s;
-    const UChar *limit;
+    const char16_t *s;
+    const char16_t *limit;
 };
 
 class FCDUTF16NFDIterator : public UTF16NFDIterator {
 public:
-    FCDUTF16NFDIterator(const Normalizer2Impl &nfcImpl, const UChar *text, const UChar *textLimit)
+    FCDUTF16NFDIterator(const Normalizer2Impl &nfcImpl, const char16_t *text, const char16_t *textLimit)
             : UTF16NFDIterator(nullptr, nullptr) {
         UErrorCode errorCode = U_ZERO_ERROR;
-        const UChar *spanLimit = nfcImpl.makeFCD(text, textLimit, nullptr, errorCode);
+        const char16_t *spanLimit = nfcImpl.makeFCD(text, textLimit, nullptr, errorCode);
         if(U_FAILURE(errorCode)) { return; }
         if(spanLimit == textLimit || (textLimit == nullptr && *spanLimit == 0)) {
             s = text;
@@ -966,8 +966,8 @@ UCollationResult compareNFDIter(const Normalizer2Impl &nfcImpl,
 }  // namespace
 
 UCollationResult
-RuleBasedCollator::doCompare(const UChar *left, int32_t leftLength,
-                             const UChar *right, int32_t rightLength,
+RuleBasedCollator::doCompare(const char16_t *left, int32_t leftLength,
+                             const char16_t *right, int32_t rightLength,
                              UErrorCode &errorCode) const {
     // U_FAILURE(errorCode) checked by caller.
     if(left == right && leftLength == rightLength) {
@@ -975,13 +975,13 @@ RuleBasedCollator::doCompare(const UChar *left, int32_t leftLength,
     }
 
     // Identical-prefix test.
-    const UChar *leftLimit;
-    const UChar *rightLimit;
+    const char16_t *leftLimit;
+    const char16_t *rightLimit;
     int32_t equalPrefixLength = 0;
     if(leftLength < 0) {
         leftLimit = nullptr;
         rightLimit = nullptr;
-        UChar c;
+        char16_t c;
         while((c = left[equalPrefixLength]) == right[equalPrefixLength]) {
             if(c == 0) { return UCOL_EQUAL; }
             ++equalPrefixLength;
@@ -1283,7 +1283,7 @@ RuleBasedCollator::getCollationKey(const UnicodeString &s, CollationKey &key,
 }
 
 CollationKey &
-RuleBasedCollator::getCollationKey(const UChar *s, int32_t length, CollationKey& key,
+RuleBasedCollator::getCollationKey(const char16_t *s, int32_t length, CollationKey& key,
                                    UErrorCode &errorCode) const {
     if(U_FAILURE(errorCode)) {
         return key.setToBogus();
@@ -1312,7 +1312,7 @@ RuleBasedCollator::getSortKey(const UnicodeString &s,
 }
 
 int32_t
-RuleBasedCollator::getSortKey(const UChar *s, int32_t length,
+RuleBasedCollator::getSortKey(const char16_t *s, int32_t length,
                               uint8_t *dest, int32_t capacity) const {
     if((s == nullptr && length != 0) || capacity < 0 || (dest == nullptr && capacity > 0)) {
         return 0;
@@ -1330,10 +1330,10 @@ RuleBasedCollator::getSortKey(const UChar *s, int32_t length,
 }
 
 void
-RuleBasedCollator::writeSortKey(const UChar *s, int32_t length,
+RuleBasedCollator::writeSortKey(const char16_t *s, int32_t length,
                                 SortKeyByteSink &sink, UErrorCode &errorCode) const {
     if(U_FAILURE(errorCode)) { return; }
-    const UChar *limit = (length >= 0) ? s + length : nullptr;
+    const char16_t *limit = (length >= 0) ? s + length : nullptr;
     UBool numeric = settings->isNumeric();
     CollationKeys::LevelCallback callback;
     if(settings->dontCheckFCD()) {
@@ -1355,10 +1355,10 @@ RuleBasedCollator::writeSortKey(const UChar *s, int32_t length,
 }
 
 void
-RuleBasedCollator::writeIdenticalLevel(const UChar *s, const UChar *limit,
+RuleBasedCollator::writeIdenticalLevel(const char16_t *s, const char16_t *limit,
                                        SortKeyByteSink &sink, UErrorCode &errorCode) const {
     // NFD quick check
-    const UChar *nfdQCYesLimit = data->nfcImpl.decompose(s, limit, nullptr, errorCode);
+    const char16_t *nfdQCYesLimit = data->nfcImpl.decompose(s, limit, nullptr, errorCode);
     if(U_FAILURE(errorCode)) { return; }
     sink.Append(Collation::LEVEL_SEPARATOR_BYTE);
     UChar32 prev = 0;
@@ -1467,9 +1467,9 @@ RuleBasedCollator::internalNextSortKeyPart(UCharIterator *iter, uint32_t state[2
         for(;;) {
             UChar32 c = iter->next(iter);
             if(c < 0) { break; }
-            s.append((UChar)c);
+            s.append((char16_t)c);
         }
-        const UChar *sArray = s.getBuffer();
+        const char16_t *sArray = s.getBuffer();
         writeIdenticalLevel(sArray, sArray + s.length(), sink, errorCode);
         if(U_FAILURE(errorCode)) { return 0; }
         if(sink.NumberOfBytesAppended() > count) {
@@ -1492,8 +1492,8 @@ void
 RuleBasedCollator::internalGetCEs(const UnicodeString &str, UVector64 &ces,
                                   UErrorCode &errorCode) const {
     if(U_FAILURE(errorCode)) { return; }
-    const UChar *s = str.getBuffer();
-    const UChar *limit = s + str.length();
+    const char16_t *s = str.getBuffer();
+    const char16_t *limit = s + str.length();
     UBool numeric = settings->isNumeric();
     if(settings->dontCheckFCD()) {
         UTF16CollationIterator iter(data, numeric, s, s, limit);
index a9a3105bdb2d5b874265a04cfd691cbac9792439..8f9c19c384d796d1b2f3e56e6c7b8caaec83af9e 100644 (file)
@@ -20,7 +20,7 @@
 
 U_NAMESPACE_BEGIN
 
-static const UChar kSuperscriptDigits[] = {
+static const char16_t kSuperscriptDigits[] = {
         0x2070,
         0xB9,
         0xB2,
@@ -32,8 +32,8 @@ static const UChar kSuperscriptDigits[] = {
         0x2078,
         0x2079};
 
-static const UChar kSuperscriptPlusSign = 0x207A;
-static const UChar kSuperscriptMinusSign = 0x207B;
+static const char16_t kSuperscriptPlusSign = 0x207A;
+static const char16_t kSuperscriptMinusSign = 0x207B;
 
 static UBool copyAsSuperscript(
         const UnicodeString &s,
index bf26ccdf43eefc0e0379097f032ca1aa823bb0a6..736a85cf8c1f24f076fea04998e71d4a3252673f 100644 (file)
@@ -198,7 +198,7 @@ UnicodeString &ScriptSet::displayScripts(UnicodeString &dest) const {
     UBool firstTime = true;
     for (int32_t i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) {
         if (!firstTime) {
-            dest.append((UChar)0x20);
+            dest.append((char16_t)0x20);
         }
         firstTime = false;
         const char *scriptName = uscript_getShortName((UScriptCode(i)));
index 629c5f1529b9f5579fa370577d4ed65a0fdbd90b..31b67ea3f919c43d2d5f76c210c24f2d5cbaf53e 100644 (file)
@@ -191,7 +191,7 @@ bool SearchIterator::operator==(const SearchIterator &that) const
             m_search_->textLength       == that.m_search_->textLength &&
             getOffset() == that.getOffset() &&
             (uprv_memcmp(m_search_->text, that.m_search_->text, 
-                              m_search_->textLength * sizeof(UChar)) == 0));
+                              m_search_->textLength * sizeof(char16_t)) == 0));
 }
 
 // public methods ----------------------------------------------------
index 27acee5ce2ba5d5382cd22988b89beb91156f65a..157173c2c91c6e66ee483a30912e843413d311d6 100644 (file)
@@ -41,7 +41,7 @@ U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SelectFormat)
 
-static const UChar SELECT_KEYWORD_OTHER[] = {LOW_O, LOW_T, LOW_H, LOW_E, LOW_R, 0};
+static const char16_t SELECT_KEYWORD_OTHER[] = {LOW_O, LOW_T, LOW_H, LOW_E, LOW_R, 0};
 
 SelectFormat::SelectFormat(const UnicodeString& pat,
                            UErrorCode& status) : msgPattern(status) {
index a36d1a5c347fb414428df899c23d8407eaea8909..6cf875efdeefcd635534ce71cffb293241f470e8 100644 (file)
 
 U_NAMESPACE_BEGIN
 
-#define DOT               ((UChar)0x002E)
-#define SINGLE_QUOTE      ((UChar)0x0027)
-#define SLASH             ((UChar)0x002F)
-#define BACKSLASH         ((UChar)0x005C)
-#define SPACE             ((UChar)0x0020)
-#define TAB               ((UChar)0x0009)
-#define QUOTATION_MARK    ((UChar)0x0022)
-#define ASTERISK          ((UChar)0x002A)
-#define COMMA             ((UChar)0x002C)
-#define HYPHEN            ((UChar)0x002D)
-#define U_ZERO            ((UChar)0x0030)
-#define U_ONE             ((UChar)0x0031)
-#define U_TWO             ((UChar)0x0032)
-#define U_THREE           ((UChar)0x0033)
-#define U_FOUR            ((UChar)0x0034)
-#define U_FIVE            ((UChar)0x0035)
-#define U_SIX             ((UChar)0x0036)
-#define U_SEVEN           ((UChar)0x0037)
-#define U_EIGHT           ((UChar)0x0038)
-#define U_NINE            ((UChar)0x0039)
-#define COLON             ((UChar)0x003A)
-#define SEMI_COLON        ((UChar)0x003B)
-#define CAP_A             ((UChar)0x0041)
-#define CAP_B             ((UChar)0x0042)
-#define CAP_R             ((UChar)0x0052)
-#define CAP_Z             ((UChar)0x005A)
-#define LOWLINE           ((UChar)0x005F)
-#define LEFTBRACE         ((UChar)0x007B)
-#define RIGHTBRACE        ((UChar)0x007D)
+#define DOT               ((char16_t)0x002E)
+#define SINGLE_QUOTE      ((char16_t)0x0027)
+#define SLASH             ((char16_t)0x002F)
+#define BACKSLASH         ((char16_t)0x005C)
+#define SPACE             ((char16_t)0x0020)
+#define TAB               ((char16_t)0x0009)
+#define QUOTATION_MARK    ((char16_t)0x0022)
+#define ASTERISK          ((char16_t)0x002A)
+#define COMMA             ((char16_t)0x002C)
+#define HYPHEN            ((char16_t)0x002D)
+#define U_ZERO            ((char16_t)0x0030)
+#define U_ONE             ((char16_t)0x0031)
+#define U_TWO             ((char16_t)0x0032)
+#define U_THREE           ((char16_t)0x0033)
+#define U_FOUR            ((char16_t)0x0034)
+#define U_FIVE            ((char16_t)0x0035)
+#define U_SIX             ((char16_t)0x0036)
+#define U_SEVEN           ((char16_t)0x0037)
+#define U_EIGHT           ((char16_t)0x0038)
+#define U_NINE            ((char16_t)0x0039)
+#define COLON             ((char16_t)0x003A)
+#define SEMI_COLON        ((char16_t)0x003B)
+#define CAP_A             ((char16_t)0x0041)
+#define CAP_B             ((char16_t)0x0042)
+#define CAP_R             ((char16_t)0x0052)
+#define CAP_Z             ((char16_t)0x005A)
+#define LOWLINE           ((char16_t)0x005F)
+#define LEFTBRACE         ((char16_t)0x007B)
+#define RIGHTBRACE        ((char16_t)0x007D)
 
-#define LOW_A             ((UChar)0x0061)
-#define LOW_B             ((UChar)0x0062)
-#define LOW_C             ((UChar)0x0063)
-#define LOW_D             ((UChar)0x0064)
-#define LOW_E             ((UChar)0x0065)
-#define LOW_F             ((UChar)0x0066)
-#define LOW_G             ((UChar)0x0067)
-#define LOW_H             ((UChar)0x0068)
-#define LOW_I             ((UChar)0x0069)
-#define LOW_J             ((UChar)0x006a)
-#define LOW_K             ((UChar)0x006B)
-#define LOW_L             ((UChar)0x006C)
-#define LOW_M             ((UChar)0x006D)
-#define LOW_N             ((UChar)0x006E)
-#define LOW_O             ((UChar)0x006F)
-#define LOW_P             ((UChar)0x0070)
-#define LOW_Q             ((UChar)0x0071)
-#define LOW_R             ((UChar)0x0072)
-#define LOW_S             ((UChar)0x0073)
-#define LOW_T             ((UChar)0x0074)
-#define LOW_U             ((UChar)0x0075)
-#define LOW_V             ((UChar)0x0076)
-#define LOW_W             ((UChar)0x0077)
-#define LOW_X             ((UChar)0x0078)
-#define LOW_Y             ((UChar)0x0079)
-#define LOW_Z             ((UChar)0x007A)
+#define LOW_A             ((char16_t)0x0061)
+#define LOW_B             ((char16_t)0x0062)
+#define LOW_C             ((char16_t)0x0063)
+#define LOW_D             ((char16_t)0x0064)
+#define LOW_E             ((char16_t)0x0065)
+#define LOW_F             ((char16_t)0x0066)
+#define LOW_G             ((char16_t)0x0067)
+#define LOW_H             ((char16_t)0x0068)
+#define LOW_I             ((char16_t)0x0069)
+#define LOW_J             ((char16_t)0x006a)
+#define LOW_K             ((char16_t)0x006B)
+#define LOW_L             ((char16_t)0x006C)
+#define LOW_M             ((char16_t)0x006D)
+#define LOW_N             ((char16_t)0x006E)
+#define LOW_O             ((char16_t)0x006F)
+#define LOW_P             ((char16_t)0x0070)
+#define LOW_Q             ((char16_t)0x0071)
+#define LOW_R             ((char16_t)0x0072)
+#define LOW_S             ((char16_t)0x0073)
+#define LOW_T             ((char16_t)0x0074)
+#define LOW_U             ((char16_t)0x0075)
+#define LOW_V             ((char16_t)0x0076)
+#define LOW_W             ((char16_t)0x0077)
+#define LOW_X             ((char16_t)0x0078)
+#define LOW_Y             ((char16_t)0x0079)
+#define LOW_Z             ((char16_t)0x007A)
 
 class UnicodeSet;
 
index 7f71adebca3406406f97bf1192bb6500c6585d6c..ec63a6ea6849ccee223776f8ca9c61fb7db65e79 100644 (file)
@@ -53,8 +53,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SimpleTimeZone)
 // Gregorian calendar started.
 const int8_t SimpleTimeZone::STATICMONTHLENGTH[] = {31,29,31,30,31,30,31,31,30,31,30,31};
 
-static const UChar DST_STR[] = {0x0028,0x0044,0x0053,0x0054,0x0029,0}; // "(DST)"
-static const UChar STD_STR[] = {0x0028,0x0053,0x0054,0x0044,0x0029,0}; // "(STD)"
+static const char16_t DST_STR[] = {0x0028,0x0044,0x0053,0x0054,0x0029,0}; // "(DST)"
+static const char16_t STD_STR[] = {0x0028,0x0053,0x0054,0x0044,0x0029,0}; // "(STD)"
 
 
 // *****************************************************************************
index afb035c585f068e078481b5345e7343b8d0ba837..09f3752dcee662f3f28901b861f6f441068fc833 100644 (file)
@@ -95,16 +95,16 @@ U_NAMESPACE_BEGIN
 // GMT-minutes. For instance, in France the time zone is GMT+60.
 // Also accepted are GMT+H:MM or GMT-H:MM.
 // Currently not being used
-//static const UChar gGmt[]      = {0x0047, 0x004D, 0x0054, 0x0000};         // "GMT"
-//static const UChar gGmtPlus[]  = {0x0047, 0x004D, 0x0054, 0x002B, 0x0000}; // "GMT+"
-//static const UChar gGmtMinus[] = {0x0047, 0x004D, 0x0054, 0x002D, 0x0000}; // "GMT-"
-//static const UChar gDefGmtPat[]       = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0x0000}; /* GMT{0} */
-//static const UChar gDefGmtNegHmsPat[] = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* -HH:mm:ss */
-//static const UChar gDefGmtNegHmPat[]  = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* -HH:mm */
-//static const UChar gDefGmtPosHmsPat[] = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* +HH:mm:ss */
-//static const UChar gDefGmtPosHmPat[]  = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* +HH:mm */
-//static const UChar gUt[]       = {0x0055, 0x0054, 0x0000};  // "UT"
-//static const UChar gUtc[]      = {0x0055, 0x0054, 0x0043, 0x0000};  // "UT"
+//static const char16_t gGmt[]      = {0x0047, 0x004D, 0x0054, 0x0000};         // "GMT"
+//static const char16_t gGmtPlus[]  = {0x0047, 0x004D, 0x0054, 0x002B, 0x0000}; // "GMT+"
+//static const char16_t gGmtMinus[] = {0x0047, 0x004D, 0x0054, 0x002D, 0x0000}; // "GMT-"
+//static const char16_t gDefGmtPat[]       = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0x0000}; /* GMT{0} */
+//static const char16_t gDefGmtNegHmsPat[] = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* -HH:mm:ss */
+//static const char16_t gDefGmtNegHmPat[]  = {0x002D, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* -HH:mm */
+//static const char16_t gDefGmtPosHmsPat[] = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0x0000}; /* +HH:mm:ss */
+//static const char16_t gDefGmtPosHmPat[]  = {0x002B, 0x0048, 0x0048, 0x003A, 0x006D, 0x006D, 0x0000}; /* +HH:mm */
+//static const char16_t gUt[]       = {0x0055, 0x0054, 0x0000};  // "UT"
+//static const char16_t gUtc[]      = {0x0055, 0x0054, 0x0043, 0x0000};  // "UT"
 
 typedef enum GmtPatSize {
     kGmtLen = 3,
@@ -160,7 +160,7 @@ static const int8_t kTimeFieldsCount = 10;
 
 // This is a pattern-of-last-resort used when we can't load a usable pattern out
 // of a resource.
-static const UChar gDefaultPattern[] =
+static const char16_t gDefaultPattern[] =
 {
     0x79, 0x4D, 0x4D, 0x64, 0x64, 0x20, 0x68, 0x68, 0x3A, 0x6D, 0x6D, 0x20, 0x61, 0
 };  /* "yMMdd hh:mm a" */
@@ -168,13 +168,13 @@ static const UChar gDefaultPattern[] =
 // This prefix is designed to NEVER MATCH real text, in order to
 // suppress the parsing of negative numbers.  Adjust as needed (if
 // this becomes valid Unicode).
-static const UChar SUPPRESS_NEGATIVE_PREFIX[] = {0xAB00, 0};
+static const char16_t SUPPRESS_NEGATIVE_PREFIX[] = {0xAB00, 0};
 
 /**
  * These are the tags we expect to see in normal resource bundle files associated
  * with a locale.
  */
-static const UChar QUOTE = 0x27; // Single quote
+static const char16_t QUOTE = 0x27; // Single quote
 
 /*
  * The field range check bias for each UDateFormatField.
@@ -649,7 +649,7 @@ SimpleDateFormat::operator==(const Format& other) const
 }
 
 //----------------------------------------------------------------------
-static const UChar* timeSkeletons[4] = {
+static const char16_t* timeSkeletons[4] = {
     u"jmmsszzzz",   // kFull
     u"jmmssz",      // kLong
     u"jmmss",       // kMedium
@@ -714,7 +714,7 @@ void SimpleDateFormat::construct(EStyle timeStyle,
         return;
     }
 
-    const UChar *resStr,*ovrStr;
+    const char16_t *resStr,*ovrStr;
     int32_t resStrLen,ovrStrLen = 0;
     fDateOverride.setToBogus();
     fTimeOverride.setToBogus();
@@ -1059,14 +1059,14 @@ SimpleDateFormat::_format(Calendar& cal, UnicodeString& appendTo,
     }
 
     UBool inQuote = false;
-    UChar prevCh = 0;
+    char16_t prevCh = 0;
     int32_t count = 0;
     int32_t fieldNum = 0;
     UDisplayContext capitalizationContext = getContext(UDISPCTX_TYPE_CAPITALIZATION, status);
 
     // loop through the pattern string character by character
     for (int32_t i = 0; i < fPattern.length() && U_SUCCESS(status); ++i) {
-        UChar ch = fPattern[i];
+        char16_t ch = fPattern[i];
 
         // Use subFormat() to format a repeated pattern character
         // when a different pattern or non-pattern character is seen
@@ -1079,7 +1079,7 @@ SimpleDateFormat::_format(Calendar& cal, UnicodeString& appendTo,
             // Consecutive single quotes are a single quote literal,
             // either outside of quotes or between quotes
             if ((i+1) < fPattern.length() && fPattern[i+1] == QUOTE) {
-                appendTo += (UChar)QUOTE;
+                appendTo += (char16_t)QUOTE;
                 ++i;
             } else {
                 inQuote = ! inQuote;
@@ -1131,7 +1131,7 @@ SimpleDateFormat::fgCalendarFieldToLevel[] =
     /*A?.*/ 40, 0, 0
 };
 
-int32_t SimpleDateFormat::getLevelFromChar(UChar ch) {
+int32_t SimpleDateFormat::getLevelFromChar(char16_t ch) {
     // Map date field LETTER into calendar field level.
     // the larger the level, the smaller the field unit.
     // NOTE: if new fields adds in, the table needs to update.
@@ -1161,7 +1161,7 @@ int32_t SimpleDateFormat::getLevelFromChar(UChar ch) {
     return ch < UPRV_LENGTHOF(mapCharToLevel) ? mapCharToLevel[ch] : -1;
 }
 
-UBool SimpleDateFormat::isSyntaxChar(UChar ch) {
+UBool SimpleDateFormat::isSyntaxChar(char16_t ch) {
     static const UBool mapCharToIsSyntax[] = {
         //
         false, false, false, false, false, false, false, false,
@@ -1358,7 +1358,7 @@ SimpleDateFormat::processOverrideString(const Locale &locale, const UnicodeStrin
     NSOverride *overrideList = nullptr;
 
     while (moreToProcess) {
-        int32_t delimiterPosition = str.indexOf((UChar)ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE,start);
+        int32_t delimiterPosition = str.indexOf((char16_t)ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE,start);
         if (delimiterPosition == -1) {
             moreToProcess = false;
             len = str.length() - start;
@@ -1366,7 +1366,7 @@ SimpleDateFormat::processOverrideString(const Locale &locale, const UnicodeStrin
             len = delimiterPosition - start;
         }
         UnicodeString currentString(str,start,len);
-        int32_t equalSignPosition = currentString.indexOf((UChar)ULOC_KEYWORD_ASSIGN_UNICODE,0);
+        int32_t equalSignPosition = currentString.indexOf((char16_t)ULOC_KEYWORD_ASSIGN_UNICODE,0);
         if (equalSignPosition == -1) { // Simple override string such as "hebrew"
             nsName.setTo(currentString);
             ovrField.setToBogus();
@@ -1750,7 +1750,7 @@ SimpleDateFormat::subFormat(UnicodeString &appendTo,
     case UDAT_TIMEZONE_ISO_FIELD: // 'X'
     case UDAT_TIMEZONE_ISO_LOCAL_FIELD: // 'x'
         {
-            UChar zsbuf[ZONE_NAME_U16_MAX];
+            char16_t zsbuf[ZONE_NAME_U16_MAX];
             UnicodeString zoneString(zsbuf, 0, UPRV_LENGTHOF(zsbuf));
             const TimeZone& tz = cal.getTimeZone();
             UDate date = cal.getTime(status);
@@ -2113,7 +2113,7 @@ void SimpleDateFormat::adoptNumberFormat(const UnicodeString& fields, NumberForm
         return;
     }
     for (int i=0; i<fields.length(); i++) {
-        UChar field = fields.charAt(i);
+        char16_t field = fields.charAt(i);
         // if the pattern character is unrecognized, signal an error and bail out
         UDateFormatField patternCharIndex = DateFormatSymbols::getPatternCharIndex(field);
         if (patternCharIndex == UDAT_FIELD_COUNT) {
@@ -2130,7 +2130,7 @@ void SimpleDateFormat::adoptNumberFormat(const UnicodeString& fields, NumberForm
 }
 
 const NumberFormat *
-SimpleDateFormat::getNumberFormatForField(UChar field) const {
+SimpleDateFormat::getNumberFormatForField(char16_t field) const {
     UDateFormatField index = DateFormatSymbols::getPatternCharIndex(field);
     if (index == UDAT_FIELD_COUNT) {
         return nullptr;
@@ -2185,7 +2185,7 @@ SimpleDateFormat::zeroPaddingNumber(
  * Return true if the given format character, occurring count
  * times, represents a numeric field.
  */
-UBool SimpleDateFormat::isNumeric(UChar formatChar, int32_t count) {
+UBool SimpleDateFormat::isNumeric(char16_t formatChar, int32_t count) {
     return DateFormatSymbols::isNumericPatternChar(formatChar, count);
 }
 
@@ -2195,7 +2195,7 @@ SimpleDateFormat::isAtNumericField(const UnicodeString &pattern, int32_t pattern
         // not at any field
         return false;
     }
-    UChar ch = pattern.charAt(patternOffset);
+    char16_t ch = pattern.charAt(patternOffset);
     UDateFormatField f = DateFormatSymbols::getPatternCharIndex(ch);
     if (f == UDAT_FIELD_COUNT) {
         // not at any field
@@ -2212,7 +2212,7 @@ SimpleDateFormat::isAfterNonNumericField(const UnicodeString &pattern, int32_t p
         // not after any field
         return false;
     }
-    UChar ch = pattern.charAt(--patternOffset);
+    char16_t ch = pattern.charAt(--patternOffset);
     UDateFormatField f = DateFormatSymbols::getPatternCharIndex(ch);
     if (f == UDAT_FIELD_COUNT) {
         // not after any field
@@ -2286,7 +2286,7 @@ SimpleDateFormat::parse(const UnicodeString& text, Calendar& cal, ParsePosition&
     }
 
     for (int32_t i=0; i<fPattern.length(); ++i) {
-        UChar ch = fPattern.charAt(i);
+        char16_t ch = fPattern.charAt(i);
 
         // Handle alphabetic field characters.
         if (!inQuote && isSyntaxChar(ch)) {
@@ -2359,7 +2359,7 @@ SimpleDateFormat::parse(const UnicodeString& text, Calendar& cal, ParsePosition&
 
                     if (i+1 < fPattern.length()) {
                         // move to next pattern character
-                        UChar c = fPattern.charAt(i+1);
+                        char16_t c = fPattern.charAt(i+1);
 
                         // check for whitespace
                         if (PatternProps::isWhiteSpace(c)) {
@@ -2730,7 +2730,7 @@ UBool SimpleDateFormat::matchLiterals(const UnicodeString &pattern,
 
     // scan pattern looking for contiguous literal characters
     for ( ; i < pattern.length(); i += 1) {
-        UChar ch = pattern.charAt(i);
+        char16_t ch = pattern.charAt(i);
 
         if (!inQuote && isSyntaxChar(ch)) {
             break;
@@ -2777,7 +2777,7 @@ UBool SimpleDateFormat::matchLiterals(const UnicodeString &pattern,
             int32_t tStart = t;
 
             while (t < text.length()) {
-                UChar tch = text.charAt(t);
+                char16_t tch = text.charAt(t);
 
                 if (!u_isUWhiteSpace(tch) && !PatternProps::isWhiteSpace(tch)) {
                     break;
@@ -2814,7 +2814,7 @@ UBool SimpleDateFormat::matchLiterals(const UnicodeString &pattern,
                 }
                 // if it is actual whitespace and we're whitespace lenient it's OK
 
-                UChar wsc = text.charAt(t);
+                char16_t wsc = text.charAt(t);
                 if(PatternProps::isWhiteSpace(wsc)) {
                     // Lenient mode and it's just whitespace we skip it
                     ++t;
@@ -2845,7 +2845,7 @@ UBool SimpleDateFormat::matchLiterals(const UnicodeString &pattern,
         }
 
         for (t = textOffset; t < text.length(); t += 1) {
-            UChar ch = text.charAt(t);
+            char16_t ch = text.charAt(t);
 
             if (ignorables == nullptr || !ignorables->contains(ch)) {
                 break;
@@ -3007,7 +3007,7 @@ SimpleDateFormat::set2DigitYearStart(UDate d, UErrorCode& status)
  * Private member function that converts the parsed date strings into
  * timeFields. Returns -start (for ParsePosition) if failed.
  */
-int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UChar ch, int32_t count,
+int32_t SimpleDateFormat::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,
                            int32_t *dayPeriod) const
@@ -3712,8 +3712,8 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC
     // so we should not get here. Leave support in for future definition.
     case UDAT_TIME_SEPARATOR_FIELD:
         {
-            static const UChar def_sep = DateFormatSymbols::DEFAULT_TIME_SEPARATOR;
-            static const UChar alt_sep = DateFormatSymbols::ALTERNATE_TIME_SEPARATOR;
+            static const char16_t def_sep = DateFormatSymbols::DEFAULT_TIME_SEPARATOR;
+            static const char16_t alt_sep = DateFormatSymbols::ALTERNATE_TIME_SEPARATOR;
 
             // Try matching a time separator.
             int32_t count_sep = 1;
@@ -3967,7 +3967,7 @@ void SimpleDateFormat::translatePattern(const UnicodeString& originalPattern,
     translatedPattern.remove();
     UBool inQuote = false;
     for (int32_t i = 0; i < originalPattern.length(); ++i) {
-        UChar c = originalPattern[i];
+        char16_t c = originalPattern[i];
         if (inQuote) {
             if (c == QUOTE) {
                 inQuote = false;
@@ -4182,9 +4182,9 @@ SimpleDateFormat::isFieldUnitIgnored(const UnicodeString& pattern,
                                      UCalendarDateFields field) {
     int32_t fieldLevel = fgCalendarFieldToLevel[field];
     int32_t level;
-    UChar ch;
+    char16_t ch;
     UBool inQuote = false;
-    UChar prevCh = 0;
+    char16_t prevCh = 0;
     int32_t count = 0;
 
     for (int32_t i = 0; i < pattern.length(); ++i) {
@@ -4349,7 +4349,7 @@ SimpleDateFormat::compareSimpleAffix(const UnicodeString& affix,
 
 int32_t
 SimpleDateFormat::skipPatternWhiteSpace(const UnicodeString& text, int32_t pos) const {
-    const UChar* s = text.getBuffer();
+    const char16_t* s = text.getBuffer();
     return (int32_t)(PatternProps::skipWhiteSpace(s + pos, text.length() - pos) - s);
 }
 
@@ -4388,7 +4388,7 @@ void SimpleDateFormat::parsePattern() {
     int len = fPattern.length();
     UBool inQuote = false;
     for (int32_t i = 0; i < len; ++i) {
-        UChar ch = fPattern[i];
+        char16_t ch = fPattern[i];
         if (ch == QUOTE) {
             inQuote = !inQuote;
         }
index 5a6069bf7ddc47a5484433c1c8eedbe48b2c7c0d..9183e925503c3b63a2f0f01f3323f7e044b9b517 100644 (file)
@@ -84,14 +84,14 @@ int32_t StandardPlural::indexOrNegativeFromString(const char *keyword) {
     return -1;
 }
 
-static const UChar gZero[] = u"zero";
-static const UChar gOne[] = u"one";
-static const UChar gTwo[] = u"two";
-static const UChar gFew[] = u"few";
-static const UChar gMany[] = u"many";
-static const UChar gOther[] = u"other";
-static const UChar gEq0[] = u"=0";
-static const UChar gEq1[] = u"=1";
+static const char16_t gZero[] = u"zero";
+static const char16_t gOne[] = u"one";
+static const char16_t gTwo[] = u"two";
+static const char16_t gFew[] = u"few";
+static const char16_t gMany[] = u"many";
+static const char16_t gOther[] = u"other";
+static const char16_t gEq0[] = u"=0";
+static const char16_t gEq1[] = u"=1";
 
 int32_t StandardPlural::indexOrNegativeFromString(const UnicodeString &keyword) {
     switch (keyword.length()) {
index 91973ace1fdc8a17361f9de34e6e6f3020d17900..ff52eeacdc48c19ee7fb3c64fd17838ced7e1c11 100644 (file)
@@ -96,7 +96,7 @@ UMatchDegree StringMatcher::matches(const Replaceable& text,
     if (limit < cursor) {
         // Match in the reverse direction
         for (i=pattern.length()-1; i>=0; --i) {
-            UChar keyChar = pattern.charAt(i);
+            char16_t keyChar = pattern.charAt(i);
             UnicodeMatcher* subm = data->lookupMatcher(keyChar);
             if (subm == 0) {
                 if (cursor > limit &&
@@ -127,7 +127,7 @@ UMatchDegree StringMatcher::matches(const Replaceable& text,
                 // without completing our match.
                 return U_PARTIAL_MATCH;
             }
-            UChar keyChar = pattern.charAt(i);
+            char16_t keyChar = pattern.charAt(i);
             UnicodeMatcher* subm = data->lookupMatcher(keyChar);
             if (subm == 0) {
                 // Don't need the cursor < limit check if
@@ -165,10 +165,10 @@ UnicodeString& StringMatcher::toPattern(UnicodeString& result,
     result.truncate(0);
     UnicodeString str, quoteBuf;
     if (segmentNumber > 0) {
-        result.append((UChar)40); /*(*/
+        result.append((char16_t)40); /*(*/
     }
     for (int32_t i=0; i<pattern.length(); ++i) {
-        UChar keyChar = pattern.charAt(i);
+        char16_t keyChar = pattern.charAt(i);
         const UnicodeMatcher* m = data->lookupMatcher(keyChar);
         if (m == 0) {
             ICU_Utility::appendToRule(result, keyChar, false, escapeUnprintable, quoteBuf);
@@ -178,7 +178,7 @@ UnicodeString& StringMatcher::toPattern(UnicodeString& result,
         }
     }
     if (segmentNumber > 0) {
-        result.append((UChar)41); /*)*/
+        result.append((char16_t)41); /*)*/
     }
     // Flush quoteBuf out to result
     ICU_Utility::appendToRule(result, -1,
@@ -247,7 +247,7 @@ UnicodeString& StringMatcher::toReplacerPattern(UnicodeString& rule,
                                                 UBool /*escapeUnprintable*/) const {
     // assert(segmentNumber > 0);
     rule.truncate(0);
-    rule.append((UChar)0x0024 /*$*/);
+    rule.append((char16_t)0x0024 /*$*/);
     ICU_Utility::appendNumber(rule, segmentNumber, 10, 1);
     return rule;
 }
index 82a0c69f57a6c6c01f8885d154f8f475d59458e6..2981553869a7c561982d9f1f2e9d56949a6878c1 100644 (file)
@@ -149,7 +149,7 @@ int32_t StringReplacer::replace(Replaceable& text,
             text.copy(start-len, start, tempStart);
             destStart += len;
         } else {
-            UnicodeString str((UChar) 0xFFFF);
+            UnicodeString str((char16_t) 0xFFFF);
             text.handleReplaceBetween(tempStart, tempStart, str);
             destStart++;
         }
@@ -249,16 +249,16 @@ UnicodeString& StringReplacer::toReplacerPattern(UnicodeString& rule,
     // Handle a cursor preceding the output
     if (hasCursor && cursor < 0) {
         while (cursor++ < 0) {
-            ICU_Utility::appendToRule(rule, (UChar)0x0040 /*@*/, true, escapeUnprintable, quoteBuf);
+            ICU_Utility::appendToRule(rule, (char16_t)0x0040 /*@*/, true, escapeUnprintable, quoteBuf);
         }
         // Fall through and append '|' below
     }
 
     for (int32_t i=0; i<output.length(); ++i) {
         if (hasCursor && i == cursor) {
-            ICU_Utility::appendToRule(rule, (UChar)0x007C /*|*/, true, escapeUnprintable, quoteBuf);
+            ICU_Utility::appendToRule(rule, (char16_t)0x007C /*|*/, true, escapeUnprintable, quoteBuf);
         }
-        UChar c = output.charAt(i); // Ok to use 16-bits here
+        char16_t c = output.charAt(i); // Ok to use 16-bits here
 
         UnicodeReplacer* r = data->lookupReplacer(c);
         if (r == nullptr) {
@@ -266,8 +266,8 @@ UnicodeString& StringReplacer::toReplacerPattern(UnicodeString& rule,
         } else {
             UnicodeString buf;
             r->toReplacerPattern(buf, escapeUnprintable);
-            buf.insert(0, (UChar)0x20);
-            buf.append((UChar)0x20);
+            buf.insert(0, (char16_t)0x20);
+            buf.append((char16_t)0x20);
             ICU_Utility::appendToRule(rule, buf,
                                       true, escapeUnprintable, quoteBuf);
         }
@@ -279,9 +279,9 @@ UnicodeString& StringReplacer::toReplacerPattern(UnicodeString& rule,
     if (hasCursor && cursor > output.length()) {
         cursor -= output.length();
         while (cursor-- > 0) {
-            ICU_Utility::appendToRule(rule, (UChar)0x0040 /*@*/, true, escapeUnprintable, quoteBuf);
+            ICU_Utility::appendToRule(rule, (char16_t)0x0040 /*@*/, true, escapeUnprintable, quoteBuf);
         }
-        ICU_Utility::appendToRule(rule, (UChar)0x007C /*|*/, true, escapeUnprintable, quoteBuf);
+        ICU_Utility::appendToRule(rule, (char16_t)0x007C /*|*/, true, escapeUnprintable, quoteBuf);
     }
     // Flush quoteBuf out to result
     ICU_Utility::appendToRule(rule, -1,
index 684beba36a2440bc5735d53415fa3196cc41774d..23eaaf462c07c5657d1e3e6c94bbf12ee76380a3 100644 (file)
@@ -105,10 +105,10 @@ static char gStrBuf[256];
 
 // Static data and constants
 
-static const UChar         WORLD[] = {0x30, 0x30, 0x31, 0x00}; /* "001" */
+static const char16_t      WORLD[] = {0x30, 0x30, 0x31, 0x00}; /* "001" */
 
-static const UChar         GMT_ID[] = {0x47, 0x4D, 0x54, 0x00}; /* "GMT" */
-static const UChar         UNKNOWN_ZONE_ID[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77, 0x6E, 0x00}; /* "Etc/Unknown" */
+static const char16_t      GMT_ID[] = {0x47, 0x4D, 0x54, 0x00}; /* "GMT" */
+static const char16_t      UNKNOWN_ZONE_ID[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77, 0x6E, 0x00}; /* "Etc/Unknown" */
 static const int32_t       GMT_ID_LENGTH = 3;
 static const int32_t       UNKNOWN_ZONE_ID_LENGTH = 11;
 
@@ -181,7 +181,7 @@ U_NAMESPACE_BEGIN
 static int32_t findInStringArray(UResourceBundle* array, const UnicodeString& id, UErrorCode &status)
 {
     UnicodeString copy;
-    const UChar *u;
+    const char16_t *u;
     int32_t len;
 
     int32_t start = 0;
@@ -655,7 +655,7 @@ static void U_CALLCONV initMap(USystemTimeZoneType type, UErrorCode& ec) {
                     }
                 }
                 if (type == UCAL_ZONE_TYPE_CANONICAL_LOCATION) {
-                    const UChar *region = TimeZone::getRegion(id, ec);
+                    const char16_t *region = TimeZone::getRegion(id, ec);
                     if (U_FAILURE(ec)) {
                         break;
                     }
@@ -772,7 +772,7 @@ private:
 
     UBool getID(int32_t i, UErrorCode& ec) {
         int32_t idLen = 0;
-        const UChar* id = nullptr;
+        const char16_t* id = nullptr;
         UResourceBundle *top = ures_openDirect(0, kZONEINFO, &ec);
         top = ures_getByKey(top, kNAMES, top, &ec); // dereference Zones section
         id = ures_getStringByIndex(top, i, &idLen, &ec);
@@ -1073,7 +1073,7 @@ TimeZone::getEquivalentID(const UnicodeString& id, int32_t index) {
         UResourceBundle *ares = ures_getByKey(top, kNAMES, nullptr, &ec); // dereference Zones section
         if (U_SUCCESS(ec)) {
             int32_t idLen = 0;
-            const UChar* id2 = ures_getStringByIndex(ares, zone, &idLen, &ec);
+            const char16_t* id2 = ures_getStringByIndex(ares, zone, &idLen, &ec);
             result.fastCopyFrom(UnicodeString(true, id2, idLen));
             U_DEBUG_TZ_MSG(("gei(%d) -> %d, len%d, %s\n", index, zone, result.length(), u_errorName(ec)));
         }
@@ -1092,9 +1092,9 @@ TimeZone::getEquivalentID(const UnicodeString& id, int32_t index) {
 
 // These methods are used by ZoneMeta class only.
 
-const UChar*
+const char16_t*
 TimeZone::findID(const UnicodeString& id) {
-    const UChar *result = nullptr;
+    const char16_t *result = nullptr;
     UErrorCode ec = U_ZERO_ERROR;
     UResourceBundle *rb = ures_openDirect(nullptr, kZONEINFO, &ec);
 
@@ -1111,9 +1111,9 @@ TimeZone::findID(const UnicodeString& id) {
 }
 
 
-const UChar*
+const char16_t*
 TimeZone::dereferOlsonLink(const UnicodeString& id) {
-    const UChar *result = nullptr;
+    const char16_t *result = nullptr;
     UErrorCode ec = U_ZERO_ERROR;
     UResourceBundle *rb = ures_openDirect(nullptr, kZONEINFO, &ec);
 
@@ -1130,7 +1130,7 @@ TimeZone::dereferOlsonLink(const UnicodeString& id) {
         if (ures_getType(rb) == URES_INT) {
             // this is a link - dereference the link
             int32_t deref = ures_getInt(rb, &ec);
-            const UChar* tmp = ures_getStringByIndex(names, deref, nullptr, &ec);
+            const char16_t* tmp = ures_getStringByIndex(names, deref, nullptr, &ec);
             if (U_SUCCESS(ec)) {
                 result = tmp;
             }
@@ -1143,18 +1143,18 @@ TimeZone::dereferOlsonLink(const UnicodeString& id) {
     return result;
 }
 
-const UChar*
+const char16_t*
 TimeZone::getRegion(const UnicodeString& id) {
     UErrorCode status = U_ZERO_ERROR;
     return getRegion(id, status);
 }
 
-const UChar*
+const char16_t*
 TimeZone::getRegion(const UnicodeString& id, UErrorCode& status) {
     if (U_FAILURE(status)) {
         return nullptr;
     }
-    const UChar *result = nullptr;
+    const char16_t *result = nullptr;
     UResourceBundle *rb = ures_openDirect(nullptr, kZONEINFO, &status);
 
     // resolve zone index by name
@@ -1163,7 +1163,7 @@ TimeZone::getRegion(const UnicodeString& id, UErrorCode& status) {
 
     // get region mapping
     ures_getByKey(rb, kREGIONS, res, &status);
-    const UChar *tmp = ures_getStringByIndex(res, idx, nullptr, &status);
+    const char16_t *tmp = ures_getStringByIndex(res, idx, nullptr, &status);
     if (U_SUCCESS(status)) {
         result = tmp;
     }
@@ -1185,7 +1185,7 @@ TimeZone::getRegion(const UnicodeString& id, char *region, int32_t capacity, UEr
         return 0;
     }
 
-    const UChar *uregion = nullptr;
+    const char16_t *uregion = nullptr;
     // "Etc/Unknown" is not a system zone ID,
     // but in the zone data
     if (id.compare(UNKNOWN_ZONE_ID, UNKNOWN_ZONE_ID_LENGTH) != 0) {
@@ -1495,33 +1495,33 @@ TimeZone::formatCustomID(int32_t hour, int32_t min, int32_t sec,
     id.setTo(GMT_ID, GMT_ID_LENGTH);
     if (hour | min | sec) {
         if (negative) {
-            id += (UChar)MINUS;
+            id += (char16_t)MINUS;
         } else {
-            id += (UChar)PLUS;
+            id += (char16_t)PLUS;
         }
 
         if (hour < 10) {
-            id += (UChar)ZERO_DIGIT;
+            id += (char16_t)ZERO_DIGIT;
         } else {
-            id += (UChar)(ZERO_DIGIT + hour/10);
+            id += (char16_t)(ZERO_DIGIT + hour/10);
         }
-        id += (UChar)(ZERO_DIGIT + hour%10);
-        id += (UChar)COLON;
+        id += (char16_t)(ZERO_DIGIT + hour%10);
+        id += (char16_t)COLON;
         if (min < 10) {
-            id += (UChar)ZERO_DIGIT;
+            id += (char16_t)ZERO_DIGIT;
         } else {
-            id += (UChar)(ZERO_DIGIT + min/10);
+            id += (char16_t)(ZERO_DIGIT + min/10);
         }
-        id += (UChar)(ZERO_DIGIT + min%10);
+        id += (char16_t)(ZERO_DIGIT + min%10);
 
         if (sec) {
-            id += (UChar)COLON;
+            id += (char16_t)COLON;
             if (sec < 10) {
-                id += (UChar)ZERO_DIGIT;
+                id += (char16_t)ZERO_DIGIT;
             } else {
-                id += (UChar)(ZERO_DIGIT + sec/10);
+                id += (char16_t)(ZERO_DIGIT + sec/10);
             }
-            id += (UChar)(ZERO_DIGIT + sec%10);
+            id += (char16_t)(ZERO_DIGIT + sec%10);
         }
     }
     return id;
@@ -1540,7 +1540,7 @@ static void U_CALLCONV initTZDataVersion(UErrorCode &status) {
     int32_t len = 0;
     StackUResourceBundle bundle;
     ures_openDirectFillIn(bundle.getAlias(), nullptr, kZONEINFO, &status);
-    const UChar *tzver = ures_getStringByKey(bundle.getAlias(), kTZVERSION, &len, &status);
+    const char16_t *tzver = ures_getStringByKey(bundle.getAlias(), kTZVERSION, &len, &status);
 
     if (U_SUCCESS(status)) {
         if (len >= (int32_t)sizeof(TZDATA_VERSION)) {
@@ -1640,15 +1640,15 @@ TimeZone::getWindowsID(const UnicodeString& id, UnicodeString& winid, UErrorCode
                 continue;
             }
             int32_t len;
-            const UChar *tzids = ures_getString(regionalData, &len, &status);
+            const char16_t *tzids = ures_getString(regionalData, &len, &status);
             if (U_FAILURE(status)) {
                 break;
             }
 
-            const UChar *start = tzids;
+            const char16_t *start = tzids;
             UBool hasNext = true;
             while (hasNext) {
-                const UChar *end = u_strchr(start, (UChar)0x20);
+                const char16_t *end = u_strchr(start, (char16_t)0x20);
                 if (end == nullptr) {
                     end = tzids + len;
                     hasNext = false;
@@ -1702,15 +1702,15 @@ TimeZone::getIDForWindowsID(const UnicodeString& winid, const char* region, Unic
         return id;
     }
 
-    const UChar *tzid = nullptr;
+    const char16_t *tzid = nullptr;
     int32_t len = 0;
     UBool gotID = false;
     if (region) {
-        const UChar *tzids = ures_getStringByKey(zones, region, &len, &tmperr); // use tmperr, because
+        const char16_t *tzids = ures_getStringByKey(zones, region, &len, &tmperr); // use tmperr, because
                                                                                 // regional mapping is optional
         if (U_SUCCESS(tmperr)) {
             // first ID delimited by space is the default one
-            const UChar *end = u_strchr(tzids, (UChar)0x20);
+            const char16_t *end = u_strchr(tzids, (char16_t)0x20);
             if (end == nullptr) {
                 id.setTo(tzids, -1);
             } else {
index 5a2f2487c8e9fbd84fd45eba6165a34053dd4ec9..d3732893a78cd0d5bd3131764ae072c43750213a 100644 (file)
@@ -117,7 +117,7 @@ void TitlecaseTransliterator::handleTransliterate(
     csc.limit = offsets.contextLimit;
 
     UnicodeString tmp;
-    const UChar *s;
+    const char16_t *s;
     int32_t textPos, delta, result;
 
     for(textPos=offsets.start; textPos<offsets.limit;) {
index a6416688345ff118a6b443c4a49b2c304ef66fff..87b509ea35c11cb5e8adfb4ab4b62516799d922d 100644 (file)
 #include "unicode/msgfmt.h"
 #include "uassert.h"
 
-#define LEFT_CURLY_BRACKET  ((UChar)0x007B)
-#define RIGHT_CURLY_BRACKET ((UChar)0x007D)
-#define SPACE             ((UChar)0x0020)
-#define DIGIT_ZERO        ((UChar)0x0030)
-#define LOW_S             ((UChar)0x0073)
-#define LOW_M             ((UChar)0x006D)
-#define LOW_I             ((UChar)0x0069)
-#define LOW_N             ((UChar)0x006E)
-#define LOW_H             ((UChar)0x0068)
-#define LOW_W             ((UChar)0x0077)
-#define LOW_D             ((UChar)0x0064)
-#define LOW_Y             ((UChar)0x0079)
-#define LOW_Z             ((UChar)0x007A)
-#define LOW_E             ((UChar)0x0065)
-#define LOW_R             ((UChar)0x0072)
-#define LOW_O             ((UChar)0x006F)
-#define LOW_N             ((UChar)0x006E)
-#define LOW_T             ((UChar)0x0074)
+#define LEFT_CURLY_BRACKET  ((char16_t)0x007B)
+#define RIGHT_CURLY_BRACKET ((char16_t)0x007D)
+#define SPACE             ((char16_t)0x0020)
+#define DIGIT_ZERO        ((char16_t)0x0030)
+#define LOW_S             ((char16_t)0x0073)
+#define LOW_M             ((char16_t)0x006D)
+#define LOW_I             ((char16_t)0x0069)
+#define LOW_N             ((char16_t)0x006E)
+#define LOW_H             ((char16_t)0x0068)
+#define LOW_W             ((char16_t)0x0077)
+#define LOW_D             ((char16_t)0x0064)
+#define LOW_Y             ((char16_t)0x0079)
+#define LOW_Z             ((char16_t)0x007A)
+#define LOW_E             ((char16_t)0x0065)
+#define LOW_R             ((char16_t)0x0072)
+#define LOW_O             ((char16_t)0x006F)
+#define LOW_N             ((char16_t)0x006E)
+#define LOW_T             ((char16_t)0x0074)
 
 
 //TODO: define in compile time
@@ -68,17 +68,17 @@ static const char gTimeUnitMinute[] = "minute";
 static const char gTimeUnitSecond[] = "second";
 static const char gPluralCountOther[] = "other";
 
-static const UChar DEFAULT_PATTERN_FOR_SECOND[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_S, 0};
-static const UChar DEFAULT_PATTERN_FOR_MINUTE[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_M, LOW_I, LOW_N, 0};
-static const UChar DEFAULT_PATTERN_FOR_HOUR[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_H, 0};
-static const UChar DEFAULT_PATTERN_FOR_WEEK[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_W, 0};
-static const UChar DEFAULT_PATTERN_FOR_DAY[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_D, 0};
-static const UChar DEFAULT_PATTERN_FOR_MONTH[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_M, 0};
-static const UChar DEFAULT_PATTERN_FOR_YEAR[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_Y, 0};
+static const char16_t DEFAULT_PATTERN_FOR_SECOND[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_S, 0};
+static const char16_t DEFAULT_PATTERN_FOR_MINUTE[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_M, LOW_I, LOW_N, 0};
+static const char16_t DEFAULT_PATTERN_FOR_HOUR[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_H, 0};
+static const char16_t DEFAULT_PATTERN_FOR_WEEK[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_W, 0};
+static const char16_t DEFAULT_PATTERN_FOR_DAY[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_D, 0};
+static const char16_t DEFAULT_PATTERN_FOR_MONTH[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_M, 0};
+static const char16_t DEFAULT_PATTERN_FOR_YEAR[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, LOW_Y, 0};
 
-static const UChar PLURAL_COUNT_ZERO[] = {LOW_Z, LOW_E, LOW_R, LOW_O, 0};
-static const UChar PLURAL_COUNT_ONE[] = {LOW_O, LOW_N, LOW_E, 0};
-static const UChar PLURAL_COUNT_TWO[] = {LOW_T, LOW_W, LOW_O, 0};
+static const char16_t PLURAL_COUNT_ZERO[] = {LOW_Z, LOW_E, LOW_R, LOW_O, 0};
+static const char16_t PLURAL_COUNT_ONE[] = {LOW_O, LOW_N, LOW_E, 0};
+static const char16_t PLURAL_COUNT_TWO[] = {LOW_T, LOW_W, LOW_O, 0};
 
 TimeUnitFormat::TimeUnitFormat(UErrorCode& status) {
     initMeasureFormat(Locale::getDefault(), UMEASFMT_WIDTH_WIDE, nullptr, status);
@@ -567,7 +567,7 @@ TimeUnitFormat::searchInLocaleChain(UTimeUnitFormatStyle style, const char* key,
         LocalUResourceBundlePointer unitsRes(ures_getByKey(rb.getAlias(), key, nullptr, &status));
         const char* timeUnitName = getTimeUnitName(srcTimeUnitField, status);
         LocalUResourceBundlePointer countsToPatternRB(ures_getByKey(unitsRes.getAlias(), timeUnitName, nullptr, &status));
-        const UChar* pattern;
+        const char16_t* pattern;
         int32_t      ptLength;
         pattern = ures_getStringByKeyWithFallback(countsToPatternRB.getAlias(), searchPluralCount, &ptLength, &status);
         if (U_SUCCESS(status)) {
@@ -625,7 +625,7 @@ TimeUnitFormat::searchInLocaleChain(UTimeUnitFormatStyle style, const char* key,
     if ( uprv_strcmp(searchPluralCount, gPluralCountOther) == 0 ) {
         // set default fall back the same as the resource in root
         LocalPointer<MessageFormat> messageFormat;
-        const UChar *pattern = nullptr;
+        const char16_t *pattern = nullptr;
         if ( srcTimeUnitField == TimeUnit::UTIMEUNIT_SECOND ) {
             pattern = DEFAULT_PATTERN_FOR_SECOND;
         } else if ( srcTimeUnitField == TimeUnit::UTIMEUNIT_MINUTE ) {
index 2bca2dbbed5d88a0fcd17240a5ab782592c8c366..ed89bab0afb437bd8e421d9244cd32957d26b46a 100644 (file)
@@ -54,9 +54,9 @@
 #include "cstring.h"
 #include "uinvchar.h"
 
-static const UChar TARGET_SEP  = 0x002D; /*-*/
-static const UChar ID_DELIM    = 0x003B; /*;*/
-static const UChar VARIANT_SEP = 0x002F; // '/'
+static const char16_t TARGET_SEP  = 0x002D; /*-*/
+static const char16_t ID_DELIM    = 0x003B; /*;*/
+static const char16_t VARIANT_SEP = 0x002F; // '/'
 
 /**
  * Prefix for resource bundle key for the display name for a
@@ -132,7 +132,7 @@ Transliterator::Transliterator(const UnicodeString& theID,
     maximumContextLength(0)
 {
     // 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);
 }
 
@@ -153,7 +153,7 @@ Transliterator::Transliterator(const Transliterator& other) :
     maximumContextLength(other.maximumContextLength)
 {
     // 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);
 
     if (other.filter != 0) {
@@ -1456,11 +1456,11 @@ UnicodeString& Transliterator::_getAvailableVariant(int32_t index,
  * @deprecated the new architecture provides filtering at the top
  * level.  This method will be removed Dec 31 2001.
  */
-UChar Transliterator::filteredCharAt(const Replaceable& text, int32_t i) const {
-    UChar c;
+char16_t Transliterator::filteredCharAt(const Replaceable& text, int32_t i) const {
+    char16_t c;
     const UnicodeFilter* localFilter = getFilter();
     return (localFilter == 0) ? text.charAt(i) :
-        (localFilter->contains(c = text.charAt(i)) ? c : (UChar)0xFFFE);
+        (localFilter->contains(c = text.charAt(i)) ? c : (char16_t)0xFFFE);
 }
 
 #endif
@@ -1548,12 +1548,12 @@ UBool Transliterator::initializeRegistry(UErrorCode &status) {
                 }
                 UResourceBundle* res = ures_getNextResource(colBund, nullptr, &lstatus);
                 const char* typeStr = ures_getKey(res);
-                UChar type;
+                char16_t type;
                 u_charsToUChars(typeStr, &type, 1);
 
                 if (U_SUCCESS(lstatus)) {
                     int32_t len = 0;
-                    const UChar *resString;
+                    const char16_t *resString;
                     switch (type) {
                     case 0x66: // 'f'
                     case 0x69: // 'i'
index 7979c6546f96856cc5457756959922f21c43a393..d16c2585c40253405a3cc1fa16676f87fe91e359 100644 (file)
 #include <stdio.h>
 #endif
 
-// UChar constants
-static const UChar LOCALE_SEP  = 95; // '_'
-//static const UChar ID_SEP      = 0x002D; /*-*/
-//static const UChar VARIANT_SEP = 0x002F; // '/'
+// char16_t constants
+static const char16_t LOCALE_SEP  = 95; // '_'
+//static const char16_t ID_SEP      = 0x002D; /*-*/
+//static const char16_t VARIANT_SEP = 0x002F; // '/'
 
 // String constants
-static const UChar ANY[] = { 0x41, 0x6E, 0x79, 0 }; // Any
-static const UChar LAT[] = { 0x4C, 0x61, 0x74, 0 }; // Lat
+static const char16_t ANY[] = { 0x41, 0x6E, 0x79, 0 }; // Any
+static const char16_t LAT[] = { 0x4C, 0x61, 0x74, 0 }; // Lat
 
 // empty string
 #define NO_VARIANT UnicodeString()
@@ -141,8 +141,8 @@ Transliterator* TransliteratorAlias::create(UParseError& pe,
             // to see whether there really are ID blocks at the beginning and end (by looking for U+FFFF, which
             // marks the position where an anonymous transliterator goes) and adjust accordingly
             int32_t anonymousRBTs = transes->size();
-            UnicodeString noIDBlock((UChar)(0xffff));
-            noIDBlock += ((UChar)(0xffff));
+            UnicodeString noIDBlock((char16_t)(0xffff));
+            noIDBlock += ((char16_t)(0xffff));
             int32_t pos = aliasesOrRules.indexOf(noIDBlock);
             while (pos >= 0) {
                 pos = aliasesOrRules.indexOf(noIDBlock, pos + 1);
@@ -150,7 +150,7 @@ Transliterator* TransliteratorAlias::create(UParseError& pe,
 
             UVector transliterators(uprv_deleteUObject, nullptr, ec);
             UnicodeString idBlock;
-            int32_t blockSeparatorPos = aliasesOrRules.indexOf((UChar)(0xffff));
+            int32_t blockSeparatorPos = aliasesOrRules.indexOf((char16_t)(0xffff));
             while (blockSeparatorPos >= 0) {
                 aliasesOrRules.extract(0, blockSeparatorPos, idBlock);
                 aliasesOrRules.remove(0, blockSeparatorPos + 1);
@@ -158,7 +158,7 @@ Transliterator* TransliteratorAlias::create(UParseError& pe,
                     transliterators.adoptElement(Transliterator::createInstance(idBlock, UTRANS_FORWARD, pe, ec), ec);
                 if (!transes->isEmpty())
                     transliterators.adoptElement(transes->orphanElementAt(0), ec);
-                blockSeparatorPos = aliasesOrRules.indexOf((UChar)(0xffff));
+                blockSeparatorPos = aliasesOrRules.indexOf((char16_t)(0xffff));
             }
             if (!aliasesOrRules.isEmpty())
                 transliterators.adoptElement(Transliterator::createInstance(aliasesOrRules, UTRANS_FORWARD, pe, ec), ec);
@@ -626,7 +626,7 @@ Transliterator* TransliteratorRegistry::reget(const UnicodeString& ID,
                     if (U_FAILURE(status)) {
                         delete data;
                     }
-                    entry->stringArg += (UChar)0xffff;  // use U+FFFF to mark position of RBTs in ID block
+                    entry->stringArg += (char16_t)0xffff;  // use U+FFFF to mark position of RBTs in ID block
                 }
             }
         }
@@ -1086,11 +1086,11 @@ TransliteratorEntry* TransliteratorRegistry::findInStaticStore(const Translitera
 }
 
 // As of 2.0, resource bundle keys cannot contain '_'
-static const UChar TRANSLITERATE_TO[] = {84,114,97,110,115,108,105,116,101,114,97,116,101,84,111,0}; // "TransliterateTo"
+static const char16_t TRANSLITERATE_TO[] = {84,114,97,110,115,108,105,116,101,114,97,116,101,84,111,0}; // "TransliterateTo"
 
-static const UChar TRANSLITERATE_FROM[] = {84,114,97,110,115,108,105,116,101,114,97,116,101,70,114,111,109,0}; // "TransliterateFrom"
+static const char16_t TRANSLITERATE_FROM[] = {84,114,97,110,115,108,105,116,101,114,97,116,101,70,114,111,109,0}; // "TransliterateFrom"
 
-static const UChar TRANSLITERATE[] = {84,114,97,110,115,108,105,116,101,114,97,116,101,0}; // "Transliterate"
+static const char16_t TRANSLITERATE[] = {84,114,97,110,115,108,105,116,101,114,97,116,101,0}; // "Transliterate"
 
 /**
  * Attempt to find an entry in a single resource bundle.  This is
index 0c6602c13d6ccd36715c0919e3aa26b4e1d04344..6c23a0dc902658c3a892569103336adff943321d 100644 (file)
 
 U_NAMESPACE_BEGIN
 
-static const UChar ID_DELIM    = 0x003B; // ;
-static const UChar TARGET_SEP  = 0x002D; // -
-static const UChar VARIANT_SEP = 0x002F; // /
-static const UChar OPEN_REV    = 0x0028; // (
-static const UChar CLOSE_REV   = 0x0029; // )
+static const char16_t ID_DELIM    = 0x003B; // ;
+static const char16_t TARGET_SEP  = 0x002D; // -
+static const char16_t VARIANT_SEP = 0x002F; // /
+static const char16_t OPEN_REV    = 0x0028; // (
+static const char16_t CLOSE_REV   = 0x0029; // )
 
-//static const UChar EMPTY[]     = {0}; // ""
-static const UChar ANY[]       = {65,110,121,0}; // "Any"
-static const UChar ANY_NULL[]  = {65,110,121,45,78,117,108,108,0}; // "Any-Null"
+//static const char16_t EMPTY[]     = {0}; // ""
+static const char16_t ANY[]       = {65,110,121,0}; // "Any"
+static const char16_t ANY_NULL[]  = {65,110,121,45,78,117,108,108,0}; // "Any-Null"
 
 static const int32_t FORWARD = UTRANS_FORWARD;
 static const int32_t REVERSE = UTRANS_REVERSE;
@@ -607,7 +607,7 @@ void TransliteratorIDParser::STVtoID(const UnicodeString& source,
     }
     // NUL-terminate the ID string for getTerminatedBuffer.
     // This prevents valgrind and Purify warnings.
-    id.append((UChar)0);
+    id.append((char16_t)0);
     id.truncate(id.length()-1);
 }
 
@@ -706,7 +706,7 @@ TransliteratorIDParser::parseFilterID(const UnicodeString& id, int32_t& pos,
     UnicodeString target;
     UnicodeString variant;
     UnicodeString filter;
-    UChar delimiter = 0;
+    char16_t delimiter = 0;
     int32_t specCount = 0;
     int32_t start = pos;
 
@@ -736,7 +736,7 @@ TransliteratorIDParser::parseFilterID(const UnicodeString& id, int32_t& pos,
         }
 
         if (delimiter == 0) {
-            UChar c = id.charAt(pos);
+            char16_t c = id.charAt(pos);
             if ((c == TARGET_SEP && target.length() == 0) ||
                 (c == VARIANT_SEP && variant.length() == 0)) {
                 delimiter = c;
index 256437a91821c21e5bbe557ae1cd4b35b80888e5..ce83adebd081444080166187207bcecc4dfee3e1 100644 (file)
@@ -70,35 +70,35 @@ static const char gGmtFormatTag[]= "gmtFormat";
 static const char gGmtZeroFormatTag[] = "gmtZeroFormat";
 static const char gHourFormatTag[]= "hourFormat";
 
-static const UChar TZID_GMT[] = {0x0045, 0x0074, 0x0063, 0x002F, 0x0047, 0x004D, 0x0054, 0};    // Etc/GMT
-static const UChar UNKNOWN_ZONE_ID[] = {
+static const char16_t TZID_GMT[] = {0x0045, 0x0074, 0x0063, 0x002F, 0x0047, 0x004D, 0x0054, 0};    // Etc/GMT
+static const char16_t UNKNOWN_ZONE_ID[] = {
     0x0045, 0x0074, 0x0063, 0x002F, 0x0055, 0x006E, 0x006B, 0x006E, 0x006F, 0x0077, 0x006E, 0}; // Etc/Unknown
-static const UChar UNKNOWN_SHORT_ZONE_ID[] = {0x0075, 0x006E, 0x006B, 0};   // unk
-static const UChar UNKNOWN_LOCATION[] = {0x0055, 0x006E, 0x006B, 0x006E, 0x006F, 0x0077, 0x006E, 0};    // Unknown
-
-static const UChar DEFAULT_GMT_PATTERN[] = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0}; // GMT{0}
-//static const UChar DEFAULT_GMT_ZERO[] = {0x0047, 0x004D, 0x0054, 0}; // GMT
-static const UChar DEFAULT_GMT_POSITIVE_HM[] = {0x002B, 0x0048, 0x003A, 0x006D, 0x006D, 0}; // +H:mm
-static const UChar DEFAULT_GMT_POSITIVE_HMS[] = {0x002B, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0}; // +H:mm:ss
-static const UChar DEFAULT_GMT_NEGATIVE_HM[] = {0x002D, 0x0048, 0x003A, 0x006D, 0x006D, 0}; // -H:mm
-static const UChar DEFAULT_GMT_NEGATIVE_HMS[] = {0x002D, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0}; // -H:mm:ss
-static const UChar DEFAULT_GMT_POSITIVE_H[] = {0x002B, 0x0048, 0}; // +H
-static const UChar DEFAULT_GMT_NEGATIVE_H[] = {0x002D, 0x0048, 0}; // -H
+static const char16_t UNKNOWN_SHORT_ZONE_ID[] = {0x0075, 0x006E, 0x006B, 0};   // unk
+static const char16_t UNKNOWN_LOCATION[] = {0x0055, 0x006E, 0x006B, 0x006E, 0x006F, 0x0077, 0x006E, 0};    // Unknown
+
+static const char16_t DEFAULT_GMT_PATTERN[] = {0x0047, 0x004D, 0x0054, 0x007B, 0x0030, 0x007D, 0}; // GMT{0}
+//static const char16_t DEFAULT_GMT_ZERO[] = {0x0047, 0x004D, 0x0054, 0}; // GMT
+static const char16_t DEFAULT_GMT_POSITIVE_HM[] = {0x002B, 0x0048, 0x003A, 0x006D, 0x006D, 0}; // +H:mm
+static const char16_t DEFAULT_GMT_POSITIVE_HMS[] = {0x002B, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0}; // +H:mm:ss
+static const char16_t DEFAULT_GMT_NEGATIVE_HM[] = {0x002D, 0x0048, 0x003A, 0x006D, 0x006D, 0}; // -H:mm
+static const char16_t DEFAULT_GMT_NEGATIVE_HMS[] = {0x002D, 0x0048, 0x003A, 0x006D, 0x006D, 0x003A, 0x0073, 0x0073, 0}; // -H:mm:ss
+static const char16_t DEFAULT_GMT_POSITIVE_H[] = {0x002B, 0x0048, 0}; // +H
+static const char16_t DEFAULT_GMT_NEGATIVE_H[] = {0x002D, 0x0048, 0}; // -H
 
 static const UChar32 DEFAULT_GMT_DIGITS[] = {
     0x0030, 0x0031, 0x0032, 0x0033, 0x0034,
     0x0035, 0x0036, 0x0037, 0x0038, 0x0039
 };
 
-static const UChar DEFAULT_GMT_OFFSET_SEP = 0x003A; // ':'
+static const char16_t DEFAULT_GMT_OFFSET_SEP = 0x003A; // ':'
 
-static const UChar ARG0[] = {0x007B, 0x0030, 0x007D};   // "{0}"
+static const char16_t ARG0[] = {0x007B, 0x0030, 0x007D};   // "{0}"
 static const int32_t ARG0_LEN = 3;
 
-static const UChar DEFAULT_GMT_OFFSET_MINUTE_PATTERN[] = {0x006D, 0x006D, 0};   // "mm"
-static const UChar DEFAULT_GMT_OFFSET_SECOND_PATTERN[] = {0x0073, 0x0073, 0};   // "ss"
+static const char16_t DEFAULT_GMT_OFFSET_MINUTE_PATTERN[] = {0x006D, 0x006D, 0};   // "mm"
+static const char16_t DEFAULT_GMT_OFFSET_SECOND_PATTERN[] = {0x0073, 0x0073, 0};   // "ss"
 
-static const UChar ALT_GMT_STRINGS[][4] = {
+static const char16_t ALT_GMT_STRINGS[][4] = {
     {0x0047, 0x004D, 0x0054, 0},    // GMT
     {0x0055, 0x0054, 0x0043, 0},    // UTC
     {0x0055, 0x0054, 0, 0},         // UT
@@ -117,11 +117,11 @@ static const int32_t PARSE_GMT_OFFSET_TYPES[] = {
     -1
 };
 
-static const UChar SINGLEQUOTE  = 0x0027;
-static const UChar PLUS         = 0x002B;
-static const UChar MINUS        = 0x002D;
-static const UChar ISO8601_UTC  = 0x005A;   // 'Z'
-static const UChar ISO8601_SEP  = 0x003A;   // ':'
+static const char16_t SINGLEQUOTE  = 0x0027;
+static const char16_t PLUS         = 0x002B;
+static const char16_t MINUS        = 0x002D;
+static const char16_t ISO8601_UTC  = 0x005A;   // 'Z'
+static const char16_t ISO8601_SEP  = 0x003A;   // ':'
 
 static const int32_t MILLIS_PER_HOUR = 60 * 60 * 1000;
 static const int32_t MILLIS_PER_MINUTE = 60 * 1000;
@@ -194,14 +194,14 @@ public:
     static GMTOffsetField* createText(const UnicodeString& text, UErrorCode& status);
     static GMTOffsetField* createTimeField(FieldType type, uint8_t width, UErrorCode& status);
     static UBool isValid(FieldType type, int32_t width);
-    static FieldType getTypeByLetter(UChar ch);
+    static FieldType getTypeByLetter(char16_t ch);
 
     FieldType getType() const;
     uint8_t getWidth() const;
-    const UChar* getPatternText(void) const;
+    const char16_t* getPatternText(void) const;
 
 private:
-    UChar* fText;
+    char16_t* fText;
     FieldType fType;
     uint8_t fWidth;
 
@@ -230,7 +230,7 @@ GMTOffsetField::createText(const UnicodeString& text, UErrorCode& status) {
     }
 
     int32_t len = text.length();
-    result->fText = (UChar*)uprv_malloc((len + 1) * sizeof(UChar));
+    result->fText = (char16_t*)uprv_malloc((len + 1) * sizeof(char16_t));
     if (result->fText == nullptr) {
         status = U_MEMORY_ALLOCATION_ERROR;
         delete result;
@@ -276,7 +276,7 @@ GMTOffsetField::isValid(FieldType type, int32_t width) {
 }
 
 GMTOffsetField::FieldType
-GMTOffsetField::getTypeByLetter(UChar ch) {
+GMTOffsetField::getTypeByLetter(char16_t ch) {
     if (ch == 0x0048 /* H */) {
         return HOUR;
     } else if (ch == 0x006D /* m */) {
@@ -297,7 +297,7 @@ GMTOffsetField::getWidth() const {
     return fWidth;
 }
  
-inline const UChar*
+inline const char16_t*
 GMTOffsetField::getPatternText(void) const {
     return fText;
 }
@@ -351,13 +351,13 @@ TimeZoneFormat::TimeZoneFormat(const Locale& locale, UErrorCode& status)
         return;
     }
 
-    const UChar* gmtPattern = nullptr;
-    const UChar* hourFormats = nullptr;
+    const char16_t* gmtPattern = nullptr;
+    const char16_t* hourFormats = nullptr;
 
     UResourceBundle *zoneBundle = ures_open(U_ICUDATA_ZONE, locale.getName(), &status);
     UResourceBundle *zoneStringsArray = ures_getByKeyWithFallback(zoneBundle, gZoneStringsTag, nullptr, &status);
     if (U_SUCCESS(status)) {
-        const UChar* resStr;
+        const char16_t* resStr;
         int32_t len;
         resStr = ures_getStringByKeyWithFallback(zoneStringsArray, gGmtFormatTag, &len, &status);
         if (len > 0) {
@@ -382,7 +382,7 @@ TimeZoneFormat::TimeZoneFormat(const Locale& locale, UErrorCode& status)
 
     UBool useDefaultOffsetPatterns = true;
     if (hourFormats) {
-        UChar *sep = u_strchr(hourFormats, (UChar)0x003B /* ';' */);
+        char16_t *sep = u_strchr(hourFormats, (char16_t)0x003B /* ';' */);
         if (sep != nullptr) {
             UErrorCode tmpStatus = U_ZERO_ERROR;
             fGMTOffsetPatterns[UTZFMT_PAT_POSITIVE_HM].setTo(false, hourFormats, (int32_t)(sep - hourFormats));
@@ -682,7 +682,7 @@ TimeZoneFormat::format(UTimeZoneFormatStyle style, const TimeZone& tz, UDate dat
         break;
     case UTZFMT_STYLE_ZONE_ID_SHORT:
         {
-            const UChar* shortID = ZoneMeta::getShortID(tz);
+            const char16_t* shortID = ZoneMeta::getShortID(tz);
             if (shortID == nullptr) {
                 shortID = UNKNOWN_SHORT_ZONE_ID;
             }
@@ -795,7 +795,7 @@ TimeZoneFormat::format(const Formattable& obj, UnicodeString& appendTo,
         if (tz != nullptr) {
             int32_t rawOffset, dstOffset;
             tz->getOffset(date, false, rawOffset, dstOffset, status);
-            UChar buf[ZONE_NAME_U16_MAX];
+            char16_t buf[ZONE_NAME_U16_MAX];
             UnicodeString result(buf, 0, UPRV_LENGTHOF(buf));
             formatOffsetLocalizedGMT(rawOffset + dstOffset, result, status);
             if (U_SUCCESS(status)) {
@@ -862,7 +862,7 @@ TimeZoneFormat::parse(UTimeZoneFormatStyle style, const UnicodeString& text, Par
     }
 
     UErrorCode status = U_ZERO_ERROR;
-    UChar tzIDBuf[32];
+    char16_t tzIDBuf[32];
     UnicodeString tzID(tzIDBuf, 0, UPRV_LENGTHOF(tzIDBuf));
 
     UBool parseTZDBAbbrev = ((parseOptions & UTZFMT_PARSE_OPTION_TZ_DATABASE_ABBREVIATIONS) != 0);
@@ -1112,7 +1112,7 @@ TimeZoneFormat::parse(UTimeZoneFormatStyle style, const UnicodeString& text, Par
 
     // Failed to parse the input text as the time zone format in the specified style.
     // Check the longest match among other styles below.
-    UChar parsedIDBuf[32];
+    char16_t parsedIDBuf[32];
     UnicodeString parsedID(parsedIDBuf, 0, UPRV_LENGTHOF(parsedIDBuf));
     UTimeZoneFormatTimeType parsedTimeType = UTZFMT_TIME_TYPE_UNKNOWN;
 
@@ -1343,7 +1343,7 @@ TimeZoneFormat::formatGeneric(const TimeZone& tz, int32_t genType, UDate date, U
     }
 
     if (genType == UTZGNM_LOCATION) {
-        const UChar* canonicalID = ZoneMeta::getCanonicalCLDRID(tz);
+        const char16_t* canonicalID = ZoneMeta::getCanonicalCLDRID(tz);
         if (canonicalID == nullptr) {
             name.setToBogus();
             return name;
@@ -1363,7 +1363,7 @@ TimeZoneFormat::formatSpecific(const TimeZone& tz, UTimeZoneNameType stdType, UT
 
     UErrorCode status = U_ZERO_ERROR;
     UBool isDaylight = tz.inDaylightTime(date, status);
-    const UChar* canonicalID = ZoneMeta::getCanonicalCLDRID(tz);
+    const char16_t* canonicalID = ZoneMeta::getCanonicalCLDRID(tz);
 
     if (U_FAILURE(status) || canonicalID == nullptr) {
         name.setToBogus();
@@ -1421,9 +1421,9 @@ TimeZoneFormat::getTZDBTimeZoneNames(UErrorCode& status) const {
 
 UnicodeString&
 TimeZoneFormat::formatExemplarLocation(const TimeZone& tz, UnicodeString& name) const {
-    UChar locationBuf[ZONE_NAME_U16_MAX];
+    char16_t locationBuf[ZONE_NAME_U16_MAX];
     UnicodeString location(locationBuf, 0, UPRV_LENGTHOF(locationBuf));
-    const UChar* canonicalID = ZoneMeta::getCanonicalCLDRID(tz);
+    const char16_t* canonicalID = ZoneMeta::getCanonicalCLDRID(tz);
 
     if (canonicalID) {
         fTimeZoneNames->getExemplarLocationName(UnicodeString(true, canonicalID, -1), location);
@@ -1502,7 +1502,7 @@ TimeZoneFormat::formatOffsetISO8601(int32_t offset, UBool isBasic, UBool useUtcI
 
     OffsetFields minFields = isShort ? FIELDS_H : FIELDS_HM;
     OffsetFields maxFields = ignoreSeconds ? FIELDS_HM : FIELDS_HMS;
-    UChar sep = isBasic ? 0 : ISO8601_SEP;
+    char16_t sep = isBasic ? 0 : ISO8601_SEP;
 
     // Note: FIELDS_HMS as maxFields is a CLDR/ICU extension. ISO 8601 specification does
     // not support seconds field.
@@ -1532,7 +1532,7 @@ TimeZoneFormat::formatOffsetISO8601(int32_t offset, UBool isBasic, UBool useUtcI
         lastIdx--;
     }
 
-    UChar sign = PLUS;
+    char16_t sign = PLUS;
     if (offset < 0) {
         // if all output fields are 0s, do not use negative sign
         for (int32_t idx = 0; idx <= lastIdx; idx++) {
@@ -1548,8 +1548,8 @@ TimeZoneFormat::formatOffsetISO8601(int32_t offset, UBool isBasic, UBool useUtcI
         if (sep && idx != 0) {
             result.append(sep);
         }
-        result.append((UChar)(0x0030 + fields[idx]/10));
-        result.append((UChar)(0x0030 + fields[idx]%10));
+        result.append((char16_t)(0x0030 + fields[idx]/10));
+        result.append((char16_t)(0x0030 + fields[idx]%10));
     }
 
     return result;
@@ -1648,8 +1648,8 @@ TimeZoneFormat::parseOffsetISO8601(const UnicodeString& text, ParsePosition& pos
         return 0;
     }
 
-    UChar firstChar = text.charAt(start);
-    if (firstChar == ISO8601_UTC || firstChar == (UChar)(ISO8601_UTC + 0x20)) {
+    char16_t firstChar = text.charAt(start);
+    if (firstChar == ISO8601_UTC || firstChar == (char16_t)(ISO8601_UTC + 0x20)) {
         // "Z" (or "z") - indicates UTC
         pos.setIndex(start + 1);
         return 0;
@@ -1739,7 +1739,7 @@ TimeZoneFormat::parseOffsetLocalizedGMT(const UnicodeString& text, ParsePosition
 
     // Check if this is a default GMT zero format
     for (int32_t i = 0; ALT_GMT_STRINGS[i][0] != 0; i++) {
-        const UChar* defGMTZero = ALT_GMT_STRINGS[i];
+        const char16_t* defGMTZero = ALT_GMT_STRINGS[i];
         int32_t defGMTZeroLen = u_strlen(defGMTZero);
         if (text.caseCompare(start, defGMTZeroLen, defGMTZero, 0) == 0) {
             pos.setIndex(start + defGMTZeroLen);
@@ -1867,7 +1867,7 @@ TimeZoneFormat::parseOffsetFieldsWithPattern(const UnicodeString& text, int32_t
         const GMTOffsetField* field = (const GMTOffsetField*)patternItems->elementAt(i);
         GMTOffsetField::FieldType fieldType = field->getType();
         if (fieldType == GMTOffsetField::TEXT) {
-            const UChar* patStr = field->getPatternText();
+            const char16_t* patStr = field->getPatternText();
             len = u_strlen(patStr);
             if (i == 0) {
                 // When TimeZoneFormat parse() is called from SimpleDateFormat,
@@ -2004,7 +2004,7 @@ TimeZoneFormat::parseOffsetDefaultLocalizedGMT(const UnicodeString& text, int st
         int32_t gmtLen = 0;
 
         for (int32_t i = 0; ALT_GMT_STRINGS[i][0] != 0; i++) {
-            const UChar* gmt = ALT_GMT_STRINGS[i];
+            const char16_t* gmt = ALT_GMT_STRINGS[i];
             int32_t len = u_strlen(gmt);
             if (text.caseCompare(start, len, gmt, 0) == 0) {
                 gmtLen = len;
@@ -2023,7 +2023,7 @@ TimeZoneFormat::parseOffsetDefaultLocalizedGMT(const UnicodeString& text, int st
 
         // parse sign
         int32_t sign = 1;
-        UChar c = text.charAt(idx);
+        char16_t c = text.charAt(idx);
         if (c == PLUS) {
             sign = 1;
         } else if (c == MINUS) {
@@ -2062,7 +2062,7 @@ TimeZoneFormat::parseOffsetDefaultLocalizedGMT(const UnicodeString& text, int st
 }
 
 int32_t
-TimeZoneFormat::parseDefaultOffsetFields(const UnicodeString& text, int32_t start, UChar separator, int32_t& parsedLen) const {
+TimeZoneFormat::parseDefaultOffsetFields(const UnicodeString& text, int32_t start, char16_t separator, int32_t& parsedLen) const {
     int32_t max = text.length();
     int32_t idx = start;
     int32_t len = 0;
@@ -2165,11 +2165,11 @@ TimeZoneFormat::parseSingleLocalizedDigit(const UnicodeString& text, int32_t sta
 }
 
 UnicodeString&
-TimeZoneFormat::formatOffsetWithAsciiDigits(int32_t offset, UChar sep, OffsetFields minFields, OffsetFields maxFields, UnicodeString& result) {
+TimeZoneFormat::formatOffsetWithAsciiDigits(int32_t offset, char16_t sep, OffsetFields minFields, OffsetFields maxFields, UnicodeString& result) {
     U_ASSERT(maxFields >= minFields);
     U_ASSERT(offset > -MAX_OFFSET && offset < MAX_OFFSET);
 
-    UChar sign = PLUS;
+    char16_t sign = PLUS;
     if (offset < 0) {
         sign = MINUS;
         offset = -offset;
@@ -2199,8 +2199,8 @@ TimeZoneFormat::formatOffsetWithAsciiDigits(int32_t offset, UChar sep, OffsetFie
         if (sep && idx != 0) {
             result.append(sep);
         }
-        result.append((UChar)(0x0030 + fields[idx]/10));
-        result.append((UChar)(0x0030 + fields[idx]%10));
+        result.append((char16_t)(0x0030 + fields[idx]/10));
+        result.append((char16_t)(0x0030 + fields[idx]%10));
     }
 
     return result;
@@ -2219,7 +2219,7 @@ TimeZoneFormat::parseAbuttingAsciiOffsetFields(const UnicodeString& text, ParseP
     int32_t numDigits = 0;
     int32_t idx = start;
     while (numDigits < maxDigits && idx < text.length()) {
-        UChar uch = text.charAt(idx);
+        char16_t uch = text.charAt(idx);
         int32_t digit = DIGIT_VAL(uch);
         if (digit < 0) {
             break;
@@ -2289,12 +2289,12 @@ TimeZoneFormat::parseAbuttingAsciiOffsetFields(const UnicodeString& text, ParseP
 }
 
 int32_t
-TimeZoneFormat::parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, UChar sep, OffsetFields minFields, OffsetFields maxFields) {
+TimeZoneFormat::parseAsciiOffsetFields(const UnicodeString& text, ParsePosition& pos, char16_t sep, OffsetFields minFields, OffsetFields maxFields) {
     int32_t start = pos.getIndex();
     int32_t fieldVal[] = {0, 0, 0};
     int32_t fieldLen[] = {0, -1, -1};
     for (int32_t idx = start, fieldIdx = 0; idx < text.length() && fieldIdx <= maxFields; idx++) {
-        UChar c = text.charAt(idx);
+        char16_t c = text.charAt(idx);
         if (c == sep) {
             if (fieldIdx == 0) {
                 if (fieldLen[0] == 0) {
@@ -2412,7 +2412,7 @@ TimeZoneFormat::unquote(const UnicodeString& pattern, UnicodeString& result) {
     UBool isPrevQuote = false;
     UBool inQuote = false;
     for (int32_t i = 0; i < pattern.length(); i++) {
-        UChar c = pattern.charAt(i);
+        char16_t c = pattern.charAt(i);
         if (c == SINGLEQUOTE) {
             if (isPrevQuote) {
                 result.append(c);
@@ -2443,13 +2443,13 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re
     int32_t checkBits = 0;
     UBool isPrevQuote = false;
     UBool inQuote = false;
-    UChar textBuf[32];
+    char16_t textBuf[32];
     UnicodeString text(textBuf, 0, UPRV_LENGTHOF(textBuf));
     GMTOffsetField::FieldType itemType = GMTOffsetField::TEXT;
     int32_t itemLength = 1;
 
     for (int32_t i = 0; i < pattern.length(); i++) {
-        UChar ch = pattern.charAt(i);
+        char16_t ch = pattern.charAt(i);
         if (ch == SINGLEQUOTE) {
             if (isPrevQuote) {
                 text.append(SINGLEQUOTE);
@@ -2585,7 +2585,7 @@ TimeZoneFormat::expandOffsetPattern(const UnicodeString& offsetHM, UnicodeString
     }
 
     UnicodeString sep;
-    int32_t idx_H = offsetHM.tempSubString(0, idx_mm).lastIndexOf((UChar)0x0048 /* H */);
+    int32_t idx_H = offsetHM.tempSubString(0, idx_mm).lastIndexOf((char16_t)0x0048 /* H */);
     if (idx_H >= 0) {
         sep = offsetHM.tempSubString(idx_H + 1, idx_mm - (idx_H + 1));
     }
@@ -2610,12 +2610,12 @@ TimeZoneFormat::truncateOffsetPattern(const UnicodeString& offsetHM, UnicodeStri
         status = U_ILLEGAL_ARGUMENT_ERROR;
         return result;
     }
-    UChar HH[] = {0x0048, 0x0048};
+    char16_t HH[] = {0x0048, 0x0048};
     int32_t idx_HH = offsetHM.tempSubString(0, idx_mm).lastIndexOf(HH, 2, 0);
     if (idx_HH >= 0) {
         return result.setTo(offsetHM.tempSubString(0, idx_HH + 2));
     }
-    int32_t idx_H = offsetHM.tempSubString(0, idx_mm).lastIndexOf((UChar)0x0048, 0);
+    int32_t idx_H = offsetHM.tempSubString(0, idx_mm).lastIndexOf((char16_t)0x0048, 0);
     if (idx_H >= 0) {
         return result.setTo(offsetHM.tempSubString(0, idx_H + 1));
     }
@@ -2714,7 +2714,7 @@ TimeZoneFormat::getTimeType(UTimeZoneNameType nameType) {
 UnicodeString&
 TimeZoneFormat::getTimeZoneID(const TimeZoneNames::MatchInfoCollection* matches, int32_t idx, UnicodeString& tzID) const {
     if (!matches->getTimeZoneIDAt(idx, tzID)) {
-        UChar mzIDBuf[32];
+        char16_t mzIDBuf[32];
         UnicodeString mzID(mzIDBuf, 0, UPRV_LENGTHOF(mzIDBuf));
         if (matches->getMetaZoneIDAt(idx, mzID)) {
             fTimeZoneNames->getReferenceZoneID(mzID, fTargetRegion, tzID);
@@ -2730,11 +2730,11 @@ public:
     virtual ~ZoneIdMatchHandler();
 
     UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status) override;
-    const UChar* getID();
+    const char16_t* getID();
     int32_t getMatchLen();
 private:
     int32_t fLen;
-    const UChar* fID;
+    const char16_t* fID;
 };
 
 ZoneIdMatchHandler::ZoneIdMatchHandler() 
@@ -2750,7 +2750,7 @@ ZoneIdMatchHandler::handleMatch(int32_t matchLength, const CharacterNode *node,
         return false;
     }
     if (node->hasValues()) {
-        const UChar* id = (const UChar*)node->getValue(0);
+        const char16_t* id = (const char16_t*)node->getValue(0);
         if (id != nullptr) {
             if (fLen < matchLength) {
                 fID = id;
@@ -2761,7 +2761,7 @@ ZoneIdMatchHandler::handleMatch(int32_t matchLength, const CharacterNode *node,
     return true;
 }
 
-const UChar*
+const char16_t*
 ZoneIdMatchHandler::getID() {
     return fID;
 }
@@ -2784,9 +2784,9 @@ static void U_CALLCONV initZoneIdTrie(UErrorCode &status) {
     if (U_SUCCESS(status)) {
         const UnicodeString *id;
         while ((id = tzenum->snext(status)) != nullptr) {
-            const UChar* uid = ZoneMeta::findTimeZoneID(*id);
+            const char16_t* uid = ZoneMeta::findTimeZoneID(*id);
             if (uid) {
-                gZoneIdTrie->put(uid, const_cast<UChar *>(uid), status);
+                gZoneIdTrie->put(uid, const_cast<char16_t *>(uid), status);
             }
         }
         delete tzenum;
@@ -2832,10 +2832,10 @@ static void U_CALLCONV initShortZoneIdTrie(UErrorCode &status) {
         } else {
             const UnicodeString *id;
             while ((id = tzenum->snext(status)) != nullptr) {
-                const UChar* uID = ZoneMeta::findTimeZoneID(*id);
-                const UChar* shortID = ZoneMeta::getShortID(*id);
+                const char16_t* uID = ZoneMeta::findTimeZoneID(*id);
+                const char16_t* shortID = ZoneMeta::getShortID(*id);
                 if (shortID && uID) {
-                    gShortZoneIdTrie->put(shortID, const_cast<UChar *>(uID), status);
+                    gShortZoneIdTrie->put(shortID, const_cast<char16_t *>(uID), status);
                 }
             }
         }
index 9cbe5e15c1bae1cd6f5bd7e1a611179c3b4c23c2..5b1cc94ddf8de0cfd33ef643594c4e5aeb2b1973 100644 (file)
@@ -46,10 +46,10 @@ static const char gZoneStrings[]                = "zoneStrings";
 static const char gRegionFormatTag[]            = "regionFormat";
 static const char gFallbackFormatTag[]          = "fallbackFormat";
 
-static const UChar gEmpty[]                     = {0x00};
+static const char16_t gEmpty[]                     = {0x00};
 
-static const UChar gDefRegionPattern[]          = {0x7B, 0x30, 0x7D, 0x00}; // "{0}"
-static const UChar gDefFallbackPattern[]        = {0x7B, 0x31, 0x7D, 0x20, 0x28, 0x7B, 0x30, 0x7D, 0x29, 0x00}; // "{1} ({0})"
+static const char16_t gDefRegionPattern[]          = {0x7B, 0x30, 0x7D, 0x00}; // "{0}"
+static const char16_t gDefFallbackPattern[]        = {0x7B, 0x31, 0x7D, 0x20, 0x28, 0x7B, 0x30, 0x7D, 0x29, 0x00}; // "{1} ({0})"
 
 static const double kDstCheckRange      = (double)184*U_MILLIS_PER_DAY;
 
@@ -58,8 +58,8 @@ static const double kDstCheckRange      = (double)184*U_MILLIS_PER_DAY;
 U_CDECL_BEGIN
 
 typedef struct PartialLocationKey {
-    const UChar* tzID;
-    const UChar* mzID;
+    const char16_t* tzID;
+    const char16_t* mzID;
     UBool isLong;
 } PartialLocationKey;
 
@@ -71,10 +71,10 @@ hashPartialLocationKey(const UHashTok key) {
     // <tzID>&<mzID>#[L|S]
     PartialLocationKey *p = (PartialLocationKey *)key.pointer;
     UnicodeString str(p->tzID);
-    str.append((UChar)0x26)
+    str.append((char16_t)0x26)
         .append(p->mzID, -1)
-        .append((UChar)0x23)
-        .append((UChar)(p->isLong ? 0x4C : 0x53));
+        .append((char16_t)0x23)
+        .append((char16_t)(p->isLong ? 0x4C : 0x53));
     return str.hashCode();
 }
 
@@ -109,7 +109,7 @@ deleteGNameInfo(void *obj) {
  */
 typedef struct GNameInfo {
     UTimeZoneGenericNameType    type;
-    const UChar*                tzID;
+    const char16_t*                tzID;
 } ZNameInfo;
 
 /**
@@ -306,7 +306,7 @@ private:
 
     void loadStrings(const UnicodeString& tzCanonicalID);
 
-    const UChar* getGenericLocationName(const UnicodeString& tzCanonicalID);
+    const char16_t* getGenericLocationName(const UnicodeString& tzCanonicalID);
 
     UnicodeString& formatGenericNonLocationName(const TimeZone& tz, UTimeZoneGenericNameType type,
                         UDate date, UnicodeString& name) const;
@@ -315,7 +315,7 @@ private:
                         const UnicodeString& mzID, UBool isLong, const UnicodeString& mzDisplayName,
                         UnicodeString& name) const;
 
-    const UChar* getPartialLocationName(const UnicodeString& tzCanonicalID,
+    const char16_t* getPartialLocationName(const UnicodeString& tzCanonicalID,
                         const UnicodeString& mzID, UBool isLong, const UnicodeString& mzDisplayName);
 
     TimeZoneGenericNameMatchInfo* findLocal(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const;
@@ -368,12 +368,12 @@ TZGNCore::initialize(const Locale& locale, UErrorCode& status) {
     zoneStrings = ures_getByKeyWithFallback(zoneStrings, gZoneStrings, zoneStrings, &tmpsts);
 
     if (U_SUCCESS(tmpsts)) {
-        const UChar *regionPattern = ures_getStringByKeyWithFallback(zoneStrings, gRegionFormatTag, nullptr, &tmpsts);
+        const char16_t *regionPattern = ures_getStringByKeyWithFallback(zoneStrings, gRegionFormatTag, nullptr, &tmpsts);
         if (U_SUCCESS(tmpsts) && u_strlen(regionPattern) > 0) {
             rpat.setTo(regionPattern, -1);
         }
         tmpsts = U_ZERO_ERROR;
-        const UChar *fallbackPattern = ures_getStringByKeyWithFallback(zoneStrings, gFallbackFormatTag, nullptr, &tmpsts);
+        const char16_t *fallbackPattern = ures_getStringByKeyWithFallback(zoneStrings, gFallbackFormatTag, nullptr, &tmpsts);
         if (U_SUCCESS(tmpsts) && u_strlen(fallbackPattern) > 0) {
             fpat.setTo(fallbackPattern, -1);
         }
@@ -430,7 +430,7 @@ TZGNCore::initialize(const Locale& locale, UErrorCode& status) {
 
     // preload generic names for the default zone
     TimeZone *tz = TimeZone::createDefault();
-    const UChar *tzID = ZoneMeta::getCanonicalCLDRID(*tz);
+    const char16_t *tzID = ZoneMeta::getCanonicalCLDRID(*tz);
     if (tzID != nullptr) {
         loadStrings(UnicodeString(true, tzID, -1));
     }
@@ -457,7 +457,7 @@ TZGNCore::getDisplayName(const TimeZone& tz, UTimeZoneGenericNameType type, UDat
     switch (type) {
     case UTZGNM_LOCATION:
         {
-            const UChar* tzCanonicalID = ZoneMeta::getCanonicalCLDRID(tz);
+            const char16_t* tzCanonicalID = ZoneMeta::getCanonicalCLDRID(tz);
             if (tzCanonicalID != nullptr) {
                 getGenericLocationName(UnicodeString(true, tzCanonicalID, -1), name);
             }
@@ -467,7 +467,7 @@ TZGNCore::getDisplayName(const TimeZone& tz, UTimeZoneGenericNameType type, UDat
     case UTZGNM_SHORT:
         formatGenericNonLocationName(tz, type, date, name);
         if (name.isEmpty()) {
-            const UChar* tzCanonicalID = ZoneMeta::getCanonicalCLDRID(tz);
+            const char16_t* tzCanonicalID = ZoneMeta::getCanonicalCLDRID(tz);
             if (tzCanonicalID != nullptr) {
                 getGenericLocationName(UnicodeString(true, tzCanonicalID, -1), name);
             }
@@ -486,7 +486,7 @@ TZGNCore::getGenericLocationName(const UnicodeString& tzCanonicalID, UnicodeStri
         return name;
     }
 
-    const UChar *locname = nullptr;
+    const char16_t *locname = nullptr;
     TZGNCore *nonConstThis = const_cast<TZGNCore *>(this);
     umtx_lock(&gLock);
     {
@@ -506,7 +506,7 @@ TZGNCore::getGenericLocationName(const UnicodeString& tzCanonicalID, UnicodeStri
 /*
  * This method updates the cache and must be called with a lock
  */
-const UChar*
+const char16_t*
 TZGNCore::getGenericLocationName(const UnicodeString& tzCanonicalID) {
     U_ASSERT(!tzCanonicalID.isEmpty());
     if (tzCanonicalID.length() > ZID_KEY_MAX) {
@@ -514,12 +514,12 @@ TZGNCore::getGenericLocationName(const UnicodeString& tzCanonicalID) {
     }
 
     UErrorCode status = U_ZERO_ERROR;
-    UChar tzIDKey[ZID_KEY_MAX + 1];
+    char16_t tzIDKey[ZID_KEY_MAX + 1];
     int32_t tzIDKeyLen = tzCanonicalID.extract(tzIDKey, ZID_KEY_MAX + 1, status);
     U_ASSERT(status == U_ZERO_ERROR);   // already checked length above
     tzIDKey[tzIDKeyLen] = 0;
 
-    const UChar *locname = (const UChar *)uhash_get(fLocationNamesMap, tzIDKey);
+    const char16_t *locname = (const char16_t *)uhash_get(fLocationNamesMap, tzIDKey);
 
     if (locname != nullptr) {
         // gEmpty indicate the name is not available
@@ -566,7 +566,7 @@ TZGNCore::getGenericLocationName(const UnicodeString& tzCanonicalID) {
     locname = name.isEmpty() ? nullptr : fStringPool.get(name, status);
     if (U_SUCCESS(status)) {
         // Cache the result
-        const UChar* cacheID = ZoneMeta::findTimeZoneID(tzCanonicalID);
+        const char16_t* cacheID = ZoneMeta::findTimeZoneID(tzCanonicalID);
         U_ASSERT(cacheID != nullptr);
         if (locname == nullptr) {
             // gEmpty to indicate - no location name available
@@ -595,7 +595,7 @@ TZGNCore::formatGenericNonLocationName(const TimeZone& tz, UTimeZoneGenericNameT
     U_ASSERT(type == UTZGNM_LONG || type == UTZGNM_SHORT);
     name.setToBogus();
 
-    const UChar* uID = ZoneMeta::getCanonicalCLDRID(tz);
+    const char16_t* uID = ZoneMeta::getCanonicalCLDRID(tz);
     if (uID == nullptr) {
         return name;
     }
@@ -611,14 +611,14 @@ TZGNCore::formatGenericNonLocationName(const TimeZone& tz, UTimeZoneGenericNameT
     }
 
     // Try meta zone
-    UChar mzIDBuf[32];
+    char16_t mzIDBuf[32];
     UnicodeString mzID(mzIDBuf, 0, UPRV_LENGTHOF(mzIDBuf));
     fTimeZoneNames->getMetaZoneID(tzID, date, mzID);
     if (!mzID.isEmpty()) {
         UErrorCode status = U_ZERO_ERROR;
         UBool useStandard = false;
         int32_t raw, sav;
-        UChar tmpNameBuf[ZONE_NAME_U16_MAX];
+        char16_t tmpNameBuf[ZONE_NAME_U16_MAX];
 
         tz.getOffset(date, false, raw, sav, status);
         if (U_FAILURE(status)) {
@@ -686,7 +686,7 @@ TZGNCore::formatGenericNonLocationName(const TimeZone& tz, UTimeZoneGenericNameT
                 // for some meta zones in some locales.  This looks like a data bugs.
                 // For now, we check if the standard name is different from its generic
                 // name below.
-                UChar genNameBuf[ZONE_NAME_U16_MAX];
+                char16_t genNameBuf[ZONE_NAME_U16_MAX];
                 UnicodeString mzGenericName(genNameBuf, 0, UPRV_LENGTHOF(genNameBuf));
                 fTimeZoneNames->getMetaZoneDisplayName(mzID, nameType, mzGenericName);
                 if (stdName.caseCompare(mzGenericName, 0) == 0) {
@@ -702,7 +702,7 @@ TZGNCore::formatGenericNonLocationName(const TimeZone& tz, UTimeZoneGenericNameT
                 // Check if we need to use a partial location format.
                 // This check is done by comparing offset with the meta zone's
                 // golden zone at the given date.
-                UChar idBuf[32];
+                char16_t idBuf[32];
                 UnicodeString goldenID(idBuf, 0, UPRV_LENGTHOF(idBuf));
                 fTimeZoneNames->getReferenceZoneID(mzID, fTargetRegion, goldenID);
                 if (!goldenID.isEmpty() && goldenID != tzID) {
@@ -741,7 +741,7 @@ TZGNCore::getPartialLocationName(const UnicodeString& tzCanonicalID,
         return name;
     }
 
-    const UChar *uplname = nullptr;
+    const char16_t *uplname = nullptr;
     TZGNCore *nonConstThis = const_cast<TZGNCore *>(this);
     umtx_lock(&gLock);
     {
@@ -760,7 +760,7 @@ TZGNCore::getPartialLocationName(const UnicodeString& tzCanonicalID,
 /*
  * This method updates the cache and must be called with a lock
  */
-const UChar*
+const char16_t*
 TZGNCore::getPartialLocationName(const UnicodeString& tzCanonicalID,
                         const UnicodeString& mzID, UBool isLong, const UnicodeString& mzDisplayName) {
     U_ASSERT(!tzCanonicalID.isEmpty());
@@ -773,7 +773,7 @@ TZGNCore::getPartialLocationName(const UnicodeString& tzCanonicalID,
     key.isLong = isLong;
     U_ASSERT(key.tzID != nullptr && key.mzID != nullptr);
 
-    const UChar* uplname = (const UChar*)uhash_get(fPartialLocationNamesMap, (void *)&key);
+    const char16_t* uplname = (const char16_t*)uhash_get(fPartialLocationNamesMap, (void *)&key);
     if (uplname != nullptr) {
         return uplname;
     }
index b07d6ad94d1b450d5047ed7e340fa8a42772c453..82afdc488cd7042ce003b20062c2f62045c2123d 100644 (file)
@@ -337,7 +337,7 @@ UnicodeString&
 TimeZoneNames::getDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UDate date, UnicodeString& name) const {
     getTimeZoneDisplayName(tzID, type, name);
     if (name.isEmpty()) {
-        UChar mzIDBuf[32];
+        char16_t mzIDBuf[32];
         UnicodeString mzID(mzIDBuf, 0, UPRV_LENGTHOF(mzIDBuf));
         getMetaZoneID(tzID, date, mzID);
         getMetaZoneDisplayName(mzID, type, name);
index a2b6c6d4a99f7432159ac7eb7ce79dc66a69f3df..babfdba3ef55967e592eca82d0d827607ebba165 100644 (file)
@@ -46,7 +46,7 @@ static const char gMZPrefix[]           = "meta:";
 
 static const char EMPTY[]               = "<empty>";   // place holder for empty ZNames
 static const char DUMMY_LOADER[]        = "<dummy>";   // place holder for dummy ZNamesLoader
-static const UChar NO_NAME[]            = { 0 };   // for empty no-fallback time zone names
+static const char16_t NO_NAME[]            = { 0 };   // for empty no-fallback time zone names
 
 // stuff for TZDBTimeZoneNames
 static const char* TZDBNAMES_KEYS[]               = {"ss", "sd"};
@@ -72,7 +72,7 @@ enum UTimeZoneNameTypeIndex {
     UTZNM_INDEX_SHORT_DAYLIGHT,
     UTZNM_INDEX_COUNT
 };
-static const UChar* const EMPTY_NAMES[UTZNM_INDEX_COUNT] = {0,0,0,0,0,0,0};
+static const char16_t* const EMPTY_NAMES[UTZNM_INDEX_COUNT] = {0,0,0,0,0,0,0};
 
 U_CDECL_BEGIN
 static UBool U_CALLCONV tzdbTimeZoneNames_cleanup(void) {
@@ -97,8 +97,8 @@ U_CDECL_END
  */
 struct ZNameInfo {
     UTimeZoneNameType   type;
-    const UChar*        tzID;
-    const UChar*        mzID;
+    const char16_t*        tzID;
+    const char16_t*        mzID;
 };
 
 /**
@@ -219,14 +219,14 @@ int32_t TextTrieMap::isEmpty() const {
 //     
 void
 TextTrieMap::put(const UnicodeString &key, void *value, ZNStringPool &sp, UErrorCode &status) {
-    const UChar *s = sp.get(key, status);
+    const char16_t *s = sp.get(key, status);
     put(s, value, status);
 }
 
 // This method is designed for a persistent key, such as string key stored in
 // resource bundle.
 void
-TextTrieMap::put(const UChar *key, void *value, UErrorCode &status) {
+TextTrieMap::put(const char16_t *key, void *value, UErrorCode &status) {
     fIsEmpty = false;
     if (fLazyContents == nullptr) {
         LocalPointer<UVector> lpLazyContents(new UVector(status), status);
@@ -240,7 +240,7 @@ TextTrieMap::put(const UChar *key, void *value, UErrorCode &status) {
     }
     U_ASSERT(fLazyContents != nullptr);
 
-    UChar *s = const_cast<UChar *>(key);
+    char16_t *s = const_cast<char16_t *>(key);
     fLazyContents->addElement(s, status);
     if (U_FAILURE(status)) {
         if (fValueDeleter) {
@@ -266,7 +266,7 @@ TextTrieMap::putImpl(const UnicodeString &key, void *value, UErrorCode &status)
     }
 
     UnicodeString foldedKey;
-    const UChar *keyBuffer;
+    const char16_t *keyBuffer;
     int32_t keyLength;
     if (fIgnoreCase) {
         // Ok to use fastCopyFrom() because we discard the copy when we return.
@@ -307,7 +307,7 @@ TextTrieMap::growNodes() {
 }
 
 CharacterNode*
-TextTrieMap::addChildNode(CharacterNode *parent, UChar c, UErrorCode &status) {
+TextTrieMap::addChildNode(CharacterNode *parent, char16_t c, UErrorCode &status) {
     if (U_FAILURE(status)) {
         return nullptr;
     }
@@ -316,7 +316,7 @@ TextTrieMap::addChildNode(CharacterNode *parent, UChar c, UErrorCode &status) {
     uint16_t nodeIndex = parent->fFirstChild;
     while (nodeIndex > 0) {
         CharacterNode *current = fNodes + nodeIndex;
-        UChar childCharacter = current->fCharacter;
+        char16_t childCharacter = current->fCharacter;
         if (childCharacter == c) {
             return current;
         } else if (childCharacter > c) {
@@ -351,12 +351,12 @@ TextTrieMap::addChildNode(CharacterNode *parent, UChar c, UErrorCode &status) {
 }
 
 CharacterNode*
-TextTrieMap::getChildNode(CharacterNode *parent, UChar c) const {
+TextTrieMap::getChildNode(CharacterNode *parent, char16_t c) const {
     // Linear search of the sorted list of children.
     uint16_t nodeIndex = parent->fFirstChild;
     while (nodeIndex > 0) {
         CharacterNode *current = fNodes + nodeIndex;
-        UChar childCharacter = current->fCharacter;
+        char16_t childCharacter = current->fCharacter;
         if (childCharacter == c) {
             return current;
         } else if (childCharacter > c) {
@@ -375,7 +375,7 @@ TextTrieMap::getChildNode(CharacterNode *parent, UChar c) const {
 void TextTrieMap::buildTrie(UErrorCode &status) {
     if (fLazyContents != nullptr) {
         for (int32_t i=0; i<fLazyContents->size(); i+=2) {
-            const UChar *key = (UChar *)fLazyContents->elementAt(i);
+            const char16_t *key = (char16_t *)fLazyContents->elementAt(i);
             void  *val = fLazyContents->elementAt(i+1);
             UnicodeString keyString(true, key, -1);  // Aliasing UnicodeString constructor.
             putImpl(keyString, val, status);
@@ -434,7 +434,7 @@ TextTrieMap::search(CharacterNode *node, const UnicodeString &text, int32_t star
         tmp.foldCase();
         int32_t tmpidx = 0;
         while (tmpidx < tmp.length()) {
-            UChar c = tmp.charAt(tmpidx++);
+            char16_t c = tmp.charAt(tmpidx++);
             node = getChildNode(node, c);
             if (node == nullptr) {
                 break;
@@ -442,7 +442,7 @@ TextTrieMap::search(CharacterNode *node, const UnicodeString &text, int32_t star
         }
     } else {
         // here we just get the next UTF16 code unit
-        UChar c = text.charAt(index++);
+        char16_t c = text.charAt(index++);
         node = getChildNode(node, c);
     }
     if (node != nullptr) {
@@ -457,7 +457,7 @@ static const int32_t POOL_CHUNK_SIZE = 2000;
 struct ZNStringPoolChunk: public UMemory {
     ZNStringPoolChunk    *fNext;                       // Ptr to next pool chunk
     int32_t               fLimit;                       // Index to start of unused area at end of fStrings
-    UChar                 fStrings[POOL_CHUNK_SIZE];    //  Strings array
+    char16_t              fStrings[POOL_CHUNK_SIZE];    //  Strings array
     ZNStringPoolChunk();
 };
 
@@ -500,15 +500,15 @@ ZNStringPool::~ZNStringPool() {
     }
 }
 
-static const UChar EmptyString = 0;
+static const char16_t EmptyString = 0;
 
-const UChar *ZNStringPool::get(const UChar *s, UErrorCode &status) {
-    const UChar *pooledString;
+const char16_t *ZNStringPool::get(const char16_t *s, UErrorCode &status) {
+    const char16_t *pooledString;
     if (U_FAILURE(status)) {
         return &EmptyString;
     }
 
-    pooledString = static_cast<UChar *>(uhash_get(fHash, s));
+    pooledString = static_cast<char16_t *>(uhash_get(fHash, s));
     if (pooledString != nullptr) {
         return pooledString;
     }
@@ -530,7 +530,7 @@ const UChar *ZNStringPool::get(const UChar *s, UErrorCode &status) {
         fChunks->fNext = oldChunk;
     }
     
-    UChar *destString = &fChunks->fStrings[fChunks->fLimit];
+    char16_t *destString = &fChunks->fStrings[fChunks->fLimit];
     u_strcpy(destString, s);
     fChunks->fLimit += (length + 1);
     uhash_put(fHash, destString, destString, &status);
@@ -543,15 +543,15 @@ const UChar *ZNStringPool::get(const UChar *s, UErrorCode &status) {
 //                           into the pool's storage.  Used for strings from resource bundles,
 //                           which will persist for the life of the zone string formatter, and
 //                           therefore can be used directly without copying.
-const UChar *ZNStringPool::adopt(const UChar * s, UErrorCode &status) {
-    const UChar *pooledString;
+const char16_t *ZNStringPool::adopt(const char16_t * s, UErrorCode &status) {
+    const char16_t *pooledString;
     if (U_FAILURE(status)) {
         return &EmptyString;
     }
     if (s != nullptr) {
-        pooledString = static_cast<UChar *>(uhash_get(fHash, s));
+        pooledString = static_cast<char16_t *>(uhash_get(fHash, s));
         if (pooledString == nullptr) {
-            UChar *ncs = const_cast<UChar *>(s);
+            char16_t *ncs = const_cast<char16_t *>(s);
             uhash_put(fHash, ncs, ncs, &status);
         }
     }
@@ -559,7 +559,7 @@ const UChar *ZNStringPool::adopt(const UChar * s, UErrorCode &status) {
 }
 
     
-const UChar *ZNStringPool::get(const UnicodeString &s, UErrorCode &status) {
+const char16_t *ZNStringPool::get(const UnicodeString &s, UErrorCode &status) {
     UnicodeString &nonConstStr = const_cast<UnicodeString &>(s);
     return this->get(nonConstStr.getTerminatedBuffer(), status);
 }
@@ -609,14 +609,14 @@ private:
         }
     }
 
-    const UChar* fNames[UTZNM_INDEX_COUNT];
+    const char16_t* fNames[UTZNM_INDEX_COUNT];
     UBool fDidAddIntoTrie;
 
     // Whether we own the location string, if computed rather than loaded from a bundle.
     // A meta zone names instance never has an exemplar location string.
     UBool fOwnsLocationName;
 
-    ZNames(const UChar* names[], const UChar* locationName)
+    ZNames(const char16_t* names[], const char16_t* locationName)
             : fDidAddIntoTrie(false) {
         uprv_memcpy(fNames, names, sizeof(fNames));
         if (locationName != nullptr) {
@@ -630,14 +630,14 @@ private:
 public:
     ~ZNames() {
         if (fOwnsLocationName) {
-            const UChar* locationName = fNames[UTZNM_INDEX_EXEMPLAR_LOCATION];
+            const char16_t* locationName = fNames[UTZNM_INDEX_EXEMPLAR_LOCATION];
             U_ASSERT(locationName != nullptr);
             uprv_free((void*) locationName);
         }
     }
 
 private:
-    static void* createMetaZoneAndPutInCache(UHashtable* cache, const UChar* names[],
+    static void* createMetaZoneAndPutInCache(UHashtable* cache, const char16_t* names[],
             const UnicodeString& mzID, UErrorCode& status) {
         if (U_FAILURE(status)) { return nullptr; }
         U_ASSERT(names != nullptr);
@@ -660,22 +660,22 @@ private:
         return value;
     }
 
-    static void* createTimeZoneAndPutInCache(UHashtable* cache, const UChar* names[],
+    static void* createTimeZoneAndPutInCache(UHashtable* cache, const char16_t* names[],
             const UnicodeString& tzID, UErrorCode& status) {
         if (U_FAILURE(status)) { return nullptr; }
         U_ASSERT(names != nullptr);
 
         // If necessary, compute the location name from the time zone name.
-        UChar* locationName = nullptr;
+        char16_t* locationName = nullptr;
         if (names[UTZNM_INDEX_EXEMPLAR_LOCATION] == nullptr) {
             UnicodeString locationNameUniStr;
             TimeZoneNamesImpl::getDefaultExemplarLocationName(tzID, locationNameUniStr);
 
             // Copy the computed location name to the heap
             if (locationNameUniStr.length() > 0) {
-                const UChar* buff = locationNameUniStr.getTerminatedBuffer();
-                int32_t len = sizeof(UChar) * (locationNameUniStr.length() + 1);
-                locationName = (UChar*) uprv_malloc(len);
+                const char16_t* buff = locationNameUniStr.getTerminatedBuffer();
+                int32_t len = sizeof(char16_t) * (locationNameUniStr.length() + 1);
+                locationName = (char16_t*) uprv_malloc(len);
                 if (locationName == nullptr) {
                     status = U_MEMORY_ALLOCATION_ERROR;
                     return nullptr;
@@ -697,26 +697,26 @@ private:
         return value;
     }
 
-    const UChar* getName(UTimeZoneNameType type) const {
+    const char16_t* getName(UTimeZoneNameType type) const {
         UTimeZoneNameTypeIndex index = getTZNameTypeIndex(type);
         return index >= 0 ? fNames[index] : nullptr;
     }
 
-    void addAsMetaZoneIntoTrie(const UChar* mzID, TextTrieMap& trie, UErrorCode& status) {
+    void addAsMetaZoneIntoTrie(const char16_t* mzID, TextTrieMap& trie, UErrorCode& status) {
         addNamesIntoTrie(mzID, nullptr, trie, status);
     }
-    void addAsTimeZoneIntoTrie(const UChar* tzID, TextTrieMap& trie, UErrorCode& status) {
+    void addAsTimeZoneIntoTrie(const char16_t* tzID, TextTrieMap& trie, UErrorCode& status) {
         addNamesIntoTrie(nullptr, tzID, trie, status);
     }
 
-    void addNamesIntoTrie(const UChar* mzID, const UChar* tzID, TextTrieMap& trie,
+    void addNamesIntoTrie(const char16_t* mzID, const char16_t* tzID, TextTrieMap& trie,
             UErrorCode& status) {
         if (U_FAILURE(status)) { return; }
         if (fDidAddIntoTrie) { return; }
         fDidAddIntoTrie = true;
 
         for (int32_t i = 0; i < UTZNM_INDEX_COUNT; i++) {
-            const UChar* name = fNames[i];
+            const char16_t* name = fNames[i];
             if (name != nullptr) {
                 ZNameInfo *nameinfo = (ZNameInfo *)uprv_malloc(sizeof(ZNameInfo));
                 if (nameinfo == nullptr) {
@@ -739,7 +739,7 @@ public:
 };
 
 struct ZNames::ZNamesLoader : public ResourceSink {
-    const UChar *names[UTZNM_INDEX_COUNT];
+    const char16_t *names[UTZNM_INDEX_COUNT];
 
     ZNamesLoader() {
         clear();
@@ -764,8 +764,8 @@ struct ZNames::ZNamesLoader : public ResourceSink {
         // Replace "/" with ":".
         UnicodeString uKey(tzID);
         for (int32_t i = 0; i < uKey.length(); i++) {
-            if (uKey.charAt(i) == (UChar)0x2F) {
-                uKey.setCharAt(i, (UChar)0x3A);
+            if (uKey.charAt(i) == (char16_t)0x2F) {
+                uKey.setCharAt(i, (char16_t)0x3A);
             }
         }
 
@@ -841,7 +841,7 @@ struct ZNames::ZNamesLoader : public ResourceSink {
     * This is different than Java, where the array will no longer be modified and null
     * may be returned.
     */
-    const UChar** getNames() {
+    const char16_t** getNames() {
         // Remove 'NO_NAME' references in the array and replace with 'nullptr'
         for (int32_t i = 0; i < UTZNM_INDEX_COUNT; ++i) {
             if (names[i] == NO_NAME) {
@@ -898,7 +898,7 @@ MetaZoneIDsEnumeration::MetaZoneIDsEnumeration(LocalPointer<UVector> mzIDs)
 const UnicodeString*
 MetaZoneIDsEnumeration::snext(UErrorCode& status) {
     if (U_SUCCESS(status) && fMetaZoneIDs != nullptr && fPos < fLen) {
-        unistr.setTo((const UChar*)fMetaZoneIDs->elementAt(fPos++), -1);
+        unistr.setTo((const char16_t*)fMetaZoneIDs->elementAt(fPos++), -1);
         return &unistr;
     }
     return nullptr;
@@ -1064,7 +1064,7 @@ TimeZoneNamesImpl::initialize(const Locale& locale, UErrorCode& status) {
 
     // preload zone strings for the default zone
     TimeZone *tz = TimeZone::createDefault();
-    const UChar *tzID = ZoneMeta::getCanonicalCLDRID(*tz);
+    const char16_t *tzID = ZoneMeta::getCanonicalCLDRID(*tz);
     if (tzID != nullptr) {
         loadStrings(UnicodeString(tzID), status);
     }
@@ -1166,7 +1166,7 @@ TimeZoneNamesImpl::_getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCod
         for (int32_t i = 0; U_SUCCESS(status) && i < mappings->size(); i++) {
 
             OlsonToMetaMappingEntry *map = (OlsonToMetaMappingEntry *)mappings->elementAt(i);
-            const UChar *mzID = map->mzid;
+            const char16_t *mzID = map->mzid;
             if (!mzIDs->contains((void *)mzID)) {
                 mzIDs->addElement((void *)mzID, status);
             }
@@ -1222,7 +1222,7 @@ TimeZoneNamesImpl::getMetaZoneDisplayName(const UnicodeString& mzID,
     }
 
     if (znames != nullptr) {
-        const UChar* s = znames->getName(type);
+        const char16_t* s = znames->getName(type);
         if (s != nullptr) {
             name.setTo(true, s, -1);
         }
@@ -1248,7 +1248,7 @@ TimeZoneNamesImpl::getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNa
     }
 
     if (tznames != nullptr) {
-        const UChar *s = tznames->getName(type);
+        const char16_t *s = tznames->getName(type);
         if (s != nullptr) {
             name.setTo(true, s, -1);
         }
@@ -1259,7 +1259,7 @@ TimeZoneNamesImpl::getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNa
 UnicodeString&
 TimeZoneNamesImpl::getExemplarLocationName(const UnicodeString& tzID, UnicodeString& name) const {
     name.setToBogus();  // cleanup result.
-    const UChar* locName = nullptr;
+    const char16_t* locName = nullptr;
     ZNames *tznames = nullptr;
     TimeZoneNamesImpl *nonConstThis = const_cast<TimeZoneNamesImpl *>(this);
 
@@ -1305,7 +1305,7 @@ TimeZoneNamesImpl::loadMetaZoneNames(const UnicodeString& mzID, UErrorCode& stat
     if (U_FAILURE(status)) { return nullptr; }
     U_ASSERT(mzID.length() <= ZID_KEY_MAX - MZ_PREFIX_LEN);
 
-    UChar mzIDKey[ZID_KEY_MAX + 1];
+    char16_t mzIDKey[ZID_KEY_MAX + 1];
     mzID.extract(mzIDKey, ZID_KEY_MAX + 1, status);
     U_ASSERT(U_SUCCESS(status));   // already checked length above
     mzIDKey[mzID.length()] = 0;
@@ -1333,7 +1333,7 @@ TimeZoneNamesImpl::loadTimeZoneNames(const UnicodeString& tzID, UErrorCode& stat
     if (U_FAILURE(status)) { return nullptr; }
     U_ASSERT(tzID.length() <= ZID_KEY_MAX);
 
-    UChar tzIDKey[ZID_KEY_MAX + 1];
+    char16_t tzIDKey[ZID_KEY_MAX + 1];
     int32_t tzIDKeyLen = tzID.extract(tzIDKey, ZID_KEY_MAX + 1, status);
     U_ASSERT(U_SUCCESS(status));   // already checked length above
     tzIDKey[tzIDKeyLen] = 0;
@@ -1419,7 +1419,7 @@ void TimeZoneNamesImpl::addAllNamesIntoTrie(UErrorCode& status) {
     pos = UHASH_FIRST;
     while ((element = uhash_nextElement(fMZNamesMap, &pos)) != nullptr) {
         if (element->value.pointer == EMPTY) { continue; }
-        UChar* mzID = (UChar*) element->key.pointer;
+        char16_t* mzID = (char16_t*) element->key.pointer;
         ZNames* znames = (ZNames*) element->value.pointer;
         znames->addAsMetaZoneIntoTrie(mzID, fNamesTrie, status);
         if (U_FAILURE(status)) { return; }
@@ -1428,7 +1428,7 @@ void TimeZoneNamesImpl::addAllNamesIntoTrie(UErrorCode& status) {
     pos = UHASH_FIRST;
     while ((element = uhash_nextElement(fTZNamesMap, &pos)) != nullptr) {
         if (element->value.pointer == EMPTY) { continue; }
-        UChar* tzID = (UChar*) element->key.pointer;
+        char16_t* tzID = (char16_t*) element->key.pointer;
         ZNames* znames = (ZNames*) element->value.pointer;
         znames->addAsTimeZoneIntoTrie(tzID, fNamesTrie, status);
         if (U_FAILURE(status)) { return; }
@@ -1612,7 +1612,7 @@ void TimeZoneNamesImpl::getDisplayNames(const UnicodeString& tzID,
     // Load the values into the dest array
     for (int i = 0; i < numTypes; i++) {
         UTimeZoneNameType type = types[i];
-        const UChar* name = ((ZNames*)tznames)->getName(type);
+        const char16_t* name = ((ZNames*)tznames)->getName(type);
         if (name == nullptr) {
             if (mznames == nullptr) {
                 // Load the meta zone name
@@ -1681,11 +1681,11 @@ void TimeZoneNamesImpl::internalLoadAllDisplayNames(UErrorCode& status) {
 
 
 
-static const UChar gEtcPrefix[]         = { 0x45, 0x74, 0x63, 0x2F }; // "Etc/"
+static const char16_t gEtcPrefix[]         = { 0x45, 0x74, 0x63, 0x2F }; // "Etc/"
 static const int32_t gEtcPrefixLen      = 4;
-static const UChar gSystemVPrefix[]     = { 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x56, 0x2F }; // "SystemV/
+static const char16_t gSystemVPrefix[]     = { 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x56, 0x2F }; // "SystemV/
 static const int32_t gSystemVPrefixLen  = 8;
-static const UChar gRiyadh8[]           = { 0x52, 0x69, 0x79, 0x61, 0x64, 0x68, 0x38 }; // "Riyadh8"
+static const char16_t gRiyadh8[]           = { 0x52, 0x69, 0x79, 0x61, 0x64, 0x68, 0x38 }; // "Riyadh8"
 static const int32_t gRiyadh8Len       = 7;
 
 UnicodeString& U_EXPORT2
@@ -1696,11 +1696,11 @@ TimeZoneNamesImpl::getDefaultExemplarLocationName(const UnicodeString& tzID, Uni
         return name;
     }
 
-    int32_t sep = tzID.lastIndexOf((UChar)0x2F /* '/' */);
+    int32_t sep = tzID.lastIndexOf((char16_t)0x2F /* '/' */);
     if (sep > 0 && sep + 1 < tzID.length()) {
         name.setTo(tzID, sep + 1);
-        name.findAndReplace(UnicodeString((UChar)0x5f /* _ */),
-                            UnicodeString((UChar)0x20 /* space */));
+        name.findAndReplace(UnicodeString((char16_t)0x5f /* _ */),
+                            UnicodeString((char16_t)0x20 /* space */));
     } else {
         name.setToBogus();
     }
@@ -1719,19 +1719,19 @@ public:
     virtual ~TZDBNames();
 
     static TZDBNames* createInstance(UResourceBundle* rb, const char* key);
-    const UChar* getName(UTimeZoneNameType type) const;
+    const char16_t* getName(UTimeZoneNameType type) const;
     const char** getParseRegions(int32_t& numRegions) const;
 
 protected:
-    TZDBNames(const UChar** names, char** regions, int32_t numRegions);
+    TZDBNames(const char16_t** names, char** regions, int32_t numRegions);
 
 private:
-    const UChar** fNames;
+    const char16_t** fNames;
     char** fRegions;
     int32_t fNumRegions;
 };
 
-TZDBNames::TZDBNames(const UChar** names, char** regions, int32_t numRegions)
+TZDBNames::TZDBNames(const char16_t** names, char** regions, int32_t numRegions)
     :   fNames(names),
         fRegions(regions),
         fNumRegions(numRegions) {
@@ -1758,7 +1758,7 @@ TZDBNames::createInstance(UResourceBundle* rb, const char* key) {
 
     UErrorCode status = U_ZERO_ERROR;
 
-    const UChar **names = nullptr;
+    const char16_t **names = nullptr;
     char** regions = nullptr;
     int32_t numRegions = 0;
 
@@ -1770,12 +1770,12 @@ TZDBNames::createInstance(UResourceBundle* rb, const char* key) {
         return nullptr;
     }
 
-    names = (const UChar **)uprv_malloc(sizeof(const UChar*) * TZDBNAMES_KEYS_SIZE);
+    names = (const char16_t **)uprv_malloc(sizeof(const char16_t*) * TZDBNAMES_KEYS_SIZE);
     UBool isEmpty = true;
     if (names != nullptr) {
         for (int32_t i = 0; i < TZDBNAMES_KEYS_SIZE; i++) {
             status = U_ZERO_ERROR;
-            const UChar *value = ures_getStringByKey(rbTable, TZDBNAMES_KEYS[i], &len, &status);
+            const char16_t *value = ures_getStringByKey(rbTable, TZDBNAMES_KEYS[i], &len, &status);
             if (U_FAILURE(status) || len == 0) {
                 names[i] = nullptr;
             } else {
@@ -1807,7 +1807,7 @@ TZDBNames::createInstance(UResourceBundle* rb, const char* key) {
                 pRegion = regions;
                 for (int32_t i = 0; i < numRegions; i++, pRegion++) {
                     status = U_ZERO_ERROR;
-                    const UChar *uregion = ures_getStringByIndex(regionsRes, i, &len, &status);
+                    const char16_t *uregion = ures_getStringByIndex(regionsRes, i, &len, &status);
                     if (U_FAILURE(status)) {
                         regionError = true;
                         break;
@@ -1843,12 +1843,12 @@ TZDBNames::createInstance(UResourceBundle* rb, const char* key) {
     return new TZDBNames(names, regions, numRegions);
 }
 
-const UChar*
+const char16_t*
 TZDBNames::getName(UTimeZoneNameType type) const {
     if (fNames == nullptr) {
         return nullptr;
     }
-    const UChar *name = nullptr;
+    const char16_t *name = nullptr;
     switch(type) {
     case UTZNM_SHORT_STANDARD:
         name = fNames[0];
@@ -1878,7 +1878,7 @@ U_CDECL_BEGIN
  * in the trie
  */
 typedef struct TZDBNameInfo {
-    const UChar*        mzID;
+    const char16_t*        mzID;
     UTimeZoneNameType   type;
     UBool               ambiguousType;
     const char**        parseRegions;
@@ -2072,8 +2072,8 @@ static void U_CALLCONV prepareFind(UErrorCode &status) {
             if (names == nullptr) {
                 continue;
             }
-            const UChar *std = names->getName(UTZNM_SHORT_STANDARD);
-            const UChar *dst = names->getName(UTZNM_SHORT_DAYLIGHT);
+            const char16_t *std = names->getName(UTZNM_SHORT_STANDARD);
+            const char16_t *dst = names->getName(UTZNM_SHORT_DAYLIGHT);
             if (std == nullptr && dst == nullptr) {
                 continue;
             }
@@ -2087,7 +2087,7 @@ static void U_CALLCONV prepareFind(UErrorCode &status) {
             // we need to store the information for later processing.
             UBool ambiguousType = (std != nullptr && dst != nullptr && u_strcmp(std, dst) == 0);
 
-            const UChar *uMzID = ZoneMeta::findMetaZoneID(*mzID);
+            const char16_t *uMzID = ZoneMeta::findMetaZoneID(*mzID);
             if (std != nullptr) {
                 TZDBNameInfo *stdInf = (TZDBNameInfo *)uprv_malloc(sizeof(TZDBNameInfo));
                 if (stdInf == nullptr) {
@@ -2204,7 +2204,7 @@ TZDBTimeZoneNames::getMetaZoneDisplayName(const UnicodeString& mzID,
     const TZDBNames *tzdbNames = TZDBTimeZoneNames::getMetaZoneNames(mzID, status);
     if (U_SUCCESS(status)) {
         if (tzdbNames != nullptr) {
-            const UChar *s = tzdbNames->getName(type);
+            const char16_t *s = tzdbNames->getName(type);
             if (s != nullptr) {
                 name.setTo(true, s, -1);
             }
@@ -2246,7 +2246,7 @@ TZDBTimeZoneNames::getMetaZoneNames(const UnicodeString& mzID, UErrorCode& statu
 
     TZDBNames* tzdbNames = nullptr;
 
-    UChar mzIDKey[ZID_KEY_MAX + 1];
+    char16_t mzIDKey[ZID_KEY_MAX + 1];
     mzID.extract(mzIDKey, ZID_KEY_MAX + 1, status);
     U_ASSERT(status == U_ZERO_ERROR);   // already checked length above
     mzIDKey[mzID.length()] = 0;
index 159402d71bed157cdd1c79a732e067020a2ef9a4..8ca2f84e73dba099bee60211bc804182f1e91221 100644 (file)
@@ -33,7 +33,7 @@
 U_NAMESPACE_BEGIN
 
 /*
- * ZNStringPool    Pool of (UChar *) strings.  Provides for sharing of repeated
+ * ZNStringPool    Pool of (char16_t *) strings.  Provides for sharing of repeated
  *                 zone strings.
  */
 struct ZNStringPoolChunk;
@@ -47,17 +47,17 @@ class U_I18N_API ZNStringPool: public UMemory {
      *
      * Life time of the returned string is that of the pool.
      */
-    const UChar *get(const UChar *s, UErrorCode &status);
+    const char16_t *get(const char16_t *s, UErrorCode &status);
 
     /* Get the pooled string that is equal to the supplied string s.
      * Copy the string into the pool if it is not already present.
      */
-    const UChar *get(const UnicodeString &s, UErrorCode &status);
+    const char16_t *get(const UnicodeString &s, UErrorCode &status);
 
     /* Adopt a string into the pool, without copying it.
      * Used for strings from resource bundles, which will persist without copying.
      */
-    const UChar *adopt(const UChar *s, UErrorCode &status);
+    const char16_t *adopt(const char16_t *s, UErrorCode &status);
 
     /* Freeze the string pool.  Discards the hash table that is used
      * for looking up a string.  All pointers to pooled strings remain valid.
@@ -86,7 +86,7 @@ struct CharacterNode {
     inline const void *getValue(int32_t index) const;
 
     void     *fValues;      // Union of one single value vs. UVector of values.
-    UChar    fCharacter;    // UTF-16 code unit.
+    char16_t fCharacter;    // UTF-16 code unit.
     uint16_t fFirstChild;   // 0 if no children.
     uint16_t fNextSibling;  // 0 terminates the list.
     UBool    fHasValuesVector;
@@ -136,7 +136,7 @@ public:
     virtual ~TextTrieMap();
 
     void put(const UnicodeString &key, void *value, ZNStringPool &sp, UErrorCode &status);
-    void put(const UChar*, void *value, UErrorCode &status);
+    void put(const char16_t*, void *value, UErrorCode &status);
     void search(const UnicodeString &text, int32_t start,
         TextTrieMapSearchResultHandler *handler, UErrorCode& status) const;
     int32_t isEmpty() const;
@@ -152,8 +152,8 @@ private:
     UObjectDeleter  *fValueDeleter;
 
     UBool growNodes();
-    CharacterNode* addChildNode(CharacterNode *parent, UChar c, UErrorCode &status);
-    CharacterNode* getChildNode(CharacterNode *parent, UChar c) const;
+    CharacterNode* addChildNode(CharacterNode *parent, char16_t c, UErrorCode &status);
+    CharacterNode* getChildNode(CharacterNode *parent, char16_t c) const;
 
     void putImpl(const UnicodeString &key, void *value, UErrorCode &status);
     void buildTrie(UErrorCode &status);
index 36fe9b8f8a983c08803eec14516484b5496b97a5..674cb3182cc29c29458e5bd3c51cb330159a2108 100644 (file)
@@ -32,7 +32,7 @@
 U_NAMESPACE_USE
 
 static TimeZone*
-_createTimeZone(const UChar* zoneID, int32_t len, UErrorCode* ec) {
+_createTimeZone(const char16_t* zoneID, int32_t len, UErrorCode* ec) {
     TimeZone* zone = nullptr;
     if (ec != nullptr && U_SUCCESS(*ec)) {
         // Note that if zoneID is invalid, we get back GMT. This odd
@@ -67,7 +67,7 @@ ucal_openCountryTimeZones(const char* country, UErrorCode* ec) {
 }
 
 U_CAPI int32_t U_EXPORT2
-ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec) {
+ucal_getDefaultTimeZone(char16_t* result, int32_t resultCapacity, UErrorCode* ec) {
     int32_t len = 0;
     if (ec != nullptr && U_SUCCESS(*ec)) {
         TimeZone* zone = TimeZone::createDefault();
@@ -84,7 +84,7 @@ ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec) {
 }
 
 U_CAPI void U_EXPORT2
-ucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec) {
+ucal_setDefaultTimeZone(const char16_t* zoneID, UErrorCode* ec) {
     TimeZone* zone = _createTimeZone(zoneID, -1, ec);
     if (zone != nullptr) {
         TimeZone::adoptDefault(zone);
@@ -92,7 +92,7 @@ ucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec) {
 }
 
 U_CAPI int32_t U_EXPORT2
-ucal_getHostTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec) {
+ucal_getHostTimeZone(char16_t* result, int32_t resultCapacity, UErrorCode* ec) {
     int32_t len = 0;
     if (ec != nullptr && U_SUCCESS(*ec)) {
         TimeZone *zone = TimeZone::detectHostTimeZone();
@@ -109,7 +109,7 @@ ucal_getHostTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec) {
 }
 
 U_CAPI int32_t U_EXPORT2
-ucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec) {
+ucal_getDSTSavings(const char16_t* zoneID, UErrorCode* ec) {
     int32_t result = 0;
     TimeZone* zone = _createTimeZone(zoneID, -1, ec);
     if (U_SUCCESS(*ec)) {
@@ -148,7 +148,7 @@ ucal_getNow()
 #define ULOC_LOCALE_IDENTIFIER_CAPACITY (ULOC_FULLNAME_CAPACITY + 1 + ULOC_KEYWORD_AND_VALUES_CAPACITY)
 
 U_CAPI UCalendar*  U_EXPORT2
-ucal_open(  const UChar*  zoneID,
+ucal_open(  const char16_t*  zoneID,
             int32_t       len,
             const char*   locale,
             UCalendarType caltype,
@@ -211,7 +211,7 @@ ucal_clone(const UCalendar* cal,
 
 U_CAPI void  U_EXPORT2
 ucal_setTimeZone(    UCalendar*      cal,
-            const    UChar*            zoneID,
+            const    char16_t*            zoneID,
             int32_t        len,
             UErrorCode *status)
 {
@@ -229,7 +229,7 @@ ucal_setTimeZone(    UCalendar*      cal,
 
 U_CAPI int32_t U_EXPORT2
 ucal_getTimeZoneID(const UCalendar *cal,
-                   UChar *result,
+                   char16_t *result,
                    int32_t resultLength,
                    UErrorCode *status)
 {
@@ -246,7 +246,7 @@ U_CAPI int32_t U_EXPORT2
 ucal_getTimeZoneDisplayName(const     UCalendar*                 cal,
                     UCalendarDisplayNameType     type,
                     const char             *locale,
-                    UChar*                  result,
+                    char16_t*                  result,
                     int32_t                 resultLength,
                     UErrorCode*             status)
 {
@@ -588,8 +588,8 @@ ucal_getTZDataVersion(UErrorCode* status)
 }
 
 U_CAPI int32_t U_EXPORT2
-ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len,
-                            UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status) {
+ucal_getCanonicalTimeZoneID(const char16_t* id, int32_t len,
+                            char16_t* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status) {
     if(status == 0 || U_FAILURE(*status)) {
         return 0;
     }
@@ -715,7 +715,7 @@ ucal_getKeywordValuesForLocale(const char * /* key */, const char* locale, UBool
         if (U_SUCCESS(*status)) {
             for (int i = 0; i < ures_getSize(order); i++) {
                 int32_t len;
-                const UChar *type = ures_getStringByIndex(order, i, &len, status);
+                const char16_t *type = ures_getStringByIndex(order, i, &len, status);
                 char *caltype = (char*)uprv_malloc(len + 1);
                 if (caltype == nullptr) {
                     *status = U_MEMORY_ALLOCATION_ERROR;
@@ -793,7 +793,7 @@ ucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType typ
 }
 
 U_CAPI int32_t U_EXPORT2
-ucal_getWindowsTimeZoneID(const UChar* id, int32_t len, UChar* winid, int32_t winidCapacity, UErrorCode* status) {
+ucal_getWindowsTimeZoneID(const char16_t* id, int32_t len, char16_t* winid, int32_t winidCapacity, UErrorCode* status) {
     if (U_FAILURE(*status)) {
         return 0;
     }
@@ -811,7 +811,7 @@ ucal_getWindowsTimeZoneID(const UChar* id, int32_t len, UChar* winid, int32_t wi
 }
 
 U_CAPI int32_t U_EXPORT2
-ucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* region, UChar* id, int32_t idCapacity, UErrorCode* status) {
+ucal_getTimeZoneIDForWindowsID(const char16_t* winid, int32_t len, const char* region, char16_t* id, int32_t idCapacity, UErrorCode* status) {
     if (U_FAILURE(*status)) {
         return 0;
     }
index 7585b77bb43e2fae2ddca7e334241a53f6fecae0..7c9fb00bf3fcf03529b28d87b3a7b773bf148b89 100644 (file)
@@ -196,7 +196,7 @@ ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length,
 
 U_CAPI int32_t U_EXPORT2
 ucol_getSortKey(const    UCollator    *coll,
-        const    UChar        *source,
+        const    char16_t     *source,
         int32_t        sourceLength,
         uint8_t        *result,
         int32_t        resultLength)
@@ -320,7 +320,7 @@ ucol_getMaxVariable(const UCollator *coll) {
 }
 
 U_CAPI uint32_t  U_EXPORT2
-ucol_setVariableTop(UCollator *coll, const UChar *varTop, int32_t len, UErrorCode *status) {
+ucol_setVariableTop(UCollator *coll, const char16_t *varTop, int32_t len, UErrorCode *status) {
     if(U_FAILURE(*status) || coll == nullptr) {
         return 0;
     }
@@ -445,9 +445,9 @@ ucol_strcollIter( const UCollator    *coll,
 /*                                                                      */
 U_CAPI UCollationResult U_EXPORT2
 ucol_strcoll( const UCollator    *coll,
-              const UChar        *source,
+              const char16_t     *source,
               int32_t            sourceLength,
-              const UChar        *target,
+              const char16_t     *target,
               int32_t            targetLength)
 {
     UTRACE_ENTRY(UTRACE_UCOL_STRCOLL);
@@ -496,9 +496,9 @@ ucol_strcollUTF8(
 /* convenience function for comparing strings */
 U_CAPI UBool U_EXPORT2
 ucol_greater(    const    UCollator        *coll,
-        const    UChar            *source,
+        const    char16_t         *source,
         int32_t            sourceLength,
-        const    UChar            *target,
+        const    char16_t         *target,
         int32_t            targetLength)
 {
     return (ucol_strcoll(coll, source, sourceLength, target, targetLength)
@@ -508,9 +508,9 @@ ucol_greater(    const    UCollator        *coll,
 /* convenience function for comparing strings */
 U_CAPI UBool U_EXPORT2
 ucol_greaterOrEqual(    const    UCollator    *coll,
-            const    UChar        *source,
+            const    char16_t     *source,
             int32_t        sourceLength,
-            const    UChar        *target,
+            const    char16_t     *target,
             int32_t        targetLength)
 {
     return (ucol_strcoll(coll, source, sourceLength, target, targetLength)
@@ -520,9 +520,9 @@ ucol_greaterOrEqual(    const    UCollator    *coll,
 /* convenience function for comparing strings */
 U_CAPI UBool U_EXPORT2
 ucol_equal(        const    UCollator        *coll,
-            const    UChar            *source,
+            const    char16_t         *source,
             int32_t            sourceLength,
-            const    UChar            *target,
+            const    char16_t         *target,
             int32_t            targetLength)
 {
     return (ucol_strcoll(coll, source, sourceLength, target, targetLength)
@@ -548,7 +548,7 @@ ucol_getUCAVersion(const UCollator* coll, UVersionInfo info) {
     }
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 ucol_getRules(const UCollator *coll, int32_t *length) {
     const RuleBasedCollator *rbc = RuleBasedCollator::rbcFromUCollator(coll);
     // OK to crash if coll==nullptr: We do not want to check "this" pointers.
@@ -558,13 +558,13 @@ ucol_getRules(const UCollator *coll, int32_t *length) {
         *length = rules.length();
         return rules.getBuffer();
     }
-    static const UChar _NUL = 0;
+    static const char16_t _NUL = 0;
     *length = 0;
     return &_NUL;
 }
 
 U_CAPI int32_t U_EXPORT2
-ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, UChar *buffer, int32_t bufferLen) {
+ucol_getRulesEx(const UCollator *coll, UColRuleOption delta, char16_t *buffer, int32_t bufferLen) {
     UnicodeString rules;
     const RuleBasedCollator *rbc = RuleBasedCollator::rbcFromUCollator(coll);
     if(rbc != nullptr || coll == nullptr) {
index 4356849370f6bf4953a2d0433aab1ff28ffef92f..a955cef0e6113c72b1e4c296c67196111664dbd9 100644 (file)
@@ -59,7 +59,7 @@ U_NAMESPACE_BEGIN
 
 namespace {
 
-static const UChar *rootRules = nullptr;
+static const char16_t *rootRules = nullptr;
 static int32_t rootRulesLength = 0;
 static UResourceBundle *rootBundle = nullptr;
 static UInitOnce gInitOnceUcolRes {};
@@ -124,7 +124,7 @@ CollationLoader::loadRules(const char *localeID, const char *collationType,
     LocalUResourceBundlePointer data(
             ures_getByKeyWithFallback(collations.getAlias(), type, nullptr, &errorCode));
     int32_t length;
-    const UChar *s =  ures_getStringByKey(data.getAlias(), "Sequence", &length, &errorCode);
+    const char16_t *s =  ures_getStringByKey(data.getAlias(), "Sequence", &length, &errorCode);
     if(U_FAILURE(errorCode)) { return; }
 
     // No string pointer aliasing so that we need not hold onto the resource bundle.
@@ -269,7 +269,7 @@ CollationLoader::loadFromBundle(UErrorCode &errorCode) {
         LocalUResourceBundlePointer def(
                 ures_getByKeyWithFallback(collations, "default", nullptr, &internalErrorCode));
         int32_t length;
-        const UChar *s = ures_getString(def.getAlias(), &length, &internalErrorCode);
+        const char16_t *s = ures_getString(def.getAlias(), &length, &internalErrorCode);
         if(U_SUCCESS(internalErrorCode) && 0 < length && length < UPRV_LENGTHOF(defaultType)) {
             u_UCharsToChars(s, defaultType, length + 1);
         } else {
@@ -401,7 +401,7 @@ CollationLoader::loadFromData(UErrorCode &errorCode) {
     {
         UErrorCode internalErrorCode = U_ZERO_ERROR;
         int32_t len;
-        const UChar *s = ures_getStringByKey(data, "Sequence", &len,
+        const char16_t *s = ures_getStringByKey(data, "Sequence", &len,
                                              &internalErrorCode);
         if(U_SUCCESS(internalErrorCode)) {
             t->rules.setTo(true, s, len);
@@ -427,7 +427,7 @@ CollationLoader::loadFromData(UErrorCode &errorCode) {
                 ures_getByKeyWithFallback(actualBundle.getAlias(), "collations/default", nullptr,
                                           &internalErrorCode));
         int32_t len;
-        const UChar *s = ures_getString(def.getAlias(), &len, &internalErrorCode);
+        const char16_t *s = ures_getString(def.getAlias(), &len, &internalErrorCode);
         if(U_SUCCESS(internalErrorCode) && len < UPRV_LENGTHOF(defaultType)) {
             u_UCharsToChars(s, defaultType, len + 1);
         } else {
@@ -522,7 +522,7 @@ ucol_open(const char *loc,
 U_CAPI int32_t U_EXPORT2
 ucol_getDisplayName(    const    char        *objLoc,
                     const    char        *dispLoc,
-                    UChar             *result,
+                    char16_t          *result,
                     int32_t         resultLength,
                     UErrorCode        *status)
 {
index 30a183d91106d958bc1e9583315b4bbc12daf923..a740286d79ed3cebfa38bea811549f81f6fbda47 100644 (file)
@@ -99,7 +99,7 @@ struct CollatorSpec {
     CharString locale;
     UColAttributeValue options[UCOL_ATTRIBUTE_COUNT];
     uint32_t variableTopValue;
-    UChar variableTopString[locElementCapacity];
+    char16_t variableTopString[locElementCapacity];
     int32_t variableTopStringLen;
     UBool variableTopSet;
     CharString entries[UCOL_SIT_ITEMS_COUNT];
@@ -217,10 +217,10 @@ _processCollatorOption(CollatorSpec *spec, uint32_t option, const char* string,
 U_CDECL_END
 
 
-static UChar
+static char16_t
 readHexCodeUnit(const char **string, UErrorCode *status)
 {
-    UChar result = 0;
+    char16_t result = 0;
     int32_t value = 0;
     char c;
     int32_t noDigits = 0;
@@ -238,7 +238,7 @@ readHexCodeUnit(const char **string, UErrorCode *status)
 #endif    
             return 0;
         }
-        result = (result << 4) | (UChar)value;
+        result = (result << 4) | (char16_t)value;
         noDigits++;
         (*string)++;
     }
@@ -472,7 +472,7 @@ ucol_prepareShortStringOpen( const char *definition,
       UResourceBundle *defaultColl = ures_getByKeyWithFallback(collations, "default", nullptr, status);
       if(U_SUCCESS(*status)) {
         int32_t defaultKeyLen = 0;
-        const UChar *defaultKey = ures_getString(defaultColl, &defaultKeyLen, status);
+        const char16_t *defaultKey = ures_getString(defaultColl, &defaultKeyLen, status);
         u_UCharsToChars(defaultKey, keyBuffer, defaultKeyLen);
         keyBuffer[defaultKeyLen] = 0;
       } else {
index e9ad2efdfe68fcd449bbcee26262e997c48977f6..36b83c4c1043ad01dbb841aefae128763adcebcb 100644 (file)
@@ -272,7 +272,7 @@ U_NAMESPACE_END
 
 U_CAPI UCollationElements* U_EXPORT2
 ucol_openElements(const UCollator  *coll,
-                  const UChar      *text,
+                  const char16_t   *text,
                         int32_t    textLength,
                         UErrorCode *status)
 {
@@ -476,7 +476,7 @@ ucol_getMaxExpansion(const UCollationElements *elems,
 
 U_CAPI void U_EXPORT2
 ucol_setText(      UCollationElements *elems,
-             const UChar              *text,
+             const char16_t           *text,
                    int32_t            textLength,
                    UErrorCode         *status)
 {
index ca224dbe059cd3d2ad81cef256cf2f483b0ccf7e..c8b8712fbaa601b06df4bad78a3b05c028f2a9e5 100644 (file)
@@ -172,7 +172,7 @@ ucsdet_enableInputFilter(UCharsetDetector *ucsd, UBool filter)
 
 U_CAPI  int32_t U_EXPORT2
 ucsdet_getUChars(const UCharsetMatch *ucsm,
-                 UChar *buf, int32_t cap, UErrorCode *status)
+                 char16_t *buf, int32_t cap, UErrorCode *status)
 {
     if(U_FAILURE(*status)) {
         return 0;
index 4e08bd466478b66b97b08d2c56abef4f8aacf428..e895c7d1b11dd2a6552aa31ea2b3ec90fef23893 100644 (file)
@@ -134,9 +134,9 @@ U_CAPI UDateFormat* U_EXPORT2
 udat_open(UDateFormatStyle  timeStyle,
           UDateFormatStyle  dateStyle,
           const char        *locale,
-          const UChar       *tzID,
+          const char16_t    *tzID,
           int32_t           tzIDLength,
-          const UChar       *pattern,
+          const char16_t    *pattern,
           int32_t           patternLength,
           UErrorCode        *status)
 {
@@ -220,7 +220,7 @@ udat_clone(const UDateFormat *fmt,
 U_CAPI int32_t U_EXPORT2
 udat_format(    const    UDateFormat*    format,
         UDate           dateToFormat,
-        UChar*          result,
+        char16_t*          result,
         int32_t         resultLength,
         UFieldPosition* position,
         UErrorCode*     status)
@@ -258,7 +258,7 @@ udat_format(    const    UDateFormat*    format,
 U_CAPI int32_t U_EXPORT2
 udat_formatCalendar(const UDateFormat*  format,
         UCalendar*      calendar,
-        UChar*          result,
+        char16_t*          result,
         int32_t         resultLength,
         UFieldPosition* position,
         UErrorCode*     status)
@@ -296,7 +296,7 @@ udat_formatCalendar(const UDateFormat*  format,
 U_CAPI int32_t U_EXPORT2
 udat_formatForFields(    const    UDateFormat*    format,
         UDate           dateToFormat,
-        UChar*          result,
+        char16_t*          result,
         int32_t         resultLength,
         UFieldPositionIterator* fpositer,
         UErrorCode*     status)
@@ -324,7 +324,7 @@ udat_formatForFields(    const    UDateFormat*    format,
 U_CAPI int32_t U_EXPORT2
 udat_formatCalendarForFields(const UDateFormat*  format,
         UCalendar*      calendar,
-        UChar*          result,
+        char16_t*          result,
         int32_t         resultLength,
         UFieldPositionIterator* fpositer,
         UErrorCode*     status)
@@ -351,7 +351,7 @@ udat_formatCalendarForFields(const UDateFormat*  format,
 
 U_CAPI UDate U_EXPORT2
 udat_parse(    const    UDateFormat*        format,
-        const    UChar*          text,
+        const    char16_t*          text,
         int32_t         textLength,
         int32_t         *parsePos,
         UErrorCode      *status)
@@ -384,7 +384,7 @@ udat_parse(    const    UDateFormat*        format,
 U_CAPI void U_EXPORT2
 udat_parseCalendar(const    UDateFormat*    format,
                             UCalendar*      calendar,
-                   const    UChar*          text,
+                   const    char16_t*          text,
                             int32_t         textLength,
                             int32_t         *parsePos,
                             UErrorCode      *status)
@@ -458,7 +458,7 @@ udat_setCalendar(UDateFormat*    fmt,
 }
 
 U_CAPI const UNumberFormat* U_EXPORT2 
-udat_getNumberFormatForField(const UDateFormat* fmt, UChar field)
+udat_getNumberFormatForField(const UDateFormat* fmt, char16_t field)
 {
     UErrorCode status = U_ZERO_ERROR;
     verifyIsSimpleDateFormat(fmt, &status);
@@ -474,7 +474,7 @@ udat_getNumberFormat(const UDateFormat* fmt)
 
 U_CAPI void U_EXPORT2 
 udat_adoptNumberFormatForFields(           UDateFormat*    fmt,
-                                    const  UChar*          fields,
+                                    const  char16_t*          fields,
                                            UNumberFormat*  numberFormatToSet,
                                            UErrorCode*     status)
 {
@@ -535,7 +535,7 @@ udat_set2DigitYearStart(    UDateFormat     *fmt,
 U_CAPI int32_t U_EXPORT2
 udat_toPattern(    const   UDateFormat     *fmt,
         UBool          localized,
-        UChar           *result,
+        char16_t        *result,
         int32_t         resultLength,
         UErrorCode      *status)
 {
@@ -577,7 +577,7 @@ udat_toPattern(    const   UDateFormat     *fmt,
 U_CAPI void U_EXPORT2
 udat_applyPattern(  UDateFormat     *format,
                     UBool          localized,
-                    const   UChar           *pattern,
+                    const   char16_t        *pattern,
                     int32_t         patternLength)
 {
     const UnicodeString pat((UBool)(patternLength == -1), pattern, patternLength);
@@ -598,7 +598,7 @@ U_CAPI int32_t U_EXPORT2
 udat_getSymbols(const   UDateFormat     *fmt,
                 UDateFormatSymbolType   type,
                 int32_t                 index,
-                UChar                   *result,
+                char16_t                *result,
                 int32_t                 resultLength,
                 UErrorCode              *status)
 {
@@ -925,7 +925,7 @@ class DateFormatSymbolsSingleSetter /* not : public UObject because all methods
 public:
     static void
         setSymbol(UnicodeString *array, int32_t count, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         if(array!=nullptr) {
             if(index>=count) {
@@ -940,182 +940,182 @@ public:
 
     static void
         setEra(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fEras, syms->fErasCount, index, value, valueLength, errorCode);
     }
 
     static void
         setEraName(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fEraNames, syms->fEraNamesCount, index, value, valueLength, errorCode);
     }
 
     static void
         setMonth(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fMonths, syms->fMonthsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setShortMonth(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fShortMonths, syms->fShortMonthsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setNarrowMonth(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fNarrowMonths, syms->fNarrowMonthsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneMonth(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneMonths, syms->fStandaloneMonthsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneShortMonth(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneShortMonths, syms->fStandaloneShortMonthsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneNarrowMonth(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneNarrowMonths, syms->fStandaloneNarrowMonthsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fWeekdays, syms->fWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setShortWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fShortWeekdays, syms->fShortWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setShorterWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fShorterWeekdays, syms->fShorterWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setNarrowWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fNarrowWeekdays, syms->fNarrowWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneWeekdays, syms->fStandaloneWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneShortWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneShortWeekdays, syms->fStandaloneShortWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneShorterWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneShorterWeekdays, syms->fStandaloneShorterWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneNarrowWeekday(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneNarrowWeekdays, syms->fStandaloneNarrowWeekdaysCount, index, value, valueLength, errorCode);
     }
 
     static void
         setQuarter(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fQuarters, syms->fQuartersCount, index, value, valueLength, errorCode);
     }
 
     static void
         setShortQuarter(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fShortQuarters, syms->fShortQuartersCount, index, value, valueLength, errorCode);
     }
 
     static void
         setNarrowQuarter(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fNarrowQuarters, syms->fNarrowQuartersCount, index, value, valueLength, errorCode);
     }
     
     static void
         setStandaloneQuarter(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneQuarters, syms->fStandaloneQuartersCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneShortQuarter(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneShortQuarters, syms->fStandaloneShortQuartersCount, index, value, valueLength, errorCode);
     }
 
     static void
         setStandaloneNarrowQuarter(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fStandaloneNarrowQuarters, syms->fStandaloneNarrowQuartersCount, index, value, valueLength, errorCode);
     }
     
     static void
         setShortYearNames(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fShortYearNames, syms->fShortYearNamesCount, index, value, valueLength, errorCode);
     }
 
     static void
         setShortZodiacNames(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fShortZodiacNames, syms->fShortZodiacNamesCount, index, value, valueLength, errorCode);
     }
 
     static void
         setAmPm(DateFormatSymbols *syms, int32_t index,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(syms->fAmPms, syms->fAmPmsCount, index, value, valueLength, errorCode);
     }
 
     static void
         setLocalPatternChars(DateFormatSymbols *syms,
-        const UChar *value, int32_t valueLength, UErrorCode &errorCode)
+        const char16_t *value, int32_t valueLength, UErrorCode &errorCode)
     {
         setSymbol(&syms->fLocalPatternChars, 1, 0, value, valueLength, errorCode);
     }
@@ -1127,7 +1127,7 @@ U_CAPI void U_EXPORT2
 udat_setSymbols(    UDateFormat             *format,
             UDateFormatSymbolType   type,
             int32_t                 index,
-            UChar                   *value,
+            char16_t                *value,
             int32_t                 valueLength,
             UErrorCode              *status)
 {
@@ -1297,7 +1297,7 @@ static void verifyIsRelativeDateFormat(const UDateFormat* fmt, UErrorCode *statu
 
 U_CAPI int32_t U_EXPORT2 
 udat_toPatternRelativeDate(const UDateFormat *fmt,
-                           UChar             *result,
+                           char16_t          *result,
                            int32_t           resultLength,
                            UErrorCode        *status)
 {
@@ -1322,7 +1322,7 @@ udat_toPatternRelativeDate(const UDateFormat *fmt,
 
 U_CAPI int32_t U_EXPORT2 
 udat_toPatternRelativeTime(const UDateFormat *fmt,
-                           UChar             *result,
+                           char16_t          *result,
                            int32_t           resultLength,
                            UErrorCode        *status)
 {
@@ -1347,9 +1347,9 @@ udat_toPatternRelativeTime(const UDateFormat *fmt,
 
 U_CAPI void U_EXPORT2 
 udat_applyPatternRelative(UDateFormat *format,
-                          const UChar *datePattern,
+                          const char16_t *datePattern,
                           int32_t     datePatternLength,
-                          const UChar *timePattern,
+                          const char16_t *timePattern,
                           int32_t     timePatternLength,
                           UErrorCode  *status)
 {
index c8094ff4c2415c3037556e48d06360e36956a9b5..a332eacc533c2a263b79c6058fcae9d693515461 100644 (file)
@@ -36,9 +36,9 @@ UPRV_FORMATTED_VALUE_CAPI_AUTO_IMPL(
 
 U_CAPI UDateIntervalFormat* U_EXPORT2
 udtitvfmt_open(const char*  locale,
-               const UChar* skeleton,
+               const char16_t* skeleton,
                int32_t      skeletonLength,
-               const UChar* tzID,
+               const char16_t* tzID,
                int32_t      tzIDLength,
                UErrorCode*  status)
 {
@@ -80,7 +80,7 @@ U_CAPI int32_t U_EXPORT2
 udtitvfmt_format(const UDateIntervalFormat* formatter,
                  UDate           fromDate,
                  UDate           toDate,
-                 UChar*          result,
+                 char16_t*          result,
                  int32_t         resultCapacity,
                  UFieldPosition* position,
                  UErrorCode*     status)
index 92f0a3994c86c8b69f36a205f6cfd1c507ac0324..07aee36882dd5a080e244202823455cc6b839ff2 100644 (file)
@@ -57,8 +57,8 @@ udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode) {
 
 U_CAPI int32_t U_EXPORT2
 udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
-                      const UChar *skeleton, int32_t length,
-                      UChar *bestPattern, int32_t capacity,
+                      const char16_t *skeleton, int32_t length,
+                      char16_t *bestPattern, int32_t capacity,
                       UErrorCode *pErrorCode) {
     return udatpg_getBestPatternWithOptions(dtpg, skeleton, length,
                                             UDATPG_MATCH_NO_OPTIONS,
@@ -67,9 +67,9 @@ udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
 
 U_CAPI int32_t U_EXPORT2
 udatpg_getBestPatternWithOptions(UDateTimePatternGenerator *dtpg,
-                                 const UChar *skeleton, int32_t length,
+                                 const char16_t *skeleton, int32_t length,
                                  UDateTimePatternMatchOptions options,
-                                 UChar *bestPattern, int32_t capacity,
+                                 char16_t *bestPattern, int32_t capacity,
                                  UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -85,8 +85,8 @@ udatpg_getBestPatternWithOptions(UDateTimePatternGenerator *dtpg,
 
 U_CAPI int32_t U_EXPORT2
 udatpg_getSkeleton(UDateTimePatternGenerator * /* dtpg */,
-                   const UChar *pattern, int32_t length,
-                   UChar *skeleton, int32_t capacity,
+                   const char16_t *pattern, int32_t length,
+                   char16_t *skeleton, int32_t capacity,
                    UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -103,8 +103,8 @@ udatpg_getSkeleton(UDateTimePatternGenerator * /* dtpg */,
 
 U_CAPI int32_t U_EXPORT2
 udatpg_getBaseSkeleton(UDateTimePatternGenerator * /* dtpg */,
-                       const UChar *pattern, int32_t length,
-                       UChar *skeleton, int32_t capacity,
+                       const char16_t *pattern, int32_t length,
+                       char16_t *skeleton, int32_t capacity,
                        UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -121,9 +121,9 @@ udatpg_getBaseSkeleton(UDateTimePatternGenerator * /* dtpg */,
 
 U_CAPI UDateTimePatternConflict U_EXPORT2
 udatpg_addPattern(UDateTimePatternGenerator *dtpg,
-                  const UChar *pattern, int32_t patternLength,
+                  const char16_t *pattern, int32_t patternLength,
                   UBool override,
-                  UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
+                  char16_t *conflictingPattern, int32_t capacity, int32_t *pLength,
                   UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return UDATPG_NO_CONFLICT;
@@ -146,12 +146,12 @@ udatpg_addPattern(UDateTimePatternGenerator *dtpg,
 U_CAPI void U_EXPORT2
 udatpg_setAppendItemFormat(UDateTimePatternGenerator *dtpg,
                            UDateTimePatternField field,
-                           const UChar *value, int32_t length) {
+                           const char16_t *value, int32_t length) {
     UnicodeString valueString((UBool)(length<0), value, length);
     ((DateTimePatternGenerator *)dtpg)->setAppendItemFormat(field, valueString);
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg,
                            UDateTimePatternField field,
                            int32_t *pLength) {
@@ -165,12 +165,12 @@ udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg,
 U_CAPI void U_EXPORT2
 udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg,
                          UDateTimePatternField field,
-                         const UChar *value, int32_t length) {
+                         const char16_t *value, int32_t length) {
     UnicodeString valueString((UBool)(length<0), value, length);
     ((DateTimePatternGenerator *)dtpg)->setAppendItemName(field, valueString);
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg,
                          UDateTimePatternField field,
                          int32_t *pLength) {
@@ -185,7 +185,7 @@ U_CAPI int32_t U_EXPORT2
 udatpg_getFieldDisplayName(const UDateTimePatternGenerator *dtpg,
                            UDateTimePatternField field,
                            UDateTimePGDisplayWidth width,
-                           UChar *fieldName, int32_t capacity,
+                           char16_t *fieldName, int32_t capacity,
                            UErrorCode *pErrorCode) {
     if (U_FAILURE(*pErrorCode))
         return -1;
@@ -202,12 +202,12 @@ udatpg_getFieldDisplayName(const UDateTimePatternGenerator *dtpg,
 
 U_CAPI void U_EXPORT2
 udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg,
-                         const UChar *dtFormat, int32_t length) {
+                         const char16_t *dtFormat, int32_t length) {
     UnicodeString dtFormatString((UBool)(length<0), dtFormat, length);
     ((DateTimePatternGenerator *)dtpg)->setDateTimeFormat(dtFormatString);
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg,
                          int32_t *pLength) {
     UErrorCode status = U_ZERO_ERROR;
@@ -217,7 +217,7 @@ udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg,
 U_CAPI void U_EXPORT2
 udatpg_setDateTimeFormatForStyle(UDateTimePatternGenerator *udtpg,
                         UDateFormatStyle style,
-                        const UChar *dateTimeFormat, int32_t length,
+                        const char16_t *dateTimeFormat, int32_t length,
                         UErrorCode *pErrorCode) {
     if (U_FAILURE(*pErrorCode)) {
         return;
@@ -230,11 +230,11 @@ udatpg_setDateTimeFormatForStyle(UDateTimePatternGenerator *udtpg,
     dtpg->setDateTimeFormat(style, dtFormatString, *pErrorCode);
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 udatpg_getDateTimeFormatForStyle(const UDateTimePatternGenerator *udtpg,
                         UDateFormatStyle style, int32_t *pLength,
                         UErrorCode *pErrorCode) {
-    static const UChar emptyString[] = { (UChar)0 };
+    static const char16_t emptyString[] = { (char16_t)0 };
     if (U_FAILURE(*pErrorCode)) {
         if (pLength !=nullptr) {
             *pLength = 0;
@@ -254,12 +254,12 @@ udatpg_getDateTimeFormatForStyle(const UDateTimePatternGenerator *udtpg,
 
 U_CAPI void U_EXPORT2
 udatpg_setDecimal(UDateTimePatternGenerator *dtpg,
-                  const UChar *decimal, int32_t length) {
+                  const char16_t *decimal, int32_t length) {
     UnicodeString decimalString((UBool)(length<0), decimal, length);
     ((DateTimePatternGenerator *)dtpg)->setDecimal(decimalString);
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 udatpg_getDecimal(const UDateTimePatternGenerator *dtpg,
                   int32_t *pLength) {
     const UnicodeString &result=((const DateTimePatternGenerator *)dtpg)->getDecimal();
@@ -271,9 +271,9 @@ udatpg_getDecimal(const UDateTimePatternGenerator *dtpg,
 
 U_CAPI int32_t U_EXPORT2
 udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
-                         const UChar *pattern, int32_t patternLength,
-                         const UChar *skeleton, int32_t skeletonLength,
-                         UChar *dest, int32_t destCapacity,
+                         const char16_t *pattern, int32_t patternLength,
+                         const char16_t *skeleton, int32_t skeletonLength,
+                         char16_t *dest, int32_t destCapacity,
                          UErrorCode *pErrorCode) {
     return udatpg_replaceFieldTypesWithOptions(dtpg, pattern, patternLength, skeleton, skeletonLength,
                                                UDATPG_MATCH_NO_OPTIONS,
@@ -282,10 +282,10 @@ udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
 
 U_CAPI int32_t U_EXPORT2
 udatpg_replaceFieldTypesWithOptions(UDateTimePatternGenerator *dtpg,
-                                    const UChar *pattern, int32_t patternLength,
-                                    const UChar *skeleton, int32_t skeletonLength,
+                                    const char16_t *pattern, int32_t patternLength,
+                                    const char16_t *skeleton, int32_t skeletonLength,
                                     UDateTimePatternMatchOptions options,
-                                    UChar *dest, int32_t destCapacity,
+                                    char16_t *dest, int32_t destCapacity,
                                     UErrorCode *pErrorCode) {
     if(U_FAILURE(*pErrorCode)) {
         return 0;
@@ -314,9 +314,9 @@ udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErr
                 pErrorCode);
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
-                             const UChar *skeleton, int32_t skeletonLength,
+                             const char16_t *skeleton, int32_t skeletonLength,
                              int32_t *pLength) {
     UnicodeString skeletonString((UBool)(skeletonLength<0), skeleton, skeletonLength);
     const UnicodeString &result=((const DateTimePatternGenerator *)dtpg)->getPatternForSkeleton(skeletonString);
index 26cd75a6bd9ff4d232bd6c3dc120d6b61ce00ebb..6f840f3fe5e04b50c07ffe81a92d57762c819d40 100644 (file)
@@ -50,11 +50,11 @@ UIterCollationIterator::handleNextCE32(UChar32 &c, UErrorCode & /*errorCode*/) {
     return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c);
 }
 
-UChar
+char16_t
 UIterCollationIterator::handleGetTrailSurrogate() {
     UChar32 trail = iter.next(&iter);
     if(!U16_IS_TRAIL(trail) && trail >= 0) { iter.previous(&iter); }
-    return (UChar)trail;
+    return (char16_t)trail;
 }
 
 UChar32
@@ -140,7 +140,7 @@ FCDUIterCollationIterator::handleNextCE32(UChar32 &c, UErrorCode &errorCode) {
     return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c);
 }
 
-UChar
+char16_t
 FCDUIterCollationIterator::handleGetTrailSurrogate() {
     if(state <= ITER_IN_FCD_SEGMENT) {
         UChar32 trail = iter.next(&iter);
@@ -149,10 +149,10 @@ FCDUIterCollationIterator::handleGetTrailSurrogate() {
         } else if(trail >= 0) {
             iter.previous(&iter);
         }
-        return (UChar)trail;
+        return (char16_t)trail;
     } else {
         U_ASSERT(pos < normalized.length());
-        UChar trail;
+        char16_t trail;
         if(U16_IS_TRAIL(trail = normalized[pos])) { ++pos; }
         return trail;
     }
index e0da353f268ba982a45c3a73af7342b7ecd83cdc..23d8562a87f742a503c6e59426f04877619cda39 100644 (file)
@@ -50,7 +50,7 @@ public:
 protected:
     virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override;
 
-    virtual UChar handleGetTrailSurrogate() override;
+    virtual char16_t handleGetTrailSurrogate() override;
 
     virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override;
 
@@ -82,7 +82,7 @@ public:
 protected:
     virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override;
 
-    virtual UChar handleGetTrailSurrogate() override;
+    virtual char16_t handleGetTrailSurrogate() override;
 
 
     virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override;
index b781ca0dfc3342d4809ca278b353f054a284781b..721905f0970cea4723014ebb7b3b698cd7331d20 100644 (file)
@@ -67,7 +67,7 @@ UPRV_FORMATTED_VALUE_CAPI_AUTO_IMPL(
 
 
 static UnicodeString* getUnicodeStrings(
-        const UChar* const strings[],
+        const char16_t* const strings[],
         const int32_t* stringLengths,
         int32_t stringCount,
         UnicodeString* length4StackBuffer,
@@ -101,10 +101,10 @@ static UnicodeString* getUnicodeStrings(
 
 U_CAPI int32_t U_EXPORT2
 ulistfmt_format(const UListFormatter* listfmt,
-                const UChar* const strings[],
+                const char16_t* const strings[],
                 const int32_t *    stringLengths,
                 int32_t            stringCount,
-                UChar*             result,
+                char16_t*             result,
                 int32_t            resultCapacity,
                 UErrorCode*        status)
 {
@@ -136,7 +136,7 @@ ulistfmt_format(const UListFormatter* listfmt,
 U_CAPI void U_EXPORT2
 ulistfmt_formatStringsToResult(
                 const UListFormatter* listfmt,
-                const UChar* const strings[],
+                const char16_t* const strings[],
                 const int32_t *    stringLengths,
                 int32_t            stringCount,
                 UFormattedList*    uresult,
index ce06406abc08f2fc5bc009ba997f86ff21ad7862..8e0687c5f6302d3ff95ac1cf4c518580aed09c14 100644 (file)
@@ -108,7 +108,7 @@ ulocdata_getExemplarSet(ULocaleData *uld, USet *fillIn,
                                                     "AuxExemplarCharacters", 
                                                     "ExemplarCharactersIndex",
                                                     "ExemplarCharactersPunctuation"};
-    const UChar *exemplarChars = nullptr;
+    const char16_t *exemplarChars = nullptr;
     int32_t len = 0;
     UErrorCode localStatus = U_ZERO_ERROR;
 
@@ -140,7 +140,7 @@ ulocdata_getExemplarSet(ULocaleData *uld, USet *fillIn,
 
 U_CAPI int32_t U_EXPORT2
 ulocdata_getDelimiter(ULocaleData *uld, ULocaleDataDelimiterType type,
-                      UChar *result, int32_t resultLength, UErrorCode *status){
+                      char16_t *result, int32_t resultLength, UErrorCode *status){
 
     static const char* const delimiterKeys[] =  {
         "quotationStart",
@@ -151,7 +151,7 @@ ulocdata_getDelimiter(ULocaleData *uld, ULocaleDataDelimiterType type,
 
     UResourceBundle *delimiterBundle;
     int32_t len = 0;
-    const UChar *delimiter = nullptr;
+    const char16_t *delimiter = nullptr;
     UErrorCode localStatus = U_ZERO_ERROR;
 
     if (U_FAILURE(*status))
@@ -277,12 +277,12 @@ ulocdata_getCLDRVersion(UVersionInfo versionArray, UErrorCode *status) {
 
 U_CAPI int32_t U_EXPORT2
 ulocdata_getLocaleDisplayPattern(ULocaleData *uld,
-                                 UChar *result,
+                                 char16_t *result,
                                  int32_t resultCapacity,
                                  UErrorCode *status) {
     UResourceBundle *patternBundle;
     int32_t len = 0;
-    const UChar *pattern = nullptr;
+    const char16_t *pattern = nullptr;
     UErrorCode localStatus = U_ZERO_ERROR;
 
     if (U_FAILURE(*status))
@@ -325,16 +325,16 @@ ulocdata_getLocaleDisplayPattern(ULocaleData *uld,
 
 U_CAPI int32_t U_EXPORT2
 ulocdata_getLocaleSeparator(ULocaleData *uld,
-                            UChar *result,
+                            char16_t *result,
                             int32_t resultCapacity,
                             UErrorCode *status)  {
     UResourceBundle *separatorBundle;
     int32_t len = 0;
-    const UChar *separator = nullptr;
+    const char16_t *separator = nullptr;
     UErrorCode localStatus = U_ZERO_ERROR;
-    UChar *p0, *p1;
-    static const UChar sub0[4] = { 0x007b, 0x0030, 0x007d , 0x0000 }; /* {0} */
-    static const UChar sub1[4] = { 0x007b, 0x0031, 0x007d , 0x0000 }; /* {1} */
+    char16_t *p0, *p1;
+    static const char16_t sub0[4] = { 0x007b, 0x0030, 0x007d , 0x0000 }; /* {0} */
+    static const char16_t sub1[4] = { 0x007b, 0x0031, 0x007d , 0x0000 }; /* {1} */
     static const int32_t subLen = 3;
 
     if (U_FAILURE(*status))
@@ -374,7 +374,7 @@ ulocdata_getLocaleSeparator(ULocaleData *uld,
     p0=u_strstr(separator, sub0);
     p1=u_strstr(separator, sub1);
     if (p0!=nullptr && p1!=nullptr && p0<=p1) {
-        separator = (const UChar *)p0 + subLen;
+        separator = (const char16_t *)p0 + subLen;
         len = static_cast<int32_t>(p1 - separator);
         /* Desired separator is no longer zero-terminated; handle that if necessary */
         if (len < resultCapacity) {
index 28d2c84505deadae66b8107273cf44427fc9be92..ea6e62e2aaf99c521cdd2074e6237a8cf9d6e507 100644 (file)
@@ -59,9 +59,9 @@ U_NAMESPACE_USE
 
 U_CAPI int32_t
 u_formatMessage(const char  *locale,
-                const UChar *pattern,
+                const char16_t *pattern,
                 int32_t     patternLength,
-                UChar       *result,
+                char16_t    *result,
                 int32_t     resultLength,
                 UErrorCode  *status,
                 ...)
@@ -81,9 +81,9 @@ u_formatMessage(const char  *locale,
 
 U_CAPI int32_t U_EXPORT2
 u_vformatMessage(   const char  *locale,
-                    const UChar *pattern,
+                    const char16_t *pattern,
                     int32_t     patternLength,
-                    UChar       *result,
+                    char16_t    *result,
                     int32_t     resultLength,
                     va_list     ap,
                     UErrorCode  *status)
@@ -98,9 +98,9 @@ u_vformatMessage(   const char  *locale,
 
 U_CAPI int32_t
 u_formatMessageWithError(const char *locale,
-                        const UChar *pattern,
+                        const char16_t *pattern,
                         int32_t     patternLength,
-                        UChar       *result,
+                        char16_t    *result,
                         int32_t     resultLength,
                         UParseError *parseError,
                         UErrorCode  *status,
@@ -121,9 +121,9 @@ u_formatMessageWithError(const char *locale,
 
 U_CAPI int32_t U_EXPORT2
 u_vformatMessageWithError(  const char  *locale,
-                            const UChar *pattern,
+                            const char16_t *pattern,
                             int32_t     patternLength,
-                            UChar       *result,
+                            char16_t    *result,
                             int32_t     resultLength,
                             UParseError *parseError,
                             va_list     ap,
@@ -144,9 +144,9 @@ u_vformatMessageWithError(  const char  *locale,
 //  3. Iterate through each formattable returned, and assign to the arguments
 U_CAPI void
 u_parseMessage( const char   *locale,
-                const UChar  *pattern,
+                const char16_t  *pattern,
                 int32_t      patternLength,
-                const UChar  *source,
+                const char16_t  *source,
                 int32_t      sourceLength,
                 UErrorCode   *status,
                 ...)
@@ -164,9 +164,9 @@ u_parseMessage( const char   *locale,
 
 U_CAPI void U_EXPORT2
 u_vparseMessage(const char  *locale,
-                const UChar *pattern,
+                const char16_t *pattern,
                 int32_t     patternLength,
-                const UChar *source,
+                const char16_t *source,
                 int32_t     sourceLength,
                 va_list     ap,
                 UErrorCode  *status)
@@ -180,9 +180,9 @@ u_vparseMessage(const char  *locale,
 
 U_CAPI void
 u_parseMessageWithError(const char  *locale,
-                        const UChar *pattern,
+                        const char16_t *pattern,
                         int32_t     patternLength,
-                        const UChar *source,
+                        const char16_t *source,
                         int32_t     sourceLength,
                         UParseError *error,
                         UErrorCode  *status,
@@ -201,9 +201,9 @@ u_parseMessageWithError(const char  *locale,
 }
 U_CAPI void U_EXPORT2
 u_vparseMessageWithError(const char  *locale,
-                         const UChar *pattern,
+                         const char16_t *pattern,
                          int32_t     patternLength,
-                         const UChar *source,
+                         const char16_t *source,
                          int32_t     sourceLength,
                          va_list     ap,
                          UParseError *error,
@@ -223,7 +223,7 @@ u_vparseMessageWithError(const char  *locale,
 
 
 U_CAPI UMessageFormat* U_EXPORT2
-umsg_open(  const UChar     *pattern,
+umsg_open(  const char16_t  *pattern,
             int32_t         patternLength,
             const  char     *locale,
             UParseError     *parseError,
@@ -311,7 +311,7 @@ umsg_getLocale(const UMessageFormat *fmt)
 
 U_CAPI void  U_EXPORT2
 umsg_applyPattern(UMessageFormat *fmt,
-                           const UChar* pattern,
+                           const char16_t* pattern,
                            int32_t patternLength,
                            UParseError* parseError,
                            UErrorCode* status)
@@ -336,7 +336,7 @@ umsg_applyPattern(UMessageFormat *fmt,
 
 U_CAPI int32_t  U_EXPORT2
 umsg_toPattern(const UMessageFormat *fmt,
-               UChar* result, 
+               char16_t* result,
                int32_t resultLength,
                UErrorCode* status)
 {
@@ -362,7 +362,7 @@ umsg_toPattern(const UMessageFormat *fmt,
 
 U_CAPI int32_t
 umsg_format(    const UMessageFormat *fmt,
-                UChar          *result,
+                char16_t       *result,
                 int32_t        resultLength,
                 UErrorCode     *status,
                 ...)
@@ -387,7 +387,7 @@ umsg_format(    const UMessageFormat *fmt,
 
 U_CAPI int32_t U_EXPORT2
 umsg_vformat(   const UMessageFormat *fmt,
-                UChar          *result,
+                char16_t       *result,
                 int32_t        resultLength,
                 va_list        ap,
                 UErrorCode     *status)
@@ -412,7 +412,7 @@ umsg_vformat(   const UMessageFormat *fmt,
     // iterate through the vararg list, and get the arguments out
     for(int32_t i = 0; i < count; ++i) {
         
-        UChar *stringVal;
+        char16_t *stringVal;
         double tDouble=0;
         int32_t tInt =0;
         int64_t tInt64 = 0;
@@ -440,7 +440,7 @@ umsg_vformat(   const UMessageFormat *fmt,
             
         case Formattable::kString:
             // For some reason, a temporary is needed
-            stringVal = va_arg(ap, UChar*);
+            stringVal = va_arg(ap, char16_t*);
             if(stringVal){
                 args[i].setString(UnicodeString(stringVal));
             }else{
@@ -483,7 +483,7 @@ umsg_vformat(   const UMessageFormat *fmt,
 
 U_CAPI void
 umsg_parse( const UMessageFormat *fmt,
-            const UChar    *source,
+            const char16_t *source,
             int32_t        sourceLength,
             int32_t        *count,
             UErrorCode     *status,
@@ -505,7 +505,7 @@ umsg_parse( const UMessageFormat *fmt,
 
 U_CAPI void U_EXPORT2
 umsg_vparse(const UMessageFormat *fmt,
-            const UChar    *source,
+            const char16_t *source,
             int32_t        sourceLength,
             int32_t        *count,
             va_list        ap,
@@ -528,7 +528,7 @@ umsg_vparse(const UMessageFormat *fmt,
     Formattable *args = ((const MessageFormat*)fmt)->parse(srcString,*count,*status);
     UDate *aDate;
     double *aDouble;
-    UChar *aString;
+    char16_t *aString;
     int32_t* aInt;
     int64_t* aInt64;
     UnicodeString temp;
@@ -574,7 +574,7 @@ umsg_vparse(const UMessageFormat *fmt,
             break;
 
         case Formattable::kString:
-            aString = va_arg(ap, UChar*);
+            aString = va_arg(ap, char16_t*);
             if(aString){
                 args[i].getString(temp);
                 len = temp.length();
@@ -602,9 +602,9 @@ umsg_vparse(const UMessageFormat *fmt,
     delete [] args;
 }
 
-#define SINGLE_QUOTE      ((UChar)0x0027)
-#define CURLY_BRACE_LEFT  ((UChar)0x007B)
-#define CURLY_BRACE_RIGHT ((UChar)0x007D)
+#define SINGLE_QUOTE      ((char16_t)0x0027)
+#define CURLY_BRACE_LEFT  ((char16_t)0x007B)
+#define CURLY_BRACE_RIGHT ((char16_t)0x007D)
 
 #define STATE_INITIAL 0
 #define STATE_SINGLE_QUOTE 1
@@ -613,9 +613,9 @@ umsg_vparse(const UMessageFormat *fmt,
 
 #define MAppend(c) if (len < destCapacity) dest[len++] = c; else len++
 
-int32_t umsg_autoQuoteApostrophe(const UChar* pattern, 
+int32_t umsg_autoQuoteApostrophe(const char16_t* pattern,
                  int32_t patternLength,
-                 UChar* dest,
+                 char16_t* dest,
                  int32_t destCapacity,
                  UErrorCode* ec)
 {
@@ -638,7 +638,7 @@ int32_t umsg_autoQuoteApostrophe(const UChar* pattern,
     }
 
     for (int i = 0; i < patternLength; ++i) {
-        UChar c = pattern[i];
+        char16_t c = pattern[i];
         switch (state) {
         case STATE_INITIAL:
             switch (c) {
index 43ef1c78f0d17da38508540cfc18098a5373f003..4c793b17d3a211fea7beb0e4778255afd7722f39 100644 (file)
 
 /* global variables used by the C and C++ message formatting API. */
 
-extern const UChar  *g_umsgTypeList[];
-extern const UChar  *g_umsgModifierList[];
-extern const UChar  *g_umsgDateModifierList[];
+extern const char16_t  *g_umsgTypeList[];
+extern const char16_t  *g_umsgModifierList[];
+extern const char16_t  *g_umsgDateModifierList[];
 extern const int32_t g_umsgListLength;
 
-extern const UChar g_umsg_number[];
-extern const UChar g_umsg_date[];
-extern const UChar g_umsg_time[];
-extern const UChar g_umsg_choice[];
+extern const char16_t g_umsg_number[];
+extern const char16_t g_umsg_date[];
+extern const char16_t g_umsg_time[];
+extern const char16_t g_umsg_choice[];
 
-extern const UChar g_umsg_currency[];
-extern const UChar g_umsg_percent[];
-extern const UChar g_umsg_integer[];
+extern const char16_t g_umsg_currency[];
+extern const char16_t g_umsg_percent[];
+extern const char16_t g_umsg_integer[];
 
-extern const UChar g_umsg_short[];
-extern const UChar g_umsg_medium[];
-extern const UChar g_umsg_long[];
-extern const UChar g_umsg_full[];
+extern const char16_t g_umsg_short[];
+extern const char16_t g_umsg_medium[];
+extern const char16_t g_umsg_long[];
+extern const char16_t g_umsg_full[];
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 
index 33edbaee01b91c6fdbfc5357c78aae4c096687df..cce191ca62e7e328f6447de8d924ccac5e5e688b 100644 (file)
@@ -26,47 +26,47 @@ U_NAMESPACE_BEGIN
 /**
  * Special character marking the end of the spec[] array.
  */
-static const UChar END = 0xFFFF;
+static const char16_t END = 0xFFFF;
 
 // Unicode: "U+10FFFF" hex, min=4, max=6
-static const UChar SPEC_Unicode[] = {
+static const char16_t SPEC_Unicode[] = {
     2, 0, 16, 4, 6, 85/*U*/, 43/*+*/,
     END
 };
 
 // Java: "\\uFFFF" hex, min=4, max=4
-static const UChar SPEC_Java[] = {
+static const char16_t SPEC_Java[] = {
     2, 0, 16, 4, 4, 92/*\*/, 117/*u*/,
     END
 };
 
 // C: "\\uFFFF" hex, min=4, max=4; \\U0010FFFF hex, min=8, max=8
-static const UChar SPEC_C[] = {
+static const char16_t SPEC_C[] = {
     2, 0, 16, 4, 4, 92/*\*/, 117/*u*/,
     2, 0, 16, 8, 8, 92/*\*/, 85/*U*/,
     END
 };
 
 // XML: "&#x10FFFF;" hex, min=1, max=6
-static const UChar SPEC_XML[] = {
+static const char16_t SPEC_XML[] = {
     3, 1, 16, 1, 6, 38/*&*/, 35/*#*/, 120/*x*/, 59/*;*/,
     END
 };
 
 // XML10: "&#1114111;" dec, min=1, max=7 (not really "Hex-Any")
-static const UChar SPEC_XML10[] = {
+static const char16_t SPEC_XML10[] = {
     2, 1, 10, 1, 7, 38/*&*/, 35/*#*/, 59/*;*/,
     END
 };
 
 // Perl: "\\x{263A}" hex, min=1, max=6
-static const UChar SPEC_Perl[] = {
+static const char16_t SPEC_Perl[] = {
     3, 1, 16, 1, 6, 92/*\*/, 120/*x*/, 123/*{*/, 125/*}*/,
     END
 };
 
 // All: Java, C, Perl, XML, XML10, Unicode
-static const UChar SPEC_Any[] = {
+static const char16_t SPEC_Any[] = {
     2, 0, 16, 4, 6, 85/*U*/, 43/*+*/,                      // Unicode
     2, 0, 16, 4, 4, 92/*\*/, 117/*u*/,                     // Java
     2, 0, 16, 8, 8, 92/*\*/, 85/*U*/,                      // C (surrogates)
@@ -78,13 +78,13 @@ static const UChar SPEC_Any[] = {
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UnescapeTransliterator)
 
-static UChar* copySpec(const UChar* spec) {
+static char16_t* copySpec(const char16_t* spec) {
     int32_t len = 0;
     while (spec[len] != END) {
         ++len;
     }
     ++len;
-    UChar *result = (UChar *)uprv_malloc(len*sizeof(UChar));
+    char16_t *result = (char16_t *)uprv_malloc(len*sizeof(char16_t));
     // Check for memory allocation error. 
     if (result != nullptr) {
        uprv_memcpy(result, spec, (size_t)len*sizeof(result[0]));
@@ -143,7 +143,7 @@ void UnescapeTransliterator::registerIDs() {
  * Constructor.  Takes the encoded spec array.
  */
 UnescapeTransliterator::UnescapeTransliterator(const UnicodeString& newID,
-                                               const UChar *newSpec) :
+                                               const char16_t *newSpec) :
     Transliterator(newID, nullptr)
 {
     this->spec = copySpec(newSpec);
@@ -209,7 +209,7 @@ void UnescapeTransliterator::handleTransliterate(Replaceable& text, UTransPositi
                         break;
                     }
                 }
-                UChar c = text.charAt(s++);
+                char16_t c = text.charAt(s++);
                 if (c != spec[ipat + i]) {
                     match = false;
                     break;
@@ -251,7 +251,7 @@ void UnescapeTransliterator::handleTransliterate(Replaceable& text, UTransPositi
                             match = false;
                             break;
                         }
-                        UChar c = text.charAt(s++);
+                        char16_t c = text.charAt(s++);
                         if (c != spec[ipat + prefixLen + i]) {
                             match = false;
                             break;
index fdfe21c1b6072d585c80418495aba39077735d99..3bea2780827cba30b666ce1ef44b484a68532e4d 100644 (file)
@@ -46,7 +46,7 @@ class UnescapeTransliterator : public Transliterator {
      * and suffix.  The end is marked by a header of length one
      * consisting of the character END.
      */
-    UChar* spec; // owned; may not be nullptr
+    char16_t* spec; // owned; may not be nullptr
 
  public:
 
@@ -62,7 +62,7 @@ class UnescapeTransliterator : public Transliterator {
      * @param spec the encoded spec array
      */
     UnescapeTransliterator(const UnicodeString& ID,
-                           const UChar *spec);
+                           const char16_t *spec);
 
     /**
      * Copy constructor.
index 188ca29031e569f63b565450db698df4818831c8..727f8953dbbfebe8def4e5c510ae796db9a97638 100644 (file)
@@ -26,8 +26,8 @@ U_NAMESPACE_BEGIN
 
 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UnicodeNameTransliterator)
 
-static const UChar OPEN_DELIM[] = {92,78,123,0}; // "\N{"
-static const UChar CLOSE_DELIM  = 125; // "}"
+static const char16_t OPEN_DELIM[] = {92,78,123,0}; // "\N{"
+static const char16_t CLOSE_DELIM  = 125; // "}"
 #define OPEN_DELIM_LEN 3
 
 /**
index c0a94c42bc68e1b4dc42196242efb001df9e962a..6b79c99000e774b1345d43efaa666bc3db9bcd05 100644 (file)
@@ -305,7 +305,7 @@ public:
      *
      * @internal
      */
-    void setCurrency(const UChar* currency, UErrorCode& status);
+    void setCurrency(const char16_t* currency, UErrorCode& status);
 #endif  // U_HIDE_INTERNAL_API
 
     /**
index eacfa03fbf7e80ce727f50b7448640aefdc29178..5fa17567a1001188b0be8e81a49b58058b858ca3 100644 (file)
@@ -205,11 +205,11 @@ class UnitPreferencesSink : public ResourceSink {
                         for (int32_t i = 0; unitPref.getKeyAndValue(i, key, value); ++i) {
                             if (uprv_strcmp(key, "unit") == 0) {
                                 int32_t length;
-                                const UChar *u = value.getString(length, status);
+                                const char16_t *u = value.getString(length, status);
                                 up->unit.appendInvariantChars(u, length, status);
                             } else if (uprv_strcmp(key, "geq") == 0) {
                                 int32_t length;
-                                const UChar *g = value.getString(length, status);
+                                const char16_t *g = value.getString(length, status);
                                 CharString geq;
                                 geq.appendInvariantChars(g, length, status);
                                 DecimalQuantity dq;
index 77c12088c9a9b1a758d68853041ea67cf99738b7..fad7cb8792924ca04bad3c20224c446551551a56 100644 (file)
@@ -39,7 +39,7 @@ U_NAMESPACE_USE
 
 U_CAPI UNumberFormat* U_EXPORT2
 unum_open(  UNumberFormatStyle    style,  
-            const    UChar*    pattern,
+            const    char16_t*    pattern,
             int32_t            patternLength,
             const    char*     locale,
             UParseError*       parseErr,
@@ -175,7 +175,7 @@ unum_clone(const UNumberFormat *fmt,
 U_CAPI int32_t U_EXPORT2
 unum_format(    const    UNumberFormat*    fmt,
         int32_t           number,
-        UChar*            result,
+        char16_t*            result,
         int32_t           resultLength,
         UFieldPosition    *pos,
         UErrorCode*       status)
@@ -186,7 +186,7 @@ unum_format(    const    UNumberFormat*    fmt,
 U_CAPI int32_t U_EXPORT2
 unum_formatInt64(const UNumberFormat* fmt,
         int64_t         number,
-        UChar*          result,
+        char16_t*          result,
         int32_t         resultLength,
         UFieldPosition *pos,
         UErrorCode*     status)
@@ -219,7 +219,7 @@ unum_formatInt64(const UNumberFormat* fmt,
 U_CAPI int32_t U_EXPORT2
 unum_formatDouble(    const    UNumberFormat*  fmt,
             double          number,
-            UChar*          result,
+            char16_t*          result,
             int32_t         resultLength,
             UFieldPosition  *pos, /* 0 if ignore */
             UErrorCode*     status)
@@ -252,7 +252,7 @@ unum_formatDouble(    const    UNumberFormat*  fmt,
 U_CAPI int32_t U_EXPORT2
 unum_formatDoubleForFields(const UNumberFormat* format,
                            double number,
-                           UChar* result,
+                           char16_t* result,
                            int32_t resultLength,
                            UFieldPositionIterator* fpositer,
                            UErrorCode* status)
@@ -281,7 +281,7 @@ U_CAPI int32_t U_EXPORT2
 unum_formatDecimal(const    UNumberFormat*  fmt,
             const char *    number,
             int32_t         length,
-            UChar*          result,
+            char16_t*          result,
             int32_t         resultLength,
             UFieldPosition  *pos, /* 0 if ignore */
             UErrorCode*     status) {
@@ -324,8 +324,8 @@ unum_formatDecimal(const    UNumberFormat*  fmt,
 U_CAPI int32_t U_EXPORT2 
 unum_formatDoubleCurrency(const UNumberFormat* fmt,
                           double number,
-                          UChar* currency,
-                          UChar* result,
+                          char16_t* currency,
+                          char16_t* result,
                           int32_t resultLength,
                           UFieldPosition* pos, /* ignored if 0 */
                           UErrorCode* status) {
@@ -362,7 +362,7 @@ unum_formatDoubleCurrency(const UNumberFormat* fmt,
 static void
 parseRes(Formattable& res,
          const   UNumberFormat*  fmt,
-         const   UChar*          text,
+         const   char16_t*          text,
          int32_t         textLength,
          int32_t         *parsePos /* 0 = start */,
          UErrorCode      *status)
@@ -390,7 +390,7 @@ parseRes(Formattable& res,
 
 U_CAPI int32_t U_EXPORT2
 unum_parse(    const   UNumberFormat*  fmt,
-        const   UChar*          text,
+        const   char16_t*          text,
         int32_t         textLength,
         int32_t         *parsePos /* 0 = start */,
         UErrorCode      *status)
@@ -402,7 +402,7 @@ unum_parse(    const   UNumberFormat*  fmt,
 
 U_CAPI int64_t U_EXPORT2
 unum_parseInt64(    const   UNumberFormat*  fmt,
-        const   UChar*          text,
+        const   char16_t*          text,
         int32_t         textLength,
         int32_t         *parsePos /* 0 = start */,
         UErrorCode      *status)
@@ -414,7 +414,7 @@ unum_parseInt64(    const   UNumberFormat*  fmt,
 
 U_CAPI double U_EXPORT2
 unum_parseDouble(    const   UNumberFormat*  fmt,
-            const   UChar*          text,
+            const   char16_t*          text,
             int32_t         textLength,
             int32_t         *parsePos /* 0 = start */,
             UErrorCode      *status)
@@ -426,7 +426,7 @@ unum_parseDouble(    const   UNumberFormat*  fmt,
 
 U_CAPI int32_t U_EXPORT2
 unum_parseDecimal(const UNumberFormat*  fmt,
-            const UChar*    text,
+            const char16_t*    text,
             int32_t         textLength,
             int32_t         *parsePos /* 0 = start */,
             char            *outBuf,
@@ -459,10 +459,10 @@ unum_parseDecimal(const UNumberFormat*  fmt,
 
 U_CAPI double U_EXPORT2
 unum_parseDoubleCurrency(const UNumberFormat* fmt,
-                         const UChar* text,
+                         const char16_t* text,
                          int32_t textLength,
                          int32_t* parsePos, /* 0 = start */
-                         UChar* currency,
+                         char16_t* currency,
                          UErrorCode* status) {
     double doubleVal = 0.0;
     currency[0] = 0;
@@ -641,7 +641,7 @@ unum_setDoubleAttribute(    UNumberFormat*          fmt,
 U_CAPI int32_t U_EXPORT2
 unum_getTextAttribute(const UNumberFormat*  fmt,
             UNumberFormatTextAttribute      tag,
-            UChar*                          result,
+            char16_t*                          result,
             int32_t                         resultLength,
             UErrorCode*                     status)
 {
@@ -696,7 +696,7 @@ unum_getTextAttribute(const UNumberFormat*  fmt,
             int32_t count = rbnf->getNumberOfRuleSetNames();
             for (int i = 0; i < count; ++i) {
                 res += rbnf->getRuleSetName(i);
-                res += (UChar)0x003b; // semicolon
+                res += (char16_t)0x003b; // semicolon
             }
         } else {
             *status = U_UNSUPPORTED_ERROR;
@@ -710,7 +710,7 @@ unum_getTextAttribute(const UNumberFormat*  fmt,
 U_CAPI void U_EXPORT2
 unum_setTextAttribute(    UNumberFormat*                    fmt,
             UNumberFormatTextAttribute      tag,
-            const    UChar*                            newValue,
+            const    char16_t*                            newValue,
             int32_t                            newValueLength,
             UErrorCode                        *status)
 {
@@ -764,7 +764,7 @@ unum_setTextAttribute(    UNumberFormat*                    fmt,
 U_CAPI int32_t U_EXPORT2
 unum_toPattern(    const    UNumberFormat*          fmt,
         UBool                  isPatternLocalized,
-        UChar*                  result,
+        char16_t*                  result,
         int32_t                 resultLength,
         UErrorCode*             status)
 {
@@ -796,7 +796,7 @@ unum_toPattern(    const    UNumberFormat*          fmt,
 U_CAPI int32_t U_EXPORT2
 unum_getSymbol(const UNumberFormat *fmt,
                UNumberFormatSymbol symbol,
-               UChar *buffer,
+               char16_t *buffer,
                int32_t size,
                UErrorCode *status)
 {
@@ -823,7 +823,7 @@ unum_getSymbol(const UNumberFormat *fmt,
 U_CAPI void U_EXPORT2
 unum_setSymbol(UNumberFormat *fmt,
                UNumberFormatSymbol symbol,
-               const UChar *value,
+               const char16_t *value,
                int32_t length,
                UErrorCode *status)
 {
@@ -850,7 +850,7 @@ unum_setSymbol(UNumberFormat *fmt,
 U_CAPI void U_EXPORT2
 unum_applyPattern(  UNumberFormat  *fmt,
                     UBool          localized,
-                    const UChar    *pattern,
+                    const char16_t *pattern,
                     int32_t        patternLength,
                     UParseError    *parseError,
                     UErrorCode*    status)
@@ -867,7 +867,7 @@ unum_applyPattern(  UNumberFormat  *fmt,
     }
     
     int32_t len = (patternLength == -1 ? u_strlen(pattern) : patternLength);
-    const UnicodeString pat((UChar*)pattern, len, len);
+    const UnicodeString pat((char16_t*)pattern, len, len);
 
     // Verify if the object passed is a DecimalFormat object
     NumberFormat* nf = reinterpret_cast<NumberFormat*>(fmt);
@@ -920,7 +920,7 @@ unum_getContext(const UNumberFormat *fmt, UDisplayContextType type, UErrorCode*
 U_CAPI UFormattable * U_EXPORT2
 unum_parseToUFormattable(const UNumberFormat* fmt,
                          UFormattable *result,
-                         const UChar* text,
+                         const char16_t* text,
                          int32_t textLength,
                          int32_t* parsePos, /* 0 = start */
                          UErrorCode* status) {
@@ -944,7 +944,7 @@ unum_parseToUFormattable(const UNumberFormat* fmt,
 U_CAPI int32_t U_EXPORT2
 unum_formatUFormattable(const UNumberFormat* fmt,
                         const UFormattable *number,
-                        UChar *result,
+                        char16_t *result,
                         int32_t resultLength,
                         UFieldPosition *pos, /* ignored if 0 */
                         UErrorCode *status) {
index 21898c23cd75544d126a0aabe432b119da314390..9a9fa12e2f4b1f2fc335e7bb772b643101d9dc0f 100644 (file)
@@ -73,7 +73,7 @@ unumsys_isAlgorithmic(const UNumberingSystem *unumsys)
 }
 
 U_CAPI int32_t U_EXPORT2
-unumsys_getDescription(const UNumberingSystem *unumsys, UChar *result,
+unumsys_getDescription(const UNumberingSystem *unumsys, char16_t *result,
                        int32_t resultLength, UErrorCode *status)
 {
     if (U_FAILURE(*status)) {
index 270fd6ccab08dc213cb3c23917f0d7ce462a1599..9c473128119e43981ae12023d8fd982200095735 100644 (file)
@@ -80,7 +80,7 @@ uplrules_close(UPluralRules *uplrules)
 U_CAPI int32_t U_EXPORT2
 uplrules_select(const UPluralRules *uplrules,
                 double number,
-                UChar *keyword, int32_t capacity,
+                char16_t *keyword, int32_t capacity,
                 UErrorCode *status)
 {
     if (U_FAILURE(*status)) {
@@ -97,7 +97,7 @@ uplrules_select(const UPluralRules *uplrules,
 U_CAPI int32_t U_EXPORT2
 uplrules_selectFormatted(const UPluralRules *uplrules,
                 const UFormattedNumber* number,
-                UChar *keyword, int32_t capacity,
+                char16_t *keyword, int32_t capacity,
                 UErrorCode *status)
 {
     if (U_FAILURE(*status)) {
@@ -119,7 +119,7 @@ uplrules_selectFormatted(const UPluralRules *uplrules,
 U_CAPI int32_t U_EXPORT2
 uplrules_selectForRange(const UPluralRules *uplrules,
                 const UFormattedNumberRange* urange,
-                UChar *keyword, int32_t capacity,
+                char16_t *keyword, int32_t capacity,
                 UErrorCode *status)
 {
     if (U_FAILURE(*status)) {
@@ -139,7 +139,7 @@ U_CAPI int32_t U_EXPORT2
 uplrules_selectWithFormat(const UPluralRules *uplrules,
                           double number,
                           const UNumberFormat *fmt,
-                          UChar *keyword, int32_t capacity,
+                          char16_t *keyword, int32_t capacity,
                           UErrorCode *status)
 {
     if (U_FAILURE(*status)) {
index 6a8cab9c86a0f9259be5f132b8ae7e88000a3306..3ab7b683a439c4d8309e37bb4ed01d71d8940757 100644 (file)
@@ -38,10 +38,10 @@ public:
     int32_t           fMagic;
     RegexPattern     *fPat;
     u_atomic_int32_t *fPatRefCount;
-    UChar            *fPatString;
+    char16_t         *fPatString;
     int32_t           fPatStringLen;
     RegexMatcher     *fMatcher;
-    const UChar      *fText;         // Text from setText()
+    const char16_t   *fText;         // Text from setText()
     int32_t           fTextLength;   // Length provided by user with setText(), which
                                      //  may be -1.
     UBool             fOwnsText;
@@ -106,7 +106,7 @@ static UBool validateRE(const RegularExpression *re, UBool requiresText, UErrorC
 //
 //----------------------------------------------------------------------------------------
 U_CAPI URegularExpression *  U_EXPORT2
-uregex_open( const  UChar          *pattern,
+uregex_open( const  char16_t       *pattern,
                     int32_t         patternLength,
                     uint32_t        flags,
                     UParseError    *pe,
@@ -126,7 +126,7 @@ uregex_open( const  UChar          *pattern,
 
     RegularExpression  *re     = new RegularExpression;
     u_atomic_int32_t   *refC   = (u_atomic_int32_t *)uprv_malloc(sizeof(int32_t));
-    UChar              *patBuf = (UChar *)uprv_malloc(sizeof(UChar)*(actualPatLen+1));
+    char16_t           *patBuf = (char16_t *)uprv_malloc(sizeof(char16_t)*(actualPatLen+1));
     if (re == nullptr || refC == nullptr || patBuf == nullptr) {
         *status = U_MEMORY_ALLOCATION_ERROR;
         delete re;
@@ -210,7 +210,7 @@ uregex_openUText(UText          *pattern,
     int32_t pattern16Length = utext_extract(pattern, 0, patternNativeLength, nullptr, 0, &lengthStatus);
 
     u_atomic_int32_t   *refC   = (u_atomic_int32_t *)uprv_malloc(sizeof(int32_t));
-    UChar              *patBuf = (UChar *)uprv_malloc(sizeof(UChar)*(pattern16Length+1));
+    char16_t           *patBuf = (char16_t *)uprv_malloc(sizeof(char16_t)*(pattern16Length+1));
     if (re == nullptr || refC == nullptr || patBuf == nullptr) {
         *status = U_MEMORY_ALLOCATION_ERROR;
         delete re;
@@ -319,7 +319,7 @@ uregex_clone(const URegularExpression *source2, UErrorCode *status)  {
 //    uregex_pattern
 //
 //------------------------------------------------------------------------------
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 uregex_pattern(const  URegularExpression *regexp2,
                       int32_t            *patLength,
                       UErrorCode         *status)  {
@@ -371,7 +371,7 @@ uregex_flags(const URegularExpression *regexp2, UErrorCode *status)  {
 //------------------------------------------------------------------------------
 U_CAPI void U_EXPORT2
 uregex_setText(URegularExpression *regexp2,
-               const UChar        *text,
+               const char16_t     *text,
                int32_t             textLength,
                UErrorCode         *status)  {
     RegularExpression *regexp = (RegularExpression*)regexp2;
@@ -433,7 +433,7 @@ uregex_setUText(URegularExpression *regexp2,
 //    uregex_getText
 //
 //------------------------------------------------------------------------------
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 uregex_getText(URegularExpression *regexp2,
                int32_t            *textLength,
                UErrorCode         *status)  {
@@ -453,7 +453,7 @@ uregex_getText(URegularExpression *regexp2,
         } else {
             UErrorCode lengthStatus = U_ZERO_ERROR;
             regexp->fTextLength = utext_extract(inputText, 0, inputNativeLength, nullptr, 0, &lengthStatus); // buffer overflow error
-            UChar *inputChars = (UChar *)uprv_malloc(sizeof(UChar)*(regexp->fTextLength+1));
+            char16_t *inputChars = (char16_t *)uprv_malloc(sizeof(char16_t)*(regexp->fTextLength+1));
 
             utext_extract(inputText, 0, inputNativeLength, inputChars, regexp->fTextLength+1, status);
             regexp->fText = inputChars;
@@ -634,7 +634,7 @@ uregex_groupCount(URegularExpression *regexp2,
 //------------------------------------------------------------------------------
 int32_t
 uregex_groupNumberFromName(URegularExpression *regexp2,
-                           const UChar        *groupName,
+                           const char16_t     *groupName,
                            int32_t             nameLength,
                            UErrorCode          *status) {
     RegularExpression *regexp = (RegularExpression*)regexp2;
@@ -665,7 +665,7 @@ uregex_groupNumberFromCName(URegularExpression *regexp2,
 U_CAPI int32_t U_EXPORT2
 uregex_group(URegularExpression *regexp2,
              int32_t             groupNum,
-             UChar              *dest,
+             char16_t           *dest,
              int32_t             destCapacity,
              UErrorCode          *status)  {
     RegularExpression *regexp = (RegularExpression*)regexp2;
@@ -1149,9 +1149,9 @@ uregex_getFindProgressCallback(const URegularExpression          *regexp2,
 //------------------------------------------------------------------------------
 U_CAPI int32_t U_EXPORT2
 uregex_replaceAll(URegularExpression    *regexp2,
-                  const UChar           *replacementText,
+                  const char16_t        *replacementText,
                   int32_t                replacementLength,
-                  UChar                 *destBuf,
+                  char16_t              *destBuf,
                   int32_t                destCapacity,
                   UErrorCode            *status)  {
     RegularExpression *regexp = (RegularExpression*)regexp2;
@@ -1223,9 +1223,9 @@ uregex_replaceAllUText(URegularExpression    *regexp2,
 //------------------------------------------------------------------------------
 U_CAPI int32_t U_EXPORT2
 uregex_replaceFirst(URegularExpression  *regexp2,
-                    const UChar         *replacementText,
+                    const char16_t      *replacementText,
                     int32_t              replacementLength,
-                    UChar               *destBuf,
+                    char16_t            *destBuf,
                     int32_t              destCapacity,
                     UErrorCode          *status)  {
     RegularExpression *regexp = (RegularExpression*)regexp2;
@@ -1291,22 +1291,22 @@ U_NAMESPACE_BEGIN
 class RegexCImpl {
  public:
    inline static  int32_t appendReplacement(RegularExpression    *regexp,
-                      const UChar           *replacementText,
+                      const char16_t        *replacementText,
                       int32_t                replacementLength,
-                      UChar                **destBuf,
+                      char16_t             **destBuf,
                       int32_t               *destCapacity,
                       UErrorCode            *status);
 
    inline static int32_t appendTail(RegularExpression    *regexp,
-        UChar                **destBuf,
+        char16_t             **destBuf,
         int32_t               *destCapacity,
         UErrorCode            *status);
 
     inline static int32_t split(RegularExpression    *regexp,
-        UChar                 *destBuf,
+        char16_t              *destBuf,
         int32_t                destCapacity,
         int32_t               *requiredCapacity,
-        UChar                 *destFields[],
+        char16_t              *destFields[],
         int32_t                destFieldsCapacity,
         UErrorCode            *status);
 };
@@ -1315,17 +1315,17 @@ U_NAMESPACE_END
 
 
 
-static const UChar BACKSLASH  = 0x5c;
-static const UChar DOLLARSIGN = 0x24;
-static const UChar LEFTBRACKET = 0x7b;
-static const UChar RIGHTBRACKET = 0x7d;
+static const char16_t BACKSLASH  = 0x5c;
+static const char16_t DOLLARSIGN = 0x24;
+static const char16_t LEFTBRACKET = 0x7b;
+static const char16_t RIGHTBRACKET = 0x7d;
 
 //
 //  Move a character to an output buffer, with bounds checking on the index.
 //      Index advances even if capacity is exceeded, for preflight size computations.
 //      This little sequence is used a LOT.
 //
-static inline void appendToBuf(UChar c, int32_t *idx, UChar *buf, int32_t bufCapacity) {
+static inline void appendToBuf(char16_t c, int32_t *idx, char16_t *buf, int32_t bufCapacity) {
     if (*idx < bufCapacity) {
         buf[*idx] = c;
     }
@@ -1337,9 +1337,9 @@ static inline void appendToBuf(UChar c, int32_t *idx, UChar *buf, int32_t bufCap
 //  appendReplacement, the actual implementation.
 //
 int32_t RegexCImpl::appendReplacement(RegularExpression    *regexp,
-                                      const UChar           *replacementText,
+                                      const char16_t        *replacementText,
                                       int32_t                replacementLength,
-                                      UChar                **destBuf,
+                                      char16_t             **destBuf,
                                       int32_t               *destCapacity,
                                       UErrorCode            *status)  {
 
@@ -1372,7 +1372,7 @@ int32_t RegexCImpl::appendReplacement(RegularExpression    *regexp,
         return 0;
     }
 
-    UChar    *dest             = *destBuf;
+    char16_t *dest             = *destBuf;
     int32_t   capacity         = *destCapacity;
     int32_t   destIdx          =  0;
     int32_t   i;
@@ -1412,7 +1412,7 @@ int32_t RegexCImpl::appendReplacement(RegularExpression    *regexp,
     // scan the replacement text, looking for substitutions ($n) and \escapes.
     int32_t  replIdx = 0;
     while (replIdx < replacementLength && U_SUCCESS(*status)) {
-        UChar  c = replacementText[replIdx];
+        char16_t  c = replacementText[replIdx];
         replIdx++;
         if (c != DOLLARSIGN && c != BACKSLASH) {
             // Common case, no substitution, no escaping,
@@ -1442,7 +1442,7 @@ int32_t RegexCImpl::appendReplacement(RegularExpression    *regexp,
 
                 if (escapedChar != (UChar32)0xFFFFFFFF) {
                     if (escapedChar <= 0xffff) {
-                        appendToBuf((UChar)escapedChar, &destIdx, dest, capacity);
+                        appendToBuf((char16_t)escapedChar, &destIdx, dest, capacity);
                     } else {
                         appendToBuf(U16_LEAD(escapedChar), &destIdx, dest, capacity);
                         appendToBuf(U16_TRAIL(escapedChar), &destIdx, dest, capacity);
@@ -1585,9 +1585,9 @@ int32_t RegexCImpl::appendReplacement(RegularExpression    *regexp,
 //
 U_CAPI int32_t U_EXPORT2
 uregex_appendReplacement(URegularExpression    *regexp2,
-                         const UChar           *replacementText,
+                         const char16_t        *replacementText,
                          int32_t                replacementLength,
-                         UChar                **destBuf,
+                         char16_t             **destBuf,
                          int32_t               *destCapacity,
                          UErrorCode            *status) {
 
@@ -1615,7 +1615,7 @@ uregex_appendReplacementUText(URegularExpression    *regexp2,
 //
 //------------------------------------------------------------------------------
 int32_t RegexCImpl::appendTail(RegularExpression    *regexp,
-                               UChar                **destBuf,
+                               char16_t             **destBuf,
                                int32_t               *destCapacity,
                                UErrorCode            *status)
 {
@@ -1645,7 +1645,7 @@ int32_t RegexCImpl::appendTail(RegularExpression    *regexp,
 
     int32_t  destIdx     = 0;
     int32_t  destCap     = *destCapacity;
-    UChar    *dest       = *destBuf;
+    char16_t *dest       = *destBuf;
 
     if (regexp->fText != nullptr) {
         int32_t srcIdx;
@@ -1665,7 +1665,7 @@ int32_t RegexCImpl::appendTail(RegularExpression    *regexp,
             if (srcIdx == regexp->fTextLength) {
                 break;
             }
-            UChar c = regexp->fText[srcIdx];
+            char16_t c = regexp->fText[srcIdx];
             if (c == 0 && regexp->fTextLength == -1) {
                 regexp->fTextLength = srcIdx;
                 break;
@@ -1741,7 +1741,7 @@ int32_t RegexCImpl::appendTail(RegularExpression    *regexp,
 //
 U_CAPI int32_t U_EXPORT2
 uregex_appendTail(URegularExpression    *regexp2,
-                  UChar                **destBuf,
+                  char16_t             **destBuf,
                   int32_t               *destCapacity,
                   UErrorCode            *status)  {
     RegularExpression *regexp = (RegularExpression*)regexp2;
@@ -1770,16 +1770,16 @@ uregex_appendTailUText(URegularExpression    *regexp2,
 //
 //------------------------------------------------------------------------------
 #if 0
-static void copyString(UChar        *destBuffer,    //  Destination buffer.
+static void copyString(char16_t     *destBuffer,    //  Destination buffer.
                        int32_t       destCapacity,  //  Total capacity of dest buffer
                        int32_t      *destIndex,     //  Index into dest buffer.  Updated on return.
                                                     //    Update not clipped to destCapacity.
-                       const UChar  *srcPtr,        //  Pointer to source string
+                       const char16_t  *srcPtr,        //  Pointer to source string
                        int32_t       srcLen)        //  Source string len.
 {
     int32_t  si;
     int32_t  di = *destIndex;
-    UChar    c;
+    char16_t c;
 
     for (si=0; si<srcLen;  si++) {
         c = srcPtr[si];
@@ -1805,10 +1805,10 @@ static void copyString(UChar        *destBuffer,    //  Destination buffer.
 //
 //------------------------------------------------------------------------------
 int32_t RegexCImpl::split(RegularExpression     *regexp,
-                          UChar                 *destBuf,
+                          char16_t              *destBuf,
                           int32_t                destCapacity,
                           int32_t               *requiredCapacity,
-                          UChar                 *destFields[],
+                          char16_t              *destFields[],
                           int32_t                destFieldsCapacity,
                           UErrorCode            *status) {
     //
@@ -1941,10 +1941,10 @@ int32_t RegexCImpl::split(RegularExpression     *regexp,
 //
 U_CAPI int32_t U_EXPORT2
 uregex_split(URegularExpression      *regexp2,
-             UChar                   *destBuf,
+             char16_t                *destBuf,
              int32_t                  destCapacity,
              int32_t                 *requiredCapacity,
-             UChar                   *destFields[],
+             char16_t                *destFields[],
              int32_t                  destFieldsCapacity,
              UErrorCode              *status) {
     RegularExpression *regexp = (RegularExpression*)regexp2;
index 39f76a1b98512d47ee994b12b1a545494cbed903..a2cdfc0ea59d3beb60d91eb1eb36eb2f0eefff87 100644 (file)
@@ -106,10 +106,10 @@ inline void initializeFCD(UErrorCode *status)
 * @return fcd value
 */
 static
-uint16_t getFCD(const UChar   *str, int32_t *offset,
+uint16_t getFCD(const char16_t   *str, int32_t *offset,
                              int32_t  strlength)
 {
-    const UChar *temp = str + *offset;
+    const char16_t *temp = str + *offset;
     uint16_t    result = g_nfcImpl->nextFCD16(temp, str + strlength);
     *offset = (int32_t)(temp - str);
     return result;
@@ -403,7 +403,7 @@ inline void initializePattern(UStringSearch *strsrch, UErrorCode *status)
     if (U_FAILURE(*status)) { return; }
 
           UPattern   *pattern     = &(strsrch->pattern);
-    const UChar      *patterntext = pattern->text;
+    const char16_t   *patterntext = pattern->text;
           int32_t     length      = pattern->textLength;
           int32_t index       = 0;
 
@@ -538,9 +538,9 @@ inline UBool checkIdentical(const UStringSearch *strsrch, int32_t start, int32_t
 
 // constructors and destructor -------------------------------------------
 
-U_CAPI UStringSearch * U_EXPORT2 usearch_open(const UChar *pattern,
+U_CAPI UStringSearch * U_EXPORT2 usearch_open(const char16_t *pattern,
                                           int32_t         patternlength,
-                                    const UChar          *text,
+                                    const char16_t       *text,
                                           int32_t         textlength,
                                     const char           *locale,
                                           UBreakIterator *breakiter,
@@ -579,9 +579,9 @@ U_CAPI UStringSearch * U_EXPORT2 usearch_open(const UChar *pattern,
 }
 
 U_CAPI UStringSearch * U_EXPORT2 usearch_openFromCollator(
-                                  const UChar          *pattern,
+                                  const char16_t       *pattern,
                                         int32_t         patternlength,
-                                  const UChar          *text,
+                                  const char16_t       *text,
                                         int32_t         textlength,
                                   const UCollator      *collator,
                                         UBreakIterator *breakiter,
@@ -849,7 +849,7 @@ U_CAPI int32_t U_EXPORT2 usearch_getMatchedStart(
 
 
 U_CAPI int32_t U_EXPORT2 usearch_getMatchedText(const UStringSearch *strsrch,
-                                            UChar         *result,
+                                            char16_t      *result,
                                             int32_t        resultCapacity,
                                             UErrorCode    *status)
 {
@@ -874,7 +874,7 @@ U_CAPI int32_t U_EXPORT2 usearch_getMatchedText(const UStringSearch *strsrch,
     }
     if (copylength > 0) {
         uprv_memcpy(result, strsrch->search->text + copyindex,
-                    copylength * sizeof(UChar));
+                    copylength * sizeof(char16_t));
     }
     return u_terminateUChars(result, resultCapacity,
                              strsrch->search->matchedLength, status);
@@ -916,7 +916,7 @@ usearch_getBreakIterator(const UStringSearch *strsrch)
 #endif
 
 U_CAPI void U_EXPORT2 usearch_setText(      UStringSearch *strsrch,
-                                      const UChar         *text,
+                                      const char16_t      *text,
                                             int32_t        textlength,
                                             UErrorCode    *status)
 {
@@ -948,7 +948,7 @@ U_CAPI void U_EXPORT2 usearch_setText(      UStringSearch *strsrch,
     }
 }
 
-U_CAPI const UChar * U_EXPORT2 usearch_getText(const UStringSearch *strsrch,
+U_CAPI const char16_t * U_EXPORT2 usearch_getText(const UStringSearch *strsrch,
                                                      int32_t       *length)
 {
     if (strsrch) {
@@ -1022,7 +1022,7 @@ U_CAPI UCollator * U_EXPORT2 usearch_getCollator(const UStringSearch *strsrch)
 }
 
 U_CAPI void U_EXPORT2 usearch_setPattern(      UStringSearch *strsrch,
-                                         const UChar         *pattern,
+                                         const char16_t      *pattern,
                                                int32_t        patternlength,
                                                UErrorCode    *status)
 {
@@ -1045,7 +1045,7 @@ U_CAPI void U_EXPORT2 usearch_setPattern(      UStringSearch *strsrch,
     }
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 usearch_getPattern(const UStringSearch *strsrch,
                    int32_t             *length)
 {
@@ -1411,11 +1411,11 @@ CEIBuffer::CEIBuffer(UStringSearch *ss, UErrorCode *status) {
     strSearch = ss;
     bufSize = ss->pattern.pcesLength + CEBUFFER_EXTRA;
     if (ss->search->elementComparisonType != 0) {
-        const UChar * patText = ss->pattern.text;
+        const char16_t * patText = ss->pattern.text;
         if (patText) {
-            const UChar * patTextLimit = patText + ss->pattern.textLength;
+            const char16_t * patTextLimit = patText + ss->pattern.textLength;
             while ( patText < patTextLimit ) {
-                UChar c = *patText++;
+                char16_t c = *patText++;
                 if (MIGHT_BE_JAMO_L(c)) {
                     bufSize += MAX_TARGET_IGNORABLES_PER_PAT_JAMO_L;
                 } else {
@@ -1557,7 +1557,7 @@ static int32_t nextBoundaryAfter(UStringSearch *strsrch, int32_t startIndex, UEr
         return startIndex;
     }
 #if 0
-    const UChar *text = strsrch->search->text;
+    const char16_t *text = strsrch->search->text;
     int32_t textLen   = strsrch->search->textLength;
 
     U_ASSERT(startIndex>=0);
@@ -1617,7 +1617,7 @@ static UBool isBreakBoundary(UStringSearch *strsrch, int32_t index, UErrorCode &
         return true;
     }
 #if 0
-    const UChar *text = strsrch->search->text;
+    const char16_t *text = strsrch->search->text;
     int32_t textLen   = strsrch->search->textLength;
 
     U_ASSERT(index>=0);
index c7df63ad902cad014f5b3b646f8d88de061fc760..3df63e5b84fef9e3f394567328e13ac49c8fd12e 100644 (file)
@@ -368,7 +368,7 @@ uspoof_setAllowedUnicodeSet(USpoofChecker *sc, const UnicodeSet *chars, UErrorCo
 
 U_CAPI int32_t U_EXPORT2
 uspoof_check(const USpoofChecker *sc,
-             const UChar *id, int32_t length,
+             const char16_t *id, int32_t length,
              int32_t *position,
              UErrorCode *status) {
 
@@ -384,7 +384,7 @@ uspoof_check(const USpoofChecker *sc,
 
 U_CAPI int32_t U_EXPORT2
 uspoof_check2(const USpoofChecker *sc,
-    const UChar* id, int32_t length,
+    const char16_t* id, int32_t length,
     USpoofCheckResult* checkResult,
     UErrorCode *status) {
 
@@ -435,8 +435,8 @@ uspoof_check2UTF8(const USpoofChecker *sc,
 
 U_CAPI int32_t U_EXPORT2
 uspoof_areConfusable(const USpoofChecker *sc,
-                     const UChar *id1, int32_t length1,
-                     const UChar *id2, int32_t length2,
+                     const char16_t *id1, int32_t length1,
+                     const char16_t *id2, int32_t length2,
                      UErrorCode *status) {
     SpoofImpl::validateThis(sc, *status);
     if (U_FAILURE(*status)) {
@@ -677,8 +677,8 @@ uspoof_check2UnicodeString(const USpoofChecker *sc,
 U_CAPI int32_t U_EXPORT2
 uspoof_getSkeleton(const USpoofChecker *sc,
                    uint32_t type,
-                   const UChar *id,  int32_t length,
-                   UChar *dest, int32_t destCapacity,
+                   const char16_t *id,  int32_t length,
+                   char16_t *dest, int32_t destCapacity,
                    UErrorCode *status) {
 
     SpoofImpl::validateThis(sc, *status);
index e45d065cad0a8d0771bcbaaa201bfda98c1f6c65..42dba1c03784560c9cd4f907243754ae01f1669d 100644 (file)
@@ -227,7 +227,7 @@ void ConfusabledataBuilder::buildConfusableData(SpoofImpl * spImpl, const char *
 void ConfusabledataBuilder::build(const char * confusables, int32_t confusablesLen,
                UErrorCode &status) {
 
-    // Convert the user input data from UTF-8 to UChar (UTF-16)
+    // Convert the user input data from UTF-8 to char16_t (UTF-16)
     int32_t inputLen = 0;
     if (U_FAILURE(status)) {
         return;
@@ -237,7 +237,7 @@ void ConfusabledataBuilder::build(const char * confusables, int32_t confusablesL
         return;
     }
     status = U_ZERO_ERROR;
-    fInput = static_cast<UChar *>(uprv_malloc((inputLen+1) * sizeof(UChar)));
+    fInput = static_cast<char16_t *>(uprv_malloc((inputLen+1) * sizeof(char16_t)));
     if (fInput == nullptr) {
         status = U_MEMORY_ALLOCATION_ERROR;
         return;
@@ -459,8 +459,8 @@ void ConfusabledataBuilder::outputData(UErrorCode &status) {
     uint32_t stringsLength = fStringTable->length();
     // Reserve an extra space so the string will be nul-terminated.  This is
     // only a convenience, for when debugging; it is not needed otherwise.
-    UChar *strings =
-        static_cast<UChar *>(fSpoofImpl->fSpoofData->reserveSpace(stringsLength*sizeof(UChar)+2, status));
+    char16_t *strings =
+        static_cast<char16_t *>(fSpoofImpl->fSpoofData->reserveSpace(stringsLength*sizeof(char16_t)+2, status));
     if (U_FAILURE(status)) {
         return;
     }
index 1eeecdfd5e40d4105c221195446ad320fef12bf2..a5e3b9e109cc9156a21338bbdfe6e6ef75577843 100644 (file)
@@ -90,7 +90,7 @@ class SPUStringPool : public UMemory {
 class ConfusabledataBuilder : public UMemory {
   private:
     SpoofImpl  *fSpoofImpl;
-    UChar      *fInput;
+    char16_t   *fInput;
     UHashtable *fTable;
     UnicodeSet *fKeySet;     // A set of all keys (UChar32s) that go into the four mapping tables.
 
index 95ce225f5bbfcffd7f4ccebdb3db454cf5366916..ff1928598ab430e898a50c07e2b1b8cdca8fa6fe 100644 (file)
@@ -405,11 +405,11 @@ bool SpoofImpl::isIllegalCombiningDotLeadCharacter(UChar32 cp) const {
 
 
 // Convert a text format hex number.  Utility function used by builder code.  Static.
-// Input: UChar *string text.  Output: a UChar32
+// Input: char16_t *string text.  Output: a UChar32
 // Input has been pre-checked, and will have no non-hex chars.
 // The number must fall in the code point range of 0..0x10ffff
 // Static Function.
-UChar32 SpoofImpl::ScanHex(const UChar *s, int32_t start, int32_t limit, UErrorCode &status) {
+UChar32 SpoofImpl::ScanHex(const char16_t *s, int32_t start, int32_t limit, UErrorCode &status) {
     if (U_FAILURE(status)) {
         return 0;
     }
@@ -694,7 +694,7 @@ void SpoofData::initPtrs(UErrorCode &status) {
         fCFUValues = (uint16_t *)((char *)fRawData + fRawData->fCFUStringIndex);
     }
     if (fRawData->fCFUStringTable != 0) {
-        fCFUStrings = (UChar *)((char *)fRawData + fRawData->fCFUStringTable);
+        fCFUStrings = (char16_t *)((char *)fRawData + fRawData->fCFUStringTable);
     }
 }
 
@@ -806,7 +806,7 @@ int32_t SpoofData::appendValueTo(int32_t index, UnicodeString& dest) const {
     // an index into the string table (for longer strings)
     uint16_t value = fCFUValues[index];
     if (stringLength == 1) {
-        dest.append((UChar)value);
+        dest.append((char16_t)value);
     } else {
         dest.append(fCFUStrings + value, stringLength);
     }
index 8602a4ca3195ce3a10203149697b8b95a3ef53aa..997b902f5c7db0cc896ddce8f5fcf64344d24601 100644 (file)
@@ -91,7 +91,7 @@ public:
     bool isIllegalCombiningDotLeadCharacter(UChar32 cp) const;
 
     /** parse a hex number.  Untility used by the builders.   */
-    static UChar32 ScanHex(const UChar *s, int32_t start, int32_t limit, UErrorCode &status);
+    static UChar32 ScanHex(const char16_t *s, int32_t start, int32_t limit, UErrorCode &status);
 
     static UClassID U_EXPORT2 getStaticClassID(void);
     virtual UClassID getDynamicClassID(void) const override;
@@ -158,7 +158,7 @@ public:
 //
 //    String Table:
 //       The strings table contains all of the value strings (those of length two or greater)
-//       concatenated together into one long UChar (UTF-16) array.
+//       concatenated together into one long char16_t (UTF-16) array.
 //
 //       There is no nul character or other mark between adjacent strings.
 //
@@ -287,7 +287,7 @@ class SpoofData: public UMemory {
     // Confusable data
     int32_t                     *fCFUKeys;
     uint16_t                    *fCFUValues;
-    UChar                       *fCFUStrings;
+    char16_t                    *fCFUStrings;
 
     friend class ConfusabledataBuilder;
 };
index 335714fe9b3be0864c4bd5eef9128ea128f3ef36..e04721f7d7d4c80af0da705ded464468285194c8 100644 (file)
@@ -28,7 +28,7 @@
 U_NAMESPACE_BEGIN
 
 UTF16CollationIterator::UTF16CollationIterator(const UTF16CollationIterator &other,
-                                               const UChar *newText)
+                                               const char16_t *newText)
         : CollationIterator(other),
           start(newText),
           pos(newText + (other.pos - other.start)),
@@ -66,10 +66,10 @@ UTF16CollationIterator::handleNextCE32(UChar32 &c, UErrorCode & /*errorCode*/) {
     return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c);
 }
 
-UChar
+char16_t
 UTF16CollationIterator::handleGetTrailSurrogate() {
     if(pos == limit) { return 0; }
-    UChar trail;
+    char16_t trail;
     if(U16_IS_TRAIL(trail = *pos)) { ++pos; }
     return trail;
 }
@@ -95,7 +95,7 @@ UTF16CollationIterator::nextCodePoint(UErrorCode & /*errorCode*/) {
         return U_SENTINEL;
     }
     ++pos;
-    UChar trail;
+    char16_t trail;
     if(U16_IS_LEAD(c) && pos != limit && U16_IS_TRAIL(trail = *pos)) {
         ++pos;
         return U16_GET_SUPPLEMENTARY(c, trail);
@@ -110,7 +110,7 @@ UTF16CollationIterator::previousCodePoint(UErrorCode & /*errorCode*/) {
         return U_SENTINEL;
     }
     UChar32 c = *--pos;
-    UChar lead;
+    char16_t lead;
     if(U16_IS_TRAIL(c) && pos != start && U16_IS_LEAD(lead = *(pos - 1))) {
         --pos;
         return U16_GET_SUPPLEMENTARY(lead, c);
@@ -149,7 +149,7 @@ UTF16CollationIterator::backwardNumCodePoints(int32_t num, UErrorCode & /*errorC
 // FCDUTF16CollationIterator ----------------------------------------------- ***
 
 FCDUTF16CollationIterator::FCDUTF16CollationIterator(const FCDUTF16CollationIterator &other,
-                                                     const UChar *newText)
+                                                     const char16_t *newText)
         : UTF16CollationIterator(other),
           rawStart(newText),
           segmentStart(newText + (other.segmentStart - other.rawStart)),
@@ -277,7 +277,7 @@ FCDUTF16CollationIterator::nextCodePoint(UErrorCode &errorCode) {
             switchToForward();
         }
     }
-    UChar trail;
+    char16_t trail;
     if(U16_IS_LEAD(c) && pos != limit && U16_IS_TRAIL(trail = *pos)) {
         ++pos;
         return U16_GET_SUPPLEMENTARY(c, trail);
@@ -313,7 +313,7 @@ FCDUTF16CollationIterator::previousCodePoint(UErrorCode &errorCode) {
             switchToBackward();
         }
     }
-    UChar lead;
+    char16_t lead;
     if(U16_IS_TRAIL(c) && pos != start && U16_IS_LEAD(lead = *(pos - 1))) {
         --pos;
         return U16_GET_SUPPLEMENTARY(lead, c);
@@ -375,11 +375,11 @@ FCDUTF16CollationIterator::nextSegment(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return false; }
     U_ASSERT(checkDir > 0 && pos != limit);
     // The input text [segmentStart..pos[ passes the FCD check.
-    const UChar *p = pos;
+    const char16_t *p = pos;
     uint8_t prevCC = 0;
     for(;;) {
         // Fetch the next character's fcd16 value.
-        const UChar *q = p;
+        const char16_t *q = p;
         uint16_t fcd16 = nfcImpl.nextFCD16(p, rawLimit);
         uint8_t leadCC = (uint8_t)(fcd16 >> 8);
         if(leadCC == 0 && q != pos) {
@@ -439,11 +439,11 @@ FCDUTF16CollationIterator::previousSegment(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return false; }
     U_ASSERT(checkDir < 0 && pos != start);
     // The input text [pos..segmentLimit[ passes the FCD check.
-    const UChar *p = pos;
+    const char16_t *p = pos;
     uint8_t nextCC = 0;
     for(;;) {
         // Fetch the previous character's fcd16 value.
-        const UChar *q = p;
+        const char16_t *q = p;
         uint16_t fcd16 = nfcImpl.previousFCD16(rawStart, p);
         uint8_t trailCC = (uint8_t)fcd16;
         if(trailCC == 0 && q != pos) {
@@ -475,7 +475,7 @@ FCDUTF16CollationIterator::previousSegment(UErrorCode &errorCode) {
 }
 
 UBool
-FCDUTF16CollationIterator::normalize(const UChar *from, const UChar *to, UErrorCode &errorCode) {
+FCDUTF16CollationIterator::normalize(const char16_t *from, const char16_t *to, UErrorCode &errorCode) {
     // NFD without argument checking.
     U_ASSERT(U_SUCCESS(errorCode));
     nfcImpl.decompose(from, to, normalized, (int32_t)(to - from), errorCode);
index c02f1981d275d50e0caa0c5332abff739ded6485..34634bf494ab561aa97cc9174e2646ddda2bd17b 100644 (file)
@@ -34,11 +34,11 @@ U_NAMESPACE_BEGIN
 class U_I18N_API UTF16CollationIterator : public CollationIterator {
 public:
     UTF16CollationIterator(const CollationData *d, UBool numeric,
-                           const UChar *s, const UChar *p, const UChar *lim)
+                           const char16_t *s, const char16_t *p, const char16_t *lim)
             : CollationIterator(d, numeric),
               start(s), pos(p), limit(lim) {}
 
-    UTF16CollationIterator(const UTF16CollationIterator &other, const UChar *newText);
+    UTF16CollationIterator(const UTF16CollationIterator &other, const char16_t *newText);
 
     virtual ~UTF16CollationIterator();
 
@@ -48,7 +48,7 @@ public:
 
     virtual int32_t getOffset() const override;
 
-    void setText(const UChar *s, const UChar *lim) {
+    void setText(const char16_t *s, const char16_t *lim) {
         reset();
         start = pos = s;
         limit = lim;
@@ -66,7 +66,7 @@ protected:
 
     virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override;
 
-    virtual UChar handleGetTrailSurrogate() override;
+    virtual char16_t handleGetTrailSurrogate() override;
 
     virtual UBool foundNULTerminator() override;
 
@@ -76,7 +76,7 @@ protected:
 
     // UTF-16 string pointers.
     // limit can be nullptr for NUL-terminated strings.
-    const UChar *start, *pos, *limit;
+    const char16_t *start, *pos, *limit;
 };
 
 /**
@@ -85,13 +85,13 @@ protected:
 class U_I18N_API FCDUTF16CollationIterator : public UTF16CollationIterator {
 public:
     FCDUTF16CollationIterator(const CollationData *data, UBool numeric,
-                              const UChar *s, const UChar *p, const UChar *lim)
+                              const char16_t *s, const char16_t *p, const char16_t *lim)
             : UTF16CollationIterator(data, numeric, s, p, lim),
               rawStart(s), segmentStart(p), segmentLimit(nullptr), rawLimit(lim),
               nfcImpl(data->nfcImpl),
               checkDir(1) {}
 
-    FCDUTF16CollationIterator(const FCDUTF16CollationIterator &other, const UChar *newText);
+    FCDUTF16CollationIterator(const FCDUTF16CollationIterator &other, const char16_t *newText);
 
     virtual ~FCDUTF16CollationIterator();
 
@@ -143,7 +143,7 @@ private:
      */
     UBool previousSegment(UErrorCode &errorCode);
 
-    UBool normalize(const UChar *from, const UChar *to, UErrorCode &errorCode);
+    UBool normalize(const char16_t *from, const char16_t *to, UErrorCode &errorCode);
 
     // Text pointers: The input text is [rawStart, rawLimit[
     // where rawLimit can be nullptr for NUL-terminated text.
@@ -168,11 +168,11 @@ private:
     // or the current segment had to be normalized so that
     // [segmentStart..segmentLimit[ turned into the normalized string,
     // corresponding to normalized.getBuffer()==start<=pos<=limit==start+normalized.length().
-    const UChar *rawStart;
-    const UChar *segmentStart;
-    const UChar *segmentLimit;
+    const char16_t *rawStart;
+    const char16_t *segmentStart;
+    const char16_t *segmentLimit;
     // rawLimit==nullptr for a NUL-terminated string.
-    const UChar *rawLimit;
+    const char16_t *rawLimit;
 
     const Normalizer2Impl &nfcImpl;
     UnicodeString normalized;
index 5a6cf7fd1bad6b35d09545fa098223fbe7f86e47..ea7278afc6ca66b80447c224d1f9ac6ff0fbe62c 100644 (file)
@@ -242,11 +242,11 @@ FCDUTF8CollationIterator::previousHasTccc() const {
     return CollationFCD::hasTccc(c);
 }
 
-UChar
+char16_t
 FCDUTF8CollationIterator::handleGetTrailSurrogate() {
     if(state != IN_NORMALIZED) { return 0; }
     U_ASSERT(pos < normalized.length());
-    UChar trail;
+    char16_t trail;
     if(U16_IS_TRAIL(trail = normalized[pos])) { ++pos; }
     return trail;
 }
index 09cfce4369f3f987f5f4a5b8958e1edca68f6e7f..13ca87846bc85e93f6423c28bc9a2f33f313d74d 100644 (file)
@@ -98,7 +98,7 @@ public:
 protected:
     virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override;
 
-    virtual UChar handleGetTrailSurrogate() override;
+    virtual char16_t handleGetTrailSurrogate() override;
 
     virtual UBool foundNULTerminator() override;
 
index 44835e260dd3061faf6f3374341a0b40e1fbf8ee..70bf5a37d63e54b3efd1d2b7483cc20c047495c6 100644 (file)
@@ -80,7 +80,7 @@ protected:
 
     virtual int32_t getLength() const override;
 
-    virtual UChar getCharAt(int32_t offset) const override;
+    virtual char16_t getCharAt(int32_t offset) const override;
 
     virtual UChar32 getChar32At(int32_t offset) const override;
 };
@@ -101,7 +101,7 @@ int32_t ReplaceableGlue::getLength() const {
     return (*func->length)(rep);
 }
 
-UChar ReplaceableGlue::getCharAt(int32_t offset) const {
+char16_t ReplaceableGlue::getCharAt(int32_t offset) const {
     return (*func->charAt)(rep, offset);
 }
 
@@ -132,10 +132,10 @@ U_NAMESPACE_END
 U_NAMESPACE_USE
 
 U_CAPI UTransliterator* U_EXPORT2
-utrans_openU(const UChar *id,
+utrans_openU(const char16_t *id,
              int32_t idLength,
              UTransDirection dir,
-             const UChar *rules,
+             const char16_t *rules,
              int32_t rulesLength,
              UParseError *parseError,
              UErrorCode *status) {
@@ -182,7 +182,7 @@ utrans_openU(const UChar *id,
 U_CAPI UTransliterator* U_EXPORT2
 utrans_open(const char* id,
             UTransDirection dir,
-            const UChar* rules,         /* may be Null */
+            const char16_t* rules,         /* may be Null */
             int32_t rulesLength,        /* -1 if null-terminated */ 
             UParseError* parseError,    /* may be Null */
             UErrorCode* status) {
@@ -227,7 +227,7 @@ utrans_close(UTransliterator* trans) {
     delete (Transliterator*) trans;
 }
 
-U_CAPI const UChar * U_EXPORT2
+U_CAPI const char16_t * U_EXPORT2
 utrans_getUnicodeID(const UTransliterator *trans,
                     int32_t *resultLength) {
     // Transliterator keeps its ID NUL-terminated
@@ -254,7 +254,7 @@ utrans_register(UTransliterator* adoptedTrans,
 }
 
 U_CAPI void U_EXPORT2
-utrans_unregisterID(const UChar* id, int32_t idLength) {
+utrans_unregisterID(const char16_t* id, int32_t idLength) {
     UnicodeString ID(idLength<0, id, idLength); // r-o alias
     Transliterator::unregister(ID);
 }
@@ -267,7 +267,7 @@ utrans_unregister(const char* id) {
 
 U_CAPI void U_EXPORT2
 utrans_setFilter(UTransliterator* trans,
-                 const UChar* filterPattern,
+                 const char16_t* filterPattern,
                  int32_t filterPatternLen,
                  UErrorCode* status) {
 
@@ -318,7 +318,7 @@ utrans_enum_count(UEnumeration *uenum, UErrorCode *pErrorCode) {
     return ((UTransEnumeration *)uenum)->count;
 }
 
-static const UChar* U_CALLCONV
+static const char16_t* U_CALLCONV
 utrans_enum_unext(UEnumeration *uenum,
                   int32_t* resultLength,
                   UErrorCode *pErrorCode) {
@@ -436,7 +436,7 @@ utrans_transIncremental(const UTransliterator* trans,
 
 U_CAPI void U_EXPORT2
 utrans_transUChars(const UTransliterator* trans,
-                   UChar* text,
+                   char16_t* text,
                    int32_t* textLength,
                    int32_t textCapacity,
                    int32_t start,
@@ -467,7 +467,7 @@ utrans_transUChars(const UTransliterator* trans,
 
 U_CAPI void U_EXPORT2
 utrans_transIncrementalUChars(const UTransliterator* trans,
-                              UChar* text,
+                              char16_t* text,
                               int32_t* textLength,
                               int32_t textCapacity,
                               UTransPosition* pos,
@@ -498,7 +498,7 @@ utrans_transIncrementalUChars(const UTransliterator* trans,
 U_CAPI int32_t U_EXPORT2
 utrans_toRules(     const UTransliterator* trans,
                     UBool escapeUnprintable,
-                    UChar* result, int32_t resultLength,
+                    char16_t* result, int32_t resultLength,
                     UErrorCode* status) {
     utrans_ENTRY(status) 0;
     if ( (result==nullptr)? resultLength!=0: resultLength<0 ) {
index bd81ee73e691faeef563a859c183bb532a4ea0c1..317457829e56d7e9c3474d8fa9544bb9e7511e9a 100644 (file)
 U_NAMESPACE_BEGIN
 
 // Smybol characters used by RFC2445 VTIMEZONE
-static const UChar COLON = 0x3A; /* : */
-static const UChar SEMICOLON = 0x3B; /* ; */
-static const UChar EQUALS_SIGN = 0x3D; /* = */
-static const UChar COMMA = 0x2C; /* , */
-static const UChar PLUS = 0x2B; /* + */
-static const UChar MINUS = 0x2D; /* - */
+static const char16_t COLON = 0x3A; /* : */
+static const char16_t SEMICOLON = 0x3B; /* ; */
+static const char16_t EQUALS_SIGN = 0x3D; /* = */
+static const char16_t COMMA = 0x2C; /* , */
+static const char16_t PLUS = 0x2B; /* + */
+static const char16_t MINUS = 0x2D; /* - */
 
 // RFC2445 VTIMEZONE tokens
-static const UChar ICAL_BEGIN_VTIMEZONE[] = {0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A, 0x56, 0x54, 0x49, 0x4D, 0x45, 0x5A, 0x4F, 0x4E, 0x45, 0}; /* "BEGIN:VTIMEZONE" */
-static const UChar ICAL_END_VTIMEZONE[] = {0x45, 0x4E, 0x44, 0x3A, 0x56, 0x54, 0x49, 0x4D, 0x45, 0x5A, 0x4F, 0x4E, 0x45, 0}; /* "END:VTIMEZONE" */
-static const UChar ICAL_BEGIN[] = {0x42, 0x45, 0x47, 0x49, 0x4E, 0}; /* "BEGIN" */
-static const UChar ICAL_END[] = {0x45, 0x4E, 0x44, 0}; /* "END" */
-static const UChar ICAL_VTIMEZONE[] = {0x56, 0x54, 0x49, 0x4D, 0x45, 0x5A, 0x4F, 0x4E, 0x45, 0}; /* "VTIMEZONE" */
-static const UChar ICAL_TZID[] = {0x54, 0x5A, 0x49, 0x44, 0}; /* "TZID" */
-static const UChar ICAL_STANDARD[] = {0x53, 0x54, 0x41, 0x4E, 0x44, 0x41, 0x52, 0x44, 0}; /* "STANDARD" */
-static const UChar ICAL_DAYLIGHT[] = {0x44, 0x41, 0x59, 0x4C, 0x49, 0x47, 0x48, 0x54, 0}; /* "DAYLIGHT" */
-static const UChar ICAL_DTSTART[] = {0x44, 0x54, 0x53, 0x54, 0x41, 0x52, 0x54, 0}; /* "DTSTART" */
-static const UChar ICAL_TZOFFSETFROM[] = {0x54, 0x5A, 0x4F, 0x46, 0x46, 0x53, 0x45, 0x54, 0x46, 0x52, 0x4F, 0x4D, 0}; /* "TZOFFSETFROM" */
-static const UChar ICAL_TZOFFSETTO[] = {0x54, 0x5A, 0x4F, 0x46, 0x46, 0x53, 0x45, 0x54, 0x54, 0x4F, 0}; /* "TZOFFSETTO" */
-static const UChar ICAL_RDATE[] = {0x52, 0x44, 0x41, 0x54, 0x45, 0}; /* "RDATE" */
-static const UChar ICAL_RRULE[] = {0x52, 0x52, 0x55, 0x4C, 0x45, 0}; /* "RRULE" */
-static const UChar ICAL_TZNAME[] = {0x54, 0x5A, 0x4E, 0x41, 0x4D, 0x45, 0}; /* "TZNAME" */
-static const UChar ICAL_TZURL[] = {0x54, 0x5A, 0x55, 0x52, 0x4C, 0}; /* "TZURL" */
-static const UChar ICAL_LASTMOD[] = {0x4C, 0x41, 0x53, 0x54, 0x2D, 0x4D, 0x4F, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0}; /* "LAST-MODIFIED" */
-
-static const UChar ICAL_FREQ[] = {0x46, 0x52, 0x45, 0x51, 0}; /* "FREQ" */
-static const UChar ICAL_UNTIL[] = {0x55, 0x4E, 0x54, 0x49, 0x4C, 0}; /* "UNTIL" */
-static const UChar ICAL_YEARLY[] = {0x59, 0x45, 0x41, 0x52, 0x4C, 0x59, 0}; /* "YEARLY" */
-static const UChar ICAL_BYMONTH[] = {0x42, 0x59, 0x4D, 0x4F, 0x4E, 0x54, 0x48, 0}; /* "BYMONTH" */
-static const UChar ICAL_BYDAY[] = {0x42, 0x59, 0x44, 0x41, 0x59, 0}; /* "BYDAY" */
-static const UChar ICAL_BYMONTHDAY[] = {0x42, 0x59, 0x4D, 0x4F, 0x4E, 0x54, 0x48, 0x44, 0x41, 0x59, 0}; /* "BYMONTHDAY" */
-
-static const UChar ICAL_NEWLINE[] = {0x0D, 0x0A, 0}; /* CRLF */
-
-static const UChar ICAL_DOW_NAMES[7][3] = {
+static const char16_t ICAL_BEGIN_VTIMEZONE[] = {0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A, 0x56, 0x54, 0x49, 0x4D, 0x45, 0x5A, 0x4F, 0x4E, 0x45, 0}; /* "BEGIN:VTIMEZONE" */
+static const char16_t ICAL_END_VTIMEZONE[] = {0x45, 0x4E, 0x44, 0x3A, 0x56, 0x54, 0x49, 0x4D, 0x45, 0x5A, 0x4F, 0x4E, 0x45, 0}; /* "END:VTIMEZONE" */
+static const char16_t ICAL_BEGIN[] = {0x42, 0x45, 0x47, 0x49, 0x4E, 0}; /* "BEGIN" */
+static const char16_t ICAL_END[] = {0x45, 0x4E, 0x44, 0}; /* "END" */
+static const char16_t ICAL_VTIMEZONE[] = {0x56, 0x54, 0x49, 0x4D, 0x45, 0x5A, 0x4F, 0x4E, 0x45, 0}; /* "VTIMEZONE" */
+static const char16_t ICAL_TZID[] = {0x54, 0x5A, 0x49, 0x44, 0}; /* "TZID" */
+static const char16_t ICAL_STANDARD[] = {0x53, 0x54, 0x41, 0x4E, 0x44, 0x41, 0x52, 0x44, 0}; /* "STANDARD" */
+static const char16_t ICAL_DAYLIGHT[] = {0x44, 0x41, 0x59, 0x4C, 0x49, 0x47, 0x48, 0x54, 0}; /* "DAYLIGHT" */
+static const char16_t ICAL_DTSTART[] = {0x44, 0x54, 0x53, 0x54, 0x41, 0x52, 0x54, 0}; /* "DTSTART" */
+static const char16_t ICAL_TZOFFSETFROM[] = {0x54, 0x5A, 0x4F, 0x46, 0x46, 0x53, 0x45, 0x54, 0x46, 0x52, 0x4F, 0x4D, 0}; /* "TZOFFSETFROM" */
+static const char16_t ICAL_TZOFFSETTO[] = {0x54, 0x5A, 0x4F, 0x46, 0x46, 0x53, 0x45, 0x54, 0x54, 0x4F, 0}; /* "TZOFFSETTO" */
+static const char16_t ICAL_RDATE[] = {0x52, 0x44, 0x41, 0x54, 0x45, 0}; /* "RDATE" */
+static const char16_t ICAL_RRULE[] = {0x52, 0x52, 0x55, 0x4C, 0x45, 0}; /* "RRULE" */
+static const char16_t ICAL_TZNAME[] = {0x54, 0x5A, 0x4E, 0x41, 0x4D, 0x45, 0}; /* "TZNAME" */
+static const char16_t ICAL_TZURL[] = {0x54, 0x5A, 0x55, 0x52, 0x4C, 0}; /* "TZURL" */
+static const char16_t ICAL_LASTMOD[] = {0x4C, 0x41, 0x53, 0x54, 0x2D, 0x4D, 0x4F, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0}; /* "LAST-MODIFIED" */
+
+static const char16_t ICAL_FREQ[] = {0x46, 0x52, 0x45, 0x51, 0}; /* "FREQ" */
+static const char16_t ICAL_UNTIL[] = {0x55, 0x4E, 0x54, 0x49, 0x4C, 0}; /* "UNTIL" */
+static const char16_t ICAL_YEARLY[] = {0x59, 0x45, 0x41, 0x52, 0x4C, 0x59, 0}; /* "YEARLY" */
+static const char16_t ICAL_BYMONTH[] = {0x42, 0x59, 0x4D, 0x4F, 0x4E, 0x54, 0x48, 0}; /* "BYMONTH" */
+static const char16_t ICAL_BYDAY[] = {0x42, 0x59, 0x44, 0x41, 0x59, 0}; /* "BYDAY" */
+static const char16_t ICAL_BYMONTHDAY[] = {0x42, 0x59, 0x4D, 0x4F, 0x4E, 0x54, 0x48, 0x44, 0x41, 0x59, 0}; /* "BYMONTHDAY" */
+
+static const char16_t ICAL_NEWLINE[] = {0x0D, 0x0A, 0}; /* CRLF */
+
+static const char16_t ICAL_DOW_NAMES[7][3] = {
     {0x53, 0x55, 0}, /* "SU" */
     {0x4D, 0x4F, 0}, /* "MO" */
     {0x54, 0x55, 0}, /* "TU" */
@@ -72,9 +72,9 @@ static const UChar ICAL_DOW_NAMES[7][3] = {
 static const int32_t MONTHLENGTH[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
 // ICU custom property
-static const UChar ICU_TZINFO_PROP[] = {0x58, 0x2D, 0x54, 0x5A, 0x49, 0x4E, 0x46, 0x4F, 0x3A, 0}; /* "X-TZINFO:" */
-static const UChar ICU_TZINFO_PARTIAL[] = {0x2F, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6C, 0x40, 0}; /* "/Partial@" */
-static const UChar ICU_TZINFO_SIMPLE[] = {0x2F, 0x53, 0x69, 0x6D, 0x70, 0x6C, 0x65, 0x40, 0}; /* "/Simple@" */
+static const char16_t ICU_TZINFO_PROP[] = {0x58, 0x2D, 0x54, 0x5A, 0x49, 0x4E, 0x46, 0x4F, 0x3A, 0}; /* "X-TZINFO:" */
+static const char16_t ICU_TZINFO_PARTIAL[] = {0x2F, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6C, 0x40, 0}; /* "/Partial@" */
+static const char16_t ICU_TZINFO_SIMPLE[] = {0x2F, 0x53, 0x69, 0x6D, 0x70, 0x6C, 0x65, 0x40, 0}; /* "/Simple@" */
 
 
 /*
@@ -139,7 +139,7 @@ static UnicodeString& appendAsciiDigits(int32_t number, uint8_t length, UnicodeS
         str.append(MINUS);
     }
     for (i = length - 1; i >= 0; i--) {
-        str.append((UChar)(digits[i] + 0x0030));
+        str.append((char16_t)(digits[i] + 0x0030));
     }
     return str;
 }
@@ -172,7 +172,7 @@ static UnicodeString& appendMillis(UDate date, UnicodeString& str) {
     }
     i--;
     while (i >= 0) {
-        str.append((UChar)(digits[i--] + 0x0030));
+        str.append((char16_t)(digits[i--] + 0x0030));
     }
     return str;
 }
@@ -188,7 +188,7 @@ static UnicodeString& getDateTimeString(UDate time, UnicodeString& str) {
     appendAsciiDigits(year, 4, str);
     appendAsciiDigits(month + 1, 2, str);
     appendAsciiDigits(dom, 2, str);
-    str.append((UChar)0x0054 /*'T'*/);
+    str.append((char16_t)0x0054 /*'T'*/);
 
     int32_t t = mid;
     int32_t hour = t / U_MILLIS_PER_HOUR;
@@ -208,7 +208,7 @@ static UnicodeString& getDateTimeString(UDate time, UnicodeString& str) {
  */
 static UnicodeString& getUTCDateTimeString(UDate time, UnicodeString& str) {
     getDateTimeString(time, str);
-    str.append((UChar)0x005A /*'Z'*/);
+    str.append((char16_t)0x005A /*'Z'*/);
     return str;
 }
 
@@ -295,7 +295,7 @@ static int32_t offsetStrToMillis(const UnicodeString& str, UErrorCode& status) {
             break;
         }
         // sign
-        UChar s = str.charAt(0);
+        char16_t s = str.charAt(0);
         if (s == PLUS) {
             sign = 1;
         } else if (s == MINUS) {
@@ -885,9 +885,9 @@ public:
     ~VTZWriter();
 
     void write(const UnicodeString& str);
-    void write(UChar ch);
-    void write(const UChar* str);
-    //void write(const UChar* str, int32_t length);
+    void write(char16_t ch);
+    void write(const char16_t* str);
+    //void write(const char16_t* str, int32_t length);
 private:
     UnicodeString* out;
 };
@@ -905,18 +905,18 @@ VTZWriter::write(const UnicodeString& str) {
 }
 
 void
-VTZWriter::write(UChar ch) {
+VTZWriter::write(char16_t ch) {
     out->append(ch);
 }
 
 void
-VTZWriter::write(const UChar* str) {
+VTZWriter::write(const char16_t* str) {
     out->append(str, -1);
 }
 
 /*
 void
-VTZWriter::write(const UChar* str, int32_t length) {
+VTZWriter::write(const char16_t* str, int32_t length) {
     out->append(str, length);
 }
 */
@@ -926,7 +926,7 @@ public:
     VTZReader(const UnicodeString& input);
     ~VTZReader();
 
-    UChar read(void);
+    char16_t read(void);
 private:
     const UnicodeString* in;
     int32_t index;
@@ -940,9 +940,9 @@ VTZReader::VTZReader(const UnicodeString& input) {
 VTZReader::~VTZReader() {
 }
 
-UChar
+char16_t
 VTZReader::read(void) {
-    UChar ch = 0xFFFF;
+    char16_t ch = 0xFFFF;
     if (index < in->length()) {
         ch = in->charAt(index);
     }
@@ -1074,7 +1074,7 @@ VTimeZone::createVTimeZoneByID(const UnicodeString& ID) {
     // Set ICU tzdata version
     UErrorCode status = U_ZERO_ERROR;
     UResourceBundle *bundle = nullptr;
-    const UChar* versionStr = nullptr;
+    const char16_t* versionStr = nullptr;
     int32_t len = 0;
     bundle = ures_openDirect(nullptr, "zoneinfo64", &status);
     versionStr = ures_getStringByKey(bundle, "TZVersion", &len, &status);
@@ -1105,7 +1105,7 @@ VTimeZone::createVTimeZoneFromBasicTimeZone(const BasicTimeZone& basic_time_zone
 
     // Set ICU tzdata version
     UResourceBundle *bundle = nullptr;
-    const UChar* versionStr = nullptr;
+    const char16_t* versionStr = nullptr;
     int32_t len = 0;
     bundle = ures_openDirect(nullptr, "zoneinfo64", &status);
     versionStr = ures_getStringByKey(bundle, "TZVersion", &len, &status);
@@ -1275,7 +1275,7 @@ VTimeZone::load(VTZReader& reader, UErrorCode& status) {
     UnicodeString line;
 
     while (true) {
-        UChar ch = reader.read();
+        char16_t ch = reader.read();
         if (ch == 0xFFFF) {
             // end of file
             if (start && line.startsWith(ICAL_END_VTIMEZONE, -1)) {
@@ -1791,11 +1791,11 @@ VTimeZone::write(UDate start, VTZWriter& writer, UErrorCode& status) const {
             return;
         }
         icutzprop->append(olsonzid);
-        icutzprop->append((UChar)0x005B/*'['*/);
+        icutzprop->append((char16_t)0x005B/*'['*/);
         icutzprop->append(icutzver);
         icutzprop->append(ICU_TZINFO_PARTIAL, -1);
         appendMillis(start, *icutzprop);
-        icutzprop->append((UChar)0x005D/*']'*/);
+        icutzprop->append((char16_t)0x005D/*']'*/);
         customProps.adoptElement(icutzprop, status);
         if (U_FAILURE(status)) {
             return;
@@ -1838,11 +1838,11 @@ VTimeZone::writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) const
                return;
             }
             icutzprop->append(olsonzid);
-            icutzprop->append((UChar)0x005B/*'['*/);
+            icutzprop->append((char16_t)0x005B/*'['*/);
             icutzprop->append(icutzver);
             icutzprop->append(ICU_TZINFO_SIMPLE, -1);
             appendMillis(time, *icutzprop);
-            icutzprop->append((UChar)0x005D/*']'*/);
+            icutzprop->append((char16_t)0x005D/*']'*/);
             customProps.adoptElement(icutzprop.orphan(), status);
         }
         writeZone(writer, rbtz, &customProps, status);
index 7e3a5544fd5e2fd79ef67b97c5135a136c16e342..5517e5144c0a4ce8f448d61dc9739d0d1d2a79bf 100644 (file)
 U_NAMESPACE_USE
 
 U_CAPI VZone* U_EXPORT2
-vzone_openID(const UChar* ID, int32_t idLength){
+vzone_openID(const char16_t* ID, int32_t idLength){
     UnicodeString s(idLength==-1, ID, idLength);
     return (VZone*) (VTimeZone::createVTimeZoneByID(s));
 }
     
 U_CAPI VZone* U_EXPORT2
-vzone_openData(const UChar* vtzdata, int32_t vtzdataLength, UErrorCode& status) {
+vzone_openData(const char16_t* vtzdata, int32_t vtzdataLength, UErrorCode& status) {
     UnicodeString s(vtzdataLength==-1, vtzdata, vtzdataLength);
     return (VZone*) (VTimeZone::createVTimeZone(s,status));
 }
@@ -53,7 +53,7 @@ vzone_equals(const VZone* zone1, const VZone* zone2) {
 }
 
 U_CAPI UBool U_EXPORT2
-vzone_getTZURL(VZone* zone, UChar* & url, int32_t & urlLength) {
+vzone_getTZURL(VZone* zone, char16_t* & url, int32_t & urlLength) {
     UnicodeString s;
     UBool b = ((VTimeZone*)zone)->VTimeZone::getTZURL(s);
 
@@ -64,7 +64,7 @@ vzone_getTZURL(VZone* zone, UChar* & url, int32_t & urlLength) {
 }
 
 U_CAPI void U_EXPORT2
-vzone_setTZURL(VZone* zone, UChar* url, int32_t urlLength) {
+vzone_setTZURL(VZone* zone, char16_t* url, int32_t urlLength) {
     UnicodeString s(urlLength==-1, url, urlLength);
     ((VTimeZone*)zone)->VTimeZone::setTZURL(s);
 }
@@ -80,36 +80,36 @@ vzone_setLastModified(VZone* zone, UDate lastModified) {
 }
 
 U_CAPI void U_EXPORT2
-vzone_write(VZone* zone, UChar* & result, int32_t & resultLength, UErrorCode& status) {
+vzone_write(VZone* zone, char16_t* & result, int32_t & resultLength, UErrorCode& status) {
     UnicodeString s;
     ((VTimeZone*)zone)->VTimeZone::write(s, status);
 
     resultLength = s.length();
-    result = (UChar*)uprv_malloc(resultLength);
+    result = (char16_t*)uprv_malloc(resultLength);
     memcpy(result,s.getBuffer(),resultLength);
 
     return;
 }
 
 U_CAPI void U_EXPORT2
-vzone_writeFromStart(VZone* zone, UDate start, UChar* & result, int32_t & resultLength, UErrorCode& status) {
+vzone_writeFromStart(VZone* zone, UDate start, char16_t* & result, int32_t & resultLength, UErrorCode& status) {
     UnicodeString s;
     ((VTimeZone*)zone)->VTimeZone::write(start, s, status);
 
     resultLength = s.length();
-    result = (UChar*)uprv_malloc(resultLength);
+    result = (char16_t*)uprv_malloc(resultLength);
     memcpy(result,s.getBuffer(),resultLength);
 
     return;
 }
 
 U_CAPI void U_EXPORT2
-vzone_writeSimple(VZone* zone, UDate time, UChar* & result, int32_t & resultLength, UErrorCode& status) {
+vzone_writeSimple(VZone* zone, UDate time, char16_t* & result, int32_t & resultLength, UErrorCode& status) {
     UnicodeString s;
     ((VTimeZone*)zone)->VTimeZone::writeSimple(time, s, status);
 
     resultLength = s.length();
-    result = (UChar*)uprv_malloc(resultLength);
+    result = (char16_t*)uprv_malloc(resultLength);
     memcpy(result,s.getBuffer(),resultLength);
 
     return;
index ee8c75581c9fd20a153534b52cd3f0f3d4574ab0..2118f92dceb29a0cd2cd509714d0bbc337afe1d1 100644 (file)
@@ -71,7 +71,7 @@ UnicodeString* Win32DateFormat::getTimeDateFormat(const Calendar *cal, const Loc
     }
 
     if (U_FAILURE(status)) {
-        static const UChar defaultPattern[] = {0x007B, 0x0031, 0x007D, 0x0020, 0x007B, 0x0030, 0x007D, 0x0000}; // "{1} {0}"
+        static const char16_t defaultPattern[] = {0x007B, 0x0031, 0x007D, 0x0020, 0x007B, 0x0030, 0x007D, 0x0000}; // "{1} {0}"
         return new UnicodeString(defaultPattern, UPRV_LENGTHOF(defaultPattern));
     }
 
@@ -82,7 +82,7 @@ UnicodeString* Win32DateFormat::getTimeDateFormat(const Calendar *cal, const Loc
         // Get proper date time format
         glueIndex = (int32_t)(DateFormat::kDateTimeOffset + (fDateStyle - DateFormat::kDateOffset));
     }
-    const UChar *resStr = ures_getStringByIndex(patBundle, glueIndex, &resStrLen, &status);
+    const char16_t *resStr = ures_getStringByIndex(patBundle, glueIndex, &resStrLen, &status);
 
     result = new UnicodeString(true, resStr, resStrLen);
 
@@ -329,7 +329,7 @@ void Win32DateFormat::formatDate(const SYSTEMTIME *st, UnicodeString &appendTo)
         }
     }
 
-    appendTo.append((const UChar *)buffer, (int32_t) wcslen(buffer));
+    appendTo.append((const char16_t *)buffer, (int32_t) wcslen(buffer));
 
     if (buffer != stackBuffer) {
         DELETE_ARRAY(buffer);
@@ -362,7 +362,7 @@ void Win32DateFormat::formatTime(const SYSTEMTIME *st, UnicodeString &appendTo)
         }
     }
 
-    appendTo.append((const UChar *)buffer, (int32_t) wcslen(buffer));
+    appendTo.append((const char16_t *)buffer, (int32_t) wcslen(buffer));
 
     if (buffer != stackBuffer) {
         DELETE_ARRAY(buffer);
index 05c95e9740a3b43f135d031dc52829a80542e1cf..6efa9a63d86376d5fc4a27324c3eaa78899ab061 100644 (file)
@@ -360,7 +360,7 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen
         newLength = _vscwprintf(fmt, args);
         va_end(args);
 
-        nBuffer = NEW_ARRAY(UChar, newLength + 1);
+        nBuffer = NEW_ARRAY(char16_t, newLength + 1);
 
         va_start(args, fmt);
         result = _vsnwprintf(nBuffer, newLength + 1, fmt, args);
@@ -441,7 +441,7 @@ UnicodeString &Win32NumberFormat::format(int32_t numDigits, UnicodeString &appen
         }
     }
 
-    appendTo.append((UChar *)buffer, (int32_t) wcslen(buffer));
+    appendTo.append((char16_t *)buffer, (int32_t) wcslen(buffer));
 
     if (buffer != stackBuffer) {
         DELETE_ARRAY(buffer);
index 6de0e3584fc699ca9eaa19ceb18387e6817d9dee..8f2961f8f06b4d6e019f2d1eefe4254566a7ff70 100644 (file)
@@ -117,7 +117,7 @@ static UBool getSystemTimeInformation(TimeZone *tz, SYSTEMTIME &daylightDate, SY
     return result;
 }
 
-static UBool getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length) {
+static UBool getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const char16_t *icuid, int32_t length) {
     UBool result = false;
     UnicodeString id = UnicodeString(icuid, length);
     TimeZone *tz = TimeZone::createTimeZone(id);
@@ -149,7 +149,7 @@ static UBool getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar
  * information to put into zoneInfo. This includes bias and standard time date and daylight saving date.
  */
 U_CAPI UBool U_EXPORT2
-uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const UChar *icuid, int32_t length)
+uprv_getWindowsTimeZoneInfo(TIME_ZONE_INFORMATION *zoneInfo, const char16_t *icuid, int32_t length)
 {
     if (getWindowsTimeZoneInfo(zoneInfo, icuid, length)) {
         return true;
index d3b89b70a5cf97bae0062d8d400f17ac2b26a217..749b6d952026eb4422a91746fbe4bc0655103ece 100644 (file)
@@ -89,11 +89,11 @@ static UBool U_CALLCONV zoneMeta_cleanup(void)
 }
 
 /**
- * Deleter for UChar* string
+ * Deleter for char16_t* string
  */
 static void U_CALLCONV
 deleteUCharString(void *obj) {
-    UChar *entry = (UChar*)obj;
+    char16_t *entry = (char16_t*)obj;
     uprv_free(entry);
 }
 
@@ -125,14 +125,14 @@ static const char gPrimaryZonesTag[]    = "primaryZones";
 
 static const char gWorldTag[]           = "001";
 
-static const UChar gWorld[] = {0x30, 0x30, 0x31, 0x00}; // "001"
+static const char16_t gWorld[] = {0x30, 0x30, 0x31, 0x00}; // "001"
 
-static const UChar gDefaultFrom[] = {0x31, 0x39, 0x37, 0x30, 0x2D, 0x30, 0x31, 0x2D, 0x30, 0x31,
+static const char16_t gDefaultFrom[] = {0x31, 0x39, 0x37, 0x30, 0x2D, 0x30, 0x31, 0x2D, 0x30, 0x31,
                                      0x20, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x00}; // "1970-01-01 00:00"
-static const UChar gDefaultTo[]   = {0x39, 0x39, 0x39, 0x39, 0x2D, 0x31, 0x32, 0x2D, 0x33, 0x31,
+static const char16_t gDefaultTo[]   = {0x39, 0x39, 0x39, 0x39, 0x2D, 0x31, 0x32, 0x2D, 0x33, 0x31,
                                      0x20, 0x32, 0x33, 0x3A, 0x35, 0x39, 0x00}; // "9999-12-31 23:59"
 
-static const UChar gCustomTzPrefix[]    = {0x47, 0x4D, 0x54, 0};    // "GMT"
+static const char16_t gCustomTzPrefix[]    = {0x47, 0x4D, 0x54, 0};    // "GMT"
 
 #define ASCII_DIGIT(c) (((c)>=0x30 && (c)<=0x39) ? (c)-0x30 : -1)
 
@@ -141,7 +141,7 @@ static const UChar gCustomTzPrefix[]    = {0x47, 0x4D, 0x54, 0};    // "GMT"
  * The format used by CLDR metazone mapping is "yyyy-MM-dd HH:mm".
  */
 static UDate
-parseDate (const UChar *text, UErrorCode &status) {
+parseDate (const char16_t *text, UErrorCode &status) {
     if (U_FAILURE(status)) {
         return 0;
     }
@@ -224,7 +224,7 @@ static void U_CALLCONV initCanonicalIDCache(UErrorCode &status) {
 }
 
 
-const UChar* U_EXPORT2
+const char16_t* U_EXPORT2
 ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
     if (U_FAILURE(status)) {
         return nullptr;
@@ -241,10 +241,10 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
         return nullptr;
     }
 
-    const UChar *canonicalID = nullptr;
+    const char16_t *canonicalID = nullptr;
 
     UErrorCode tmpStatus = U_ZERO_ERROR;
-    UChar utzid[ZID_KEY_MAX + 1];
+    char16_t utzid[ZID_KEY_MAX + 1];
     tzid.extract(utzid, ZID_KEY_MAX + 1, tmpStatus);
     U_ASSERT(tmpStatus == U_ZERO_ERROR);    // we checked the length of tzid already
 
@@ -257,7 +257,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
     // Check if it was already cached
     umtx_lock(&gZoneMetaLock);
     {
-        canonicalID = (const UChar *)uhash_get(gCanonicalIDCache, utzid);
+        canonicalID = (const char16_t *)uhash_get(gCanonicalIDCache, utzid);
     }
     umtx_unlock(&gZoneMetaLock);
 
@@ -284,7 +284,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
     ures_getByKey(rb, id, rb, &tmpStatus);
     if (U_SUCCESS(tmpStatus)) {
         // type entry (canonical) found
-        // the input is the canonical ID. resolve to const UChar*
+        // the input is the canonical ID. resolve to const char16_t*
         canonicalID = TimeZone::findID(tzid);
         isInputCanonical = true;
     }
@@ -294,7 +294,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
         tmpStatus = U_ZERO_ERROR;
         ures_getByKey(top, gTypeAliasTag, rb, &tmpStatus);
         ures_getByKey(rb, gTimezoneTag, rb, &tmpStatus);
-        const UChar *canonical = ures_getStringByKey(rb,id,nullptr,&tmpStatus);
+        const char16_t *canonical = ures_getStringByKey(rb,id,nullptr,&tmpStatus);
         if (U_SUCCESS(tmpStatus)) {
             // canonical map found
             canonicalID = canonical;
@@ -302,7 +302,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
 
         if (canonicalID == nullptr) {
             // Dereference the input ID using the tz data
-            const UChar *derefer = TimeZone::dereferOlsonLink(tzid);
+            const char16_t *derefer = TimeZone::dereferOlsonLink(tzid);
             if (derefer == nullptr) {
                 status = U_ILLEGAL_ARGUMENT_ERROR;
             } else {
@@ -342,20 +342,20 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
         // Put the resolved canonical ID to the cache
         umtx_lock(&gZoneMetaLock);
         {
-            const UChar* idInCache = (const UChar *)uhash_get(gCanonicalIDCache, utzid);
+            const char16_t* idInCache = (const char16_t *)uhash_get(gCanonicalIDCache, utzid);
             if (idInCache == nullptr) {
-                const UChar* key = ZoneMeta::findTimeZoneID(tzid);
+                const char16_t* key = ZoneMeta::findTimeZoneID(tzid);
                 U_ASSERT(key != nullptr);
                 if (key != nullptr) {
-                    idInCache = (const UChar *)uhash_put(gCanonicalIDCache, (void *)key, (void *)canonicalID, &status);
+                    idInCache = (const char16_t *)uhash_put(gCanonicalIDCache, (void *)key, (void *)canonicalID, &status);
                     U_ASSERT(idInCache == nullptr);
                 }
             }
             if (U_SUCCESS(status) && isInputCanonical) {
                 // Also put canonical ID itself into the cache if not exist
-                const UChar *canonicalInCache = (const UChar*)uhash_get(gCanonicalIDCache, canonicalID);
+                const char16_t *canonicalInCache = (const char16_t*)uhash_get(gCanonicalIDCache, canonicalID);
                 if (canonicalInCache == nullptr) {
-                    canonicalInCache = (const UChar *)uhash_put(gCanonicalIDCache, (void *)canonicalID, (void *)canonicalID, &status);
+                    canonicalInCache = (const char16_t *)uhash_put(gCanonicalIDCache, (void *)canonicalID, (void *)canonicalID, &status);
                     U_ASSERT(canonicalInCache == nullptr);
                 }
             }
@@ -368,7 +368,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
 
 UnicodeString& U_EXPORT2
 ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UnicodeString &systemID, UErrorCode& status) {
-    const UChar *canonicalID = getCanonicalCLDRID(tzid, status);
+    const char16_t *canonicalID = getCanonicalCLDRID(tzid, status);
     if (U_FAILURE(status) || canonicalID == nullptr) {
         systemID.setToBogus();
         return systemID;
@@ -377,7 +377,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UnicodeString &systemID,
     return systemID;
 }
 
-const UChar* U_EXPORT2
+const char16_t* U_EXPORT2
 ZoneMeta::getCanonicalCLDRID(const TimeZone& tz) {
     if (dynamic_cast<const OlsonTimeZone *>(&tz) != nullptr) {
         // short cut for OlsonTimeZone
@@ -417,7 +417,7 @@ ZoneMeta::getCanonicalCountry(const UnicodeString &tzid, UnicodeString &country,
         *isPrimary = false;
     }
 
-    const UChar *region = TimeZone::getRegion(tzid);
+    const char16_t *region = TimeZone::getRegion(tzid);
     if (region != nullptr && u_strcmp(gWorld, region) != 0) {
         country.setTo(region, -1);
     } else {
@@ -494,7 +494,7 @@ ZoneMeta::getCanonicalCountry(const UnicodeString &tzid, UnicodeString &country,
 
             UResourceBundle *rb = ures_openDirect(nullptr, gMetaZones, &status);
             ures_getByKey(rb, gPrimaryZonesTag, rb, &status);
-            const UChar *primaryZone = ures_getStringByKey(rb, regionBuf, &idLen, &status);
+            const char16_t *primaryZone = ures_getStringByKey(rb, regionBuf, &idLen, &status);
             if (U_SUCCESS(status)) {
                 if (tzid.compare(primaryZone, idLen) == 0) {
                     *isPrimary = true;
@@ -550,7 +550,7 @@ static void U_CALLCONV olsonToMetaInit(UErrorCode &status) {
 const UVector* U_EXPORT2
 ZoneMeta::getMetazoneMappings(const UnicodeString &tzid) {
     UErrorCode status = U_ZERO_ERROR;
-    UChar tzidUChars[ZID_KEY_MAX + 1];
+    char16_t tzidUChars[ZID_KEY_MAX + 1];
     tzid.extract(tzidUChars, ZID_KEY_MAX + 1, status);
     if (U_FAILURE(status) || status == U_STRING_NOT_TERMINATED_WARNING) {
         return nullptr;
@@ -589,7 +589,7 @@ ZoneMeta::getMetazoneMappings(const UnicodeString &tzid) {
         if (result == nullptr) {
             // add the one just created
             int32_t tzidLen = tzid.length() + 1;
-            UChar *key = (UChar*)uprv_malloc(tzidLen * sizeof(UChar));
+            char16_t *key = (char16_t*)uprv_malloc(tzidLen * sizeof(char16_t));
             if (key == nullptr) {
                 // memory allocation error..  just return nullptr
                 result = nullptr;
@@ -646,9 +646,9 @@ ZoneMeta::createMetazoneMappings(const UnicodeString &tzid) {
             while (ures_hasNext(rb)) {
                 mz = ures_getNextResource(rb, mz, &status);
 
-                const UChar *mz_name = ures_getStringByIndex(mz, 0, nullptr, &status);
-                const UChar *mz_from = gDefaultFrom;
-                const UChar *mz_to = gDefaultTo;
+                const char16_t *mz_name = ures_getStringByIndex(mz, 0, nullptr, &status);
+                const char16_t *mz_from = gDefaultFrom;
+                const char16_t *mz_to = gDefaultTo;
 
                 if (ures_getSize(mz) == 3) {
                     mz_from = ures_getStringByIndex(mz, 1, nullptr, &status);
@@ -700,7 +700,7 @@ ZoneMeta::createMetazoneMappings(const UnicodeString &tzid) {
 UnicodeString& U_EXPORT2
 ZoneMeta::getZoneIdByMetazone(const UnicodeString &mzid, const UnicodeString &region, UnicodeString &result) {
     UErrorCode status = U_ZERO_ERROR;
-    const UChar *tzid = nullptr;
+    const char16_t *tzid = nullptr;
     int32_t tzidLen = 0;
     char keyBuf[ZID_KEY_MAX + 1];
     int32_t keyLen = 0;
@@ -776,7 +776,7 @@ static void U_CALLCONV initAvailableMetaZoneIDs () {
         }
         const char *mzID = ures_getKey(res.getAlias());
         int32_t len = static_cast<int32_t>(uprv_strlen(mzID));
-        LocalMemory<UChar> uMzID((UChar*)uprv_malloc(sizeof(UChar) * (len + 1)));
+        LocalMemory<char16_t> uMzID((char16_t*)uprv_malloc(sizeof(char16_t) * (len + 1)));
         if (uMzID.isNull()) {
             status = U_MEMORY_ALLOCATION_ERROR;
             break;
@@ -811,16 +811,16 @@ ZoneMeta::getAvailableMetazoneIDs() {
     return gMetaZoneIDs;
 }
 
-const UChar*
+const char16_t*
 ZoneMeta::findMetaZoneID(const UnicodeString& mzid) {
     umtx_initOnce(gMetaZoneIDsInitOnce, &initAvailableMetaZoneIDs);
     if (gMetaZoneIDTable == nullptr) {
         return nullptr;
     }
-    return (const UChar*)uhash_get(gMetaZoneIDTable, &mzid);
+    return (const char16_t*)uhash_get(gMetaZoneIDTable, &mzid);
 }
 
-const UChar*
+const char16_t*
 ZoneMeta::findTimeZoneID(const UnicodeString& tzid) {
     return TimeZone::findID(tzid);
 }
@@ -853,28 +853,28 @@ ZoneMeta::formatCustomID(uint8_t hour, uint8_t min, uint8_t sec, UBool negative,
     id.setTo(gCustomTzPrefix, -1);
     if (hour != 0 || min != 0) {
         if (negative) {
-          id.append((UChar)0x2D);    // '-'
+          id.append((char16_t)0x2D);    // '-'
         } else {
-          id.append((UChar)0x2B);    // '+'
+          id.append((char16_t)0x2B);    // '+'
         }
         // Always use US-ASCII digits
-        id.append((UChar)(0x30 + (hour%100)/10));
-        id.append((UChar)(0x30 + (hour%10)));
-        id.append((UChar)0x3A);    // ':'
-        id.append((UChar)(0x30 + (min%100)/10));
-        id.append((UChar)(0x30 + (min%10)));
+        id.append((char16_t)(0x30 + (hour%100)/10));
+        id.append((char16_t)(0x30 + (hour%10)));
+        id.append((char16_t)0x3A);    // ':'
+        id.append((char16_t)(0x30 + (min%100)/10));
+        id.append((char16_t)(0x30 + (min%10)));
         if (sec != 0) {
-          id.append((UChar)0x3A);    // ':'
-          id.append((UChar)(0x30 + (sec%100)/10));
-          id.append((UChar)(0x30 + (sec%10)));
+          id.append((char16_t)0x3A);    // ':'
+          id.append((char16_t)(0x30 + (sec%100)/10));
+          id.append((char16_t)(0x30 + (sec%10)));
         }
     }
     return id;
 }
 
-const UChar*
+const char16_t*
 ZoneMeta::getShortID(const TimeZone& tz) {
-    const UChar* canonicalID = nullptr;
+    const char16_t* canonicalID = nullptr;
     if (dynamic_cast<const OlsonTimeZone *>(&tz) != nullptr) {
         // short cut for OlsonTimeZone
         const OlsonTimeZone *otz = (const OlsonTimeZone*)&tz;
@@ -886,19 +886,19 @@ ZoneMeta::getShortID(const TimeZone& tz) {
     return getShortIDFromCanonical(canonicalID);
 }
 
-const UChar*
+const char16_t*
 ZoneMeta::getShortID(const UnicodeString& id) {
     UErrorCode status = U_ZERO_ERROR;
-    const UChar* canonicalID = ZoneMeta::getCanonicalCLDRID(id, status);
+    const char16_t* canonicalID = ZoneMeta::getCanonicalCLDRID(id, status);
     if (U_FAILURE(status) || canonicalID == nullptr) {
         return nullptr;
     }
     return ZoneMeta::getShortIDFromCanonical(canonicalID);
 }
 
-const UChar*
-ZoneMeta::getShortIDFromCanonical(const UChar* canonicalID) {
-    const UChar* shortID = nullptr;
+const char16_t*
+ZoneMeta::getShortIDFromCanonical(const char16_t* canonicalID) {
+    const char16_t* shortID = nullptr;
     int32_t len = u_strlen(canonicalID);
     char tzidKey[ZID_KEY_MAX + 1];
 
index dad867ce1ea0a8c1109101dd1173f47bf196e5ef..8c5840c2659714a84b02e9ee9d1166704a8f34ef 100644 (file)
@@ -19,7 +19,7 @@
 U_NAMESPACE_BEGIN
 
 struct OlsonToMetaMappingEntry : public UMemory {
-    const UChar *mzid; // const because it's a reference to a resource bundle string.
+    const char16_t *mzid; // const because it's a reference to a resource bundle string.
     UDate from;
     UDate to;
 };
@@ -40,19 +40,19 @@ 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 guaranteed to persist
+     * This overload method returns a persistent const char16_t*, which is guaranteed to persist
      * (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);
+    static const char16_t* U_EXPORT2 getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status);
 
     /*
      * Convenient method returning CLDR canonical ID for the given time zone
      */
-    static const UChar* U_EXPORT2 getCanonicalCLDRID(const TimeZone& tz);
+    static const char16_t* U_EXPORT2 getCanonicalCLDRID(const TimeZone& tz);
 
     /**
      * Return the canonical country code for this tzid.  If we have none, or if the time zone
@@ -81,13 +81,13 @@ public:
      * Returns the pointer to the persistent time zone ID string, or nullptr if the given tzid is not in the
      * tz database. This method is useful when you maintain persistent zone IDs without duplication.
      */
-    static const UChar* U_EXPORT2 findTimeZoneID(const UnicodeString& tzid);
+    static const char16_t* U_EXPORT2 findTimeZoneID(const UnicodeString& tzid);
 
     /**
      * Returns the pointer to the persistent meta zone ID string, or nullptr if the given mzid is not available.
      * This method is useful when you maintain persistent meta zone IDs without duplication.
      */
-    static const UChar* U_EXPORT2 findMetaZoneID(const UnicodeString& mzid);
+    static const char16_t* U_EXPORT2 findMetaZoneID(const UnicodeString& mzid);
 
     /**
      * Creates a custom zone for the offset
@@ -102,7 +102,7 @@ public:
      * @param tz the time zone
      * @return the short ID of the time zone, or null if the short ID is not available.
      */
-    static const UChar* U_EXPORT2 getShortID(const TimeZone& tz);
+    static const char16_t* U_EXPORT2 getShortID(const TimeZone& tz);
 
     /**
      * Returns the time zone's short ID (null terminated) for the zone ID.
@@ -110,13 +110,13 @@ public:
      * @param tz the time zone ID
      * @return the short ID of the time zone ID, or null if the short ID is not available.
      */
-    static const UChar* U_EXPORT2 getShortID(const UnicodeString& id);
+    static const char16_t* U_EXPORT2 getShortID(const UnicodeString& id);
 
 private:
     ZoneMeta() = delete; // Prevent construction.
     static UVector* createMetazoneMappings(const UnicodeString &tzid);
     static UnicodeString& formatCustomID(uint8_t hour, uint8_t min, uint8_t sec, UBool negative, UnicodeString& id);
-    static const UChar* getShortIDFromCanonical(const UChar* canonicalID);
+    static const char16_t* getShortIDFromCanonical(const char16_t* canonicalID);
 };
 
 U_NAMESPACE_END
index bdf84965b5f420f084489cfc8962e8ae45a70d02..1ba0c9705e98179b35740b7f591ad65610982bd4 100644 (file)
@@ -40,7 +40,7 @@ zrule_equals(const ZRule* rule1, const ZRule* rule2) {
 }
 
 U_CAPI void U_EXPORT2
-zrule_getName(ZRule* rule, UChar* name, int32_t nameLength) {
+zrule_getName(ZRule* rule, char16_t* name, int32_t nameLength) {
     UnicodeString s(nameLength==-1, name, nameLength);
     s = ((TimeZoneRule*)rule)->TimeZoneRule::getName(s);
     nameLength = s.length();
@@ -68,7 +68,7 @@ zrule_isEquivalentTo(ZRule* rule1,  ZRule* rule2) {
  *********************************************************************/
 
 U_CAPI IZRule* U_EXPORT2
-izrule_open(const UChar* name, int32_t nameLength, int32_t rawOffset, int32_t dstSavings) {
+izrule_open(const char16_t* name, int32_t nameLength, int32_t rawOffset, int32_t dstSavings) {
     UnicodeString s(nameLength==-1, name, nameLength);
     return (IZRule*) new InitialTimeZoneRule(s, rawOffset, dstSavings);
 }
@@ -89,12 +89,12 @@ izrule_equals(const IZRule* rule1, const IZRule* rule2) {
 }
 
 U_CAPI void U_EXPORT2
-izrule_getName(IZRule* rule, UChar* & name, int32_t & nameLength) {
+izrule_getName(IZRule* rule, char16_t* & name, int32_t & nameLength) {
     // UnicodeString s(nameLength==-1, name, nameLength);
     UnicodeString s;
     ((InitialTimeZoneRule*)rule)->InitialTimeZoneRule::getName(s);
     nameLength = s.length();
-    name = (UChar*)uprv_malloc(nameLength);
+    name = (char16_t*)uprv_malloc(nameLength);
     memcpy(name, s.getBuffer(), nameLength);
     return;
 }
index ede31e9151782f4fa720c67db1e0df0cc7f532ea..48d9bcc27c510a7b6d5f089051f012f3d246dc57 100644 (file)
@@ -37,7 +37,7 @@
 /* u_minstrncpy copies the minimum number of code units of (count or output->available) */
 static int32_t
 u_sprintf_write(void        *context,
-                const UChar *str,
+                const char16_t *str,
                 int32_t     count)
 {
     u_localized_print_string *output = (u_localized_print_string *)context;
@@ -57,7 +57,7 @@ u_sprintf_write(void        *context,
 static int32_t
 u_sprintf_pad_and_justify(void                        *context,
                           const u_printf_spec_info    *info,
-                          const UChar                 *result,
+                          const char16_t              *result,
                           int32_t                     resultLen)
 {
     u_localized_print_string *output = (u_localized_print_string *)context;
@@ -112,7 +112,7 @@ u_sprintf_pad_and_justify(void                        *context,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_sprintf(UChar       *buffer,
+u_sprintf(char16_t    *buffer,
           const char    *patternSpecification,
           ... )
 {
@@ -127,8 +127,8 @@ u_sprintf(UChar       *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_sprintf_u(UChar     *buffer,
-            const UChar    *patternSpecification,
+u_sprintf_u(char16_t  *buffer,
+            const char16_t *patternSpecification,
             ... )
 {
     va_list ap;
@@ -142,7 +142,7 @@ u_sprintf_u(UChar     *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsprintf(UChar       *buffer,
+u_vsprintf(char16_t    *buffer,
            const char     *patternSpecification,
            va_list         ap)
 {
@@ -150,7 +150,7 @@ u_vsprintf(UChar       *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_snprintf(UChar       *buffer,
+u_snprintf(char16_t    *buffer,
            int32_t         count,
            const char    *patternSpecification,
            ... )
@@ -166,9 +166,9 @@ u_snprintf(UChar       *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_snprintf_u(UChar     *buffer,
+u_snprintf_u(char16_t  *buffer,
              int32_t        count,
-             const UChar    *patternSpecification,
+             const char16_t *patternSpecification,
              ... )
 {
     va_list ap;
@@ -182,19 +182,19 @@ u_snprintf_u(UChar     *buffer,
 }
 
 U_CAPI int32_t  U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsnprintf(UChar       *buffer,
+u_vsnprintf(char16_t    *buffer,
             int32_t         count,
             const char     *patternSpecification,
             va_list         ap)
 {
     int32_t written;
-    UChar *pattern;
-    UChar patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
+    char16_t *pattern;
+    char16_t patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
     int32_t size = (int32_t)strlen(patternSpecification) + 1;
 
     /* convert from the default codepage to Unicode */
     if (size >= (int32_t)MAX_UCHAR_BUFFER_SIZE(patBuffer)) {
-        pattern = (UChar *)uprv_malloc(size * sizeof(UChar));
+        pattern = (char16_t *)uprv_malloc(size * sizeof(char16_t));
         if(pattern == 0) {
             return 0;
         }
@@ -216,8 +216,8 @@ u_vsnprintf(UChar       *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2 
-u_vsprintf_u(UChar       *buffer, 
-             const UChar *patternSpecification, 
+u_vsprintf_u(char16_t    *buffer,
+             const char16_t *patternSpecification,
              va_list     ap) 
 { 
     return u_vsnprintf_u(buffer, INT32_MAX, patternSpecification, ap); 
@@ -229,9 +229,9 @@ static const u_printf_stream_handler g_sprintf_stream_handler = {
 };
 
 U_CAPI int32_t  U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsnprintf_u(UChar    *buffer,
+u_vsnprintf_u(char16_t *buffer,
               int32_t        count,
-              const UChar    *patternSpecification,
+              const char16_t *patternSpecification,
               va_list        ap)
 {
     int32_t          written = 0;   /* haven't written anything yet */
index aeb5abed53c9bd3577ac84a36d862c55b8c9cfcb..8940127eb1e24e60a9569fcd2dea155cb048de16 100644 (file)
@@ -33,7 +33,7 @@
 
 
 U_CAPI int32_t U_EXPORT2
-u_sscanf(const UChar   *buffer,
+u_sscanf(const char16_t   *buffer,
          const char    *patternSpecification,
          ... )
 {
@@ -48,8 +48,8 @@ u_sscanf(const UChar   *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_sscanf_u(const UChar    *buffer,
-           const UChar    *patternSpecification,
+u_sscanf_u(const char16_t *buffer,
+           const char16_t *patternSpecification,
            ... )
 {
     va_list ap;
@@ -63,18 +63,18 @@ u_sscanf_u(const UChar    *buffer,
 }
 
 U_CAPI int32_t  U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsscanf(const UChar   *buffer,
+u_vsscanf(const char16_t   *buffer,
           const char    *patternSpecification,
           va_list        ap)
 {
     int32_t converted;
-    UChar *pattern;
-    UChar patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
+    char16_t *pattern;
+    char16_t patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
     int32_t size = (int32_t)uprv_strlen(patternSpecification) + 1;
 
     /* convert from the default codepage to Unicode */
     if (size >= (int32_t)MAX_UCHAR_BUFFER_SIZE(patBuffer)) {
-        pattern = (UChar *)uprv_malloc(size * sizeof(UChar));
+        pattern = (char16_t *)uprv_malloc(size * sizeof(char16_t));
         if(pattern == 0) {
             return 0;
         }
@@ -96,8 +96,8 @@ u_vsscanf(const UChar   *buffer,
 }
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_vsscanf_u(const UChar *buffer,
-            const UChar *patternSpecification,
+u_vsscanf_u(const char16_t *buffer,
+            const char16_t *patternSpecification,
             va_list     ap)
 {
     int32_t         converted;
@@ -110,8 +110,8 @@ u_vsscanf_u(const UChar *buffer,
     inStr.fTranslit = nullptr;
 #endif
     inStr.fUCBuffer[0] = 0;
-    inStr.str.fBuffer = (UChar *)buffer;
-    inStr.str.fPos = (UChar *)buffer;
+    inStr.str.fBuffer = (char16_t *)buffer;
+    inStr.str.fPos = (char16_t *)buffer;
     inStr.str.fLimit = buffer + u_strlen(buffer);
 
     if(u_locbund_init(&inStr.str.fBundle, "en_US_POSIX") == 0) {
index 37786ebbf4f5395168732cb3d6fb5db53ab0af49..9e87e4058e3739f477b220e1ffcc9ab96776c4cb 100644 (file)
@@ -168,7 +168,7 @@ u_fopen(const char    *filename,
 #endif
 
 U_CAPI UFILE* U_EXPORT2
-u_fopen_u(const UChar   *filename,
+u_fopen_u(const char16_t   *filename,
         const char    *perm,
         const char    *locale,
         const char    *codepage)
@@ -216,7 +216,7 @@ u_fopen_u(const UChar   *filename,
 
 
 U_CAPI UFILE* U_EXPORT2
-u_fstropen(UChar *stringBuf,
+u_fstropen(char16_t *stringBuf,
            int32_t      capacity,
            const char  *locale)
 {
index 410df1ec54411c11a5264ab3a2e74509c92f056e..3d8f6413d8ac73a69dbe45a929a6e1d7376a2098 100644 (file)
@@ -38,7 +38,7 @@
 #define UPPERCASE_Z 0x005A
 
 int
-ufmt_digitvalue(UChar c)
+ufmt_digitvalue(char16_t c)
 {
     if( ((c>=DIGIT_0)&&(c<=DIGIT_9)) ||
         ((c>=LOWERCASE_A)&&(c<=LOWERCASE_Z)) ||
@@ -53,7 +53,7 @@ ufmt_digitvalue(UChar c)
 }
 
 UBool
-ufmt_isdigit(UChar     c,
+ufmt_isdigit(char16_t  c,
              int32_t     radix)
 {
     int digitVal = ufmt_digitvalue(c);
@@ -65,7 +65,7 @@ ufmt_isdigit(UChar     c,
 #define TO_LC_DIGIT(a) a <= 9 ? (DIGIT_0 + a) : (0x0057 + a)
 
 void 
-ufmt_64tou(UChar     *buffer, 
+ufmt_64tou(char16_t  *buffer,
           int32_t   *len,
           uint64_t  value, 
           uint8_t  radix,
@@ -74,12 +74,12 @@ ufmt_64tou(UChar     *buffer,
 {
     int32_t  length = 0;
     uint32_t digit;
-    UChar    *left, *right, temp;
+    char16_t *left, *right, temp;
     
     do {
         digit = (uint32_t)(value % radix);
         value = value / radix;
-        buffer[length++] = (UChar)(uselower ? TO_LC_DIGIT(digit) 
+        buffer[length++] = (char16_t)(uselower ? TO_LC_DIGIT(digit)
             : TO_UC_DIGIT(digit));
     } while(value);
 
@@ -102,7 +102,7 @@ ufmt_64tou(UChar     *buffer,
 }
 
 void 
-ufmt_ptou(UChar    *buffer, 
+ufmt_ptou(char16_t *buffer,
           int32_t   *len,
           void      *value, 
           UBool     uselower)
@@ -134,11 +134,11 @@ ufmt_ptou(UChar    *buffer,
 }
 
 int64_t
-ufmt_uto64(const UChar     *buffer, 
+ufmt_uto64(const char16_t  *buffer,
           int32_t     *len,
           int8_t     radix)
 {
-    const UChar     *limit;
+    const char16_t  *limit;
     int32_t         count;
     uint64_t        result;
     
@@ -165,7 +165,7 @@ ufmt_uto64(const UChar     *buffer,
 
 #define NIBBLE_PER_BYTE 2
 void *
-ufmt_utop(const UChar     *buffer,
+ufmt_utop(const char16_t  *buffer,
           int32_t     *len)
 {
     int32_t count, resultIdx, incVal, offset;
@@ -223,11 +223,11 @@ ufmt_utop(const UChar     *buffer,
     return result.ptr;
 }
 
-UChar*
+char16_t*
 ufmt_defaultCPToUnicode(const char *s, int32_t sSize,
-                        UChar *target, int32_t tSize)
+                        char16_t *target, int32_t tSize)
 {
-    UChar *alias;
+    char16_t *alias;
     UErrorCode status = U_ZERO_ERROR;
     UConverter *defConverter = u_getDefaultConverter(&status);
     
index 73c2b66979144c53898c7338dfd33e497ad5b80a..66f30a422cf38490f673f75f2ee2d0f8a1da6a8a 100644 (file)
@@ -68,7 +68,7 @@ u_get_stdout()
 
 static int32_t U_EXPORT2
 u_printf_write(void          *context,
-               const UChar   *str,
+               const char16_t   *str,
                int32_t       count)
 {
     return u_file_write(str, count, (UFILE *)context);
@@ -77,7 +77,7 @@ u_printf_write(void          *context,
 static int32_t
 u_printf_pad_and_justify(void                        *context,
                          const u_printf_spec_info    *info,
-                         const UChar                 *result,
+                         const char16_t              *result,
                          int32_t                     resultLen)
 {
     UFILE   *output = (UFILE *)context;
@@ -138,7 +138,7 @@ u_printf(const char *patternSpecification,
 
 U_CAPI int32_t U_EXPORT2 
 u_fprintf_u(    UFILE        *f,
-            const UChar    *patternSpecification,
+            const char16_t *patternSpecification,
             ... )
 {
     va_list ap;
@@ -152,7 +152,7 @@ u_fprintf_u(    UFILE        *f,
 }
 
 U_CAPI int32_t U_EXPORT2
-u_printf_u(const UChar *patternSpecification,
+u_printf_u(const char16_t *patternSpecification,
            ...)
 {
     va_list ap;
@@ -169,13 +169,13 @@ u_vfprintf(    UFILE        *f,
            va_list        ap)
 {
     int32_t count;
-    UChar *pattern;
-    UChar buffer[UFMT_DEFAULT_BUFFER_SIZE];
+    char16_t *pattern;
+    char16_t buffer[UFMT_DEFAULT_BUFFER_SIZE];
     size_t size = strlen(patternSpecification) + 1;
 
     /* convert from the default codepage to Unicode */
     if (size >= MAX_UCHAR_BUFFER_SIZE(buffer)) {
-        pattern = (UChar *)uprv_malloc(size * sizeof(UChar));
+        pattern = (char16_t *)uprv_malloc(size * sizeof(char16_t));
         if(pattern == 0) {
             return 0;
         }
@@ -203,7 +203,7 @@ static const u_printf_stream_handler g_stream_handler = {
 
 U_CAPI int32_t  U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_vfprintf_u(    UFILE        *f,
-             const UChar    *patternSpecification,
+             const char16_t *patternSpecification,
              va_list        ap)
 {
     int32_t          written = 0;   /* haven't written anything yet */
index 2b6743d9fd91143cac474fa84004a4cdb52c62ce..399d2dc7511960a2c38149d9ccb019693cd637af 100644 (file)
@@ -115,15 +115,15 @@ typedef struct u_printf_spec {
 #define UPRINTF_BUFFER_SIZE 1024
 #define UPRINTF_SYMBOL_BUFFER_SIZE 8
 
-static const UChar gNullStr[] = {0x28, 0x6E, 0x75, 0x6C, 0x6C, 0x29, 0}; /* "(null)" */
-static const UChar gSpaceStr[] = {0x20, 0}; /* " " */
+static const char16_t gNullStr[] = {0x28, 0x6E, 0x75, 0x6C, 0x6C, 0x29, 0}; /* "(null)" */
+static const char16_t gSpaceStr[] = {0x20, 0}; /* " " */
 
 /* Sets the sign of a format based on u_printf_spec_info */
 /* TODO: Is setting the prefix symbol to a positive sign a good idea in all locales? */
 static void
 u_printf_set_sign(UNumberFormat        *format,
                    const u_printf_spec_info     *info,
-                   UChar *prefixBuffer,
+                   char16_t *prefixBuffer,
                    int32_t *prefixBufLen,
                    UErrorCode *status)
 {
@@ -139,7 +139,7 @@ u_printf_set_sign(UNumberFormat        *format,
             unum_setTextAttribute(format, UNUM_POSITIVE_PREFIX, gSpaceStr, 1, status);
         }
         else {
-            UChar plusSymbol[UPRINTF_SYMBOL_BUFFER_SIZE];
+            char16_t plusSymbol[UPRINTF_SYMBOL_BUFFER_SIZE];
             int32_t symbolLen;
 
             symbolLen = unum_getSymbol(format,
@@ -162,7 +162,7 @@ u_printf_set_sign(UNumberFormat        *format,
 static void
 u_printf_reset_sign(UNumberFormat        *format,
                    const u_printf_spec_info     *info,
-                   UChar *prefixBuffer,
+                   char16_t *prefixBuffer,
                    int32_t *prefixBufLen,
                    UErrorCode *status)
 {
@@ -187,7 +187,7 @@ u_printf_simple_percent_handler(const u_printf_stream_handler  *handler,
     (void)formatBundle;
     (void)info;
     (void)args;
-    static const UChar PERCENT[] = { UP_PERCENT };
+    static const char16_t PERCENT[] = { UP_PERCENT };
 
     /* put a single '%' onto the output */
     return handler->write(context, PERCENT, 1);
@@ -202,8 +202,8 @@ u_printf_string_handler(const u_printf_stream_handler  *handler,
                         const ufmt_args                *args)
 {
     (void)formatBundle;
-    UChar *s;
-    UChar buffer[UFMT_DEFAULT_BUFFER_SIZE];
+    char16_t *s;
+    char16_t buffer[UFMT_DEFAULT_BUFFER_SIZE];
     int32_t len, written;
     int32_t argSize;
     const char *arg = (const char*)(args[0].ptrValue);
@@ -213,7 +213,7 @@ u_printf_string_handler(const u_printf_stream_handler  *handler,
         argSize = (int32_t)strlen(arg) + 1;
         if (argSize >= MAX_UCHAR_BUFFER_SIZE(buffer)) {
             s = ufmt_defaultCPToUnicode(arg, argSize,
-                    (UChar *)uprv_malloc(MAX_UCHAR_BUFFER_NEEDED(argSize)),
+                    (char16_t *)uprv_malloc(MAX_UCHAR_BUFFER_NEEDED(argSize)),
                     MAX_UCHAR_BUFFER_NEEDED(argSize));
             if(s == nullptr) {
                 return 0;
@@ -225,7 +225,7 @@ u_printf_string_handler(const u_printf_stream_handler  *handler,
         }
     }
     else {
-        s = (UChar *)gNullStr;
+        s = (char16_t *)gNullStr;
     }
     len = u_strlen(s);
 
@@ -253,7 +253,7 @@ u_printf_char_handler(const u_printf_stream_handler  *handler,
                       const ufmt_args                *args)
 {
     (void)formatBundle;
-    UChar s[U16_MAX_LENGTH+1];
+    char16_t s[U16_MAX_LENGTH+1];
     int32_t len = 1, written;
     unsigned char arg = (unsigned char)(args[0].int64Value);
 
@@ -283,8 +283,8 @@ u_printf_double_handler(const u_printf_stream_handler  *handler,
 {
     double        num         = (double) (args[0].doubleValue);
     UNumberFormat  *format;
-    UChar          result[UPRINTF_BUFFER_SIZE];
-    UChar          prefixBuffer[UPRINTF_BUFFER_SIZE];
+    char16_t       result[UPRINTF_BUFFER_SIZE];
+    char16_t       prefixBuffer[UPRINTF_BUFFER_SIZE];
     int32_t        prefixBufferLen = sizeof(prefixBuffer);
     int32_t        minDecimalDigits;
     int32_t        maxDecimalDigits;
@@ -359,8 +359,8 @@ u_printf_integer_handler(const u_printf_stream_handler  *handler,
 {
     int64_t         num        = args[0].int64Value;
     UNumberFormat   *format;
-    UChar           result[UPRINTF_BUFFER_SIZE];
-    UChar           prefixBuffer[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
+    char16_t        prefixBuffer[UPRINTF_BUFFER_SIZE];
     int32_t         prefixBufferLen = sizeof(prefixBuffer);
     int32_t         minDigits     = -1;
     int32_t         resultLen;
@@ -425,7 +425,7 @@ u_printf_hex_handler(const u_printf_stream_handler  *handler,
 {
     (void)formatBundle;
     int64_t         num        = args[0].int64Value;
-    UChar           result[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
     int32_t         len        = UPRINTF_BUFFER_SIZE;
 
 
@@ -443,7 +443,7 @@ u_printf_hex_handler(const u_printf_stream_handler  *handler,
     /* convert to alt form, if desired */
     if(num != 0 && info->fAlt && len < UPRINTF_BUFFER_SIZE - 2) {
         /* shift the formatted string right by 2 chars */
-        memmove(result + 2, result, len * sizeof(UChar));
+        memmove(result + 2, result, len * sizeof(char16_t));
         result[0] = 0x0030;
         result[1] = info->fSpec;
         len += 2;
@@ -461,7 +461,7 @@ u_printf_octal_handler(const u_printf_stream_handler  *handler,
 {
     (void)formatBundle;
     int64_t         num        = args[0].int64Value;
-    UChar           result[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
     int32_t         len        = UPRINTF_BUFFER_SIZE;
 
 
@@ -479,7 +479,7 @@ u_printf_octal_handler(const u_printf_stream_handler  *handler,
     /* convert to alt form, if desired */
     if(info->fAlt && result[0] != 0x0030 && len < UPRINTF_BUFFER_SIZE - 1) {
         /* shift the formatted string right by 1 char */
-        memmove(result + 1, result, len * sizeof(UChar));
+        memmove(result + 1, result, len * sizeof(char16_t));
         result[0] = 0x0030;
         len += 1;
     }
@@ -496,7 +496,7 @@ u_printf_uinteger_handler(const u_printf_stream_handler *handler,
 {
     int64_t         num        = args[0].int64Value;
     UNumberFormat   *format;
-    UChar           result[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
     int32_t         minDigits     = -1;
     int32_t         resultLen;
     UErrorCode      status        = U_ZERO_ERROR;
@@ -548,7 +548,7 @@ u_printf_pointer_handler(const u_printf_stream_handler  *handler,
                          const ufmt_args                *args)
 { 
     (void)formatBundle;
-    UChar           result[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
     int32_t         len  = UPRINTF_BUFFER_SIZE;
 
     /* format the pointer in hex */
@@ -566,16 +566,16 @@ u_printf_scientific_handler(const u_printf_stream_handler  *handler,
 {
     double          num         = (double) (args[0].doubleValue);
     UNumberFormat   *format;
-    UChar           result[UPRINTF_BUFFER_SIZE];
-    UChar           prefixBuffer[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
+    char16_t        prefixBuffer[UPRINTF_BUFFER_SIZE];
     int32_t         prefixBufferLen = sizeof(prefixBuffer);
     int32_t         minDecimalDigits;
     int32_t         maxDecimalDigits;
     UErrorCode      status        = U_ZERO_ERROR;
-    UChar srcExpBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
+    char16_t srcExpBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
     int32_t srcLen, expLen;
     int32_t resultLen;
-    UChar expBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
+    char16_t expBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
 
     prefixBuffer[0] = 0;
 
@@ -599,7 +599,7 @@ u_printf_scientific_handler(const u_printf_stream_handler  *handler,
         &status);
 
     /* Upper/lower case the e */
-    if (info->fSpec == (UChar)0x65 /* e */) {
+    if (info->fSpec == (char16_t)0x65 /* e */) {
         expLen = u_strToLower(expBuf, (int32_t)sizeof(expBuf),
             srcExpBuf, srcLen,
             formatBundle->fLocale,
@@ -625,7 +625,7 @@ u_printf_scientific_handler(const u_printf_stream_handler  *handler,
     /* set the appropriate flags and number of decimal digits on the formatter */
     if(info->fPrecision != -1) {
         /* set the # of decimal digits */
-        if (info->fOrigSpec == (UChar)0x65 /* e */ || info->fOrigSpec == (UChar)0x45 /* E */) {
+        if (info->fOrigSpec == (char16_t)0x65 /* e */ || info->fOrigSpec == (char16_t)0x45 /* E */) {
             unum_setAttribute(format, UNUM_FRACTION_DIGITS, info->fPrecision);
         }
         else {
@@ -686,8 +686,8 @@ u_printf_percent_handler(const u_printf_stream_handler  *handler,
 {
     double          num         = (double) (args[0].doubleValue);
     UNumberFormat   *format;
-    UChar           result[UPRINTF_BUFFER_SIZE];
-    UChar           prefixBuffer[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
+    char16_t        prefixBuffer[UPRINTF_BUFFER_SIZE];
     int32_t         prefixBufferLen = sizeof(prefixBuffer);
     int32_t         minDecimalDigits;
     int32_t         maxDecimalDigits;
@@ -761,7 +761,7 @@ u_printf_ustring_handler(const u_printf_stream_handler  *handler,
 {
     (void)formatBundle;
     int32_t len, written;
-    const UChar *arg = (const UChar*)(args[0].ptrValue);
+    const char16_t *arg = (const char16_t*)(args[0].ptrValue);
 
     /* allocate enough space for the buffer */
     if (arg == nullptr) {
@@ -790,7 +790,7 @@ u_printf_uchar_handler(const u_printf_stream_handler  *handler,
 {
     (void)formatBundle;
     int32_t written = 0;
-    UChar arg = (UChar)(args[0].int64Value);
+    char16_t arg = (char16_t)(args[0].int64Value);
 
     /* width = minimum # of characters to write */
     /* precision = maximum # of characters to write */
@@ -889,8 +889,8 @@ u_printf_spellout_handler(const u_printf_stream_handler *handler,
 {
     double          num         = (double) (args[0].doubleValue);
     UNumberFormat   *format;
-    UChar           result[UPRINTF_BUFFER_SIZE];
-    UChar           prefixBuffer[UPRINTF_BUFFER_SIZE];
+    char16_t        result[UPRINTF_BUFFER_SIZE];
+    char16_t        prefixBuffer[UPRINTF_BUFFER_SIZE];
     int32_t         prefixBufferLen = sizeof(prefixBuffer);
     int32_t         minDecimalDigits;
     int32_t         maxDecimalDigits;
@@ -1058,15 +1058,15 @@ static const u_printf_info g_u_printf_infos[UPRINTF_NUM_FMT_HANDLERS] = {
             (s) == MOD_LOWERL || \
             (s) == MOD_L
 /* Returns an array of the parsed argument type given in the format string. */
-static ufmt_args* parseArguments(const UChar *alias, va_list ap, UErrorCode *status) {
+static ufmt_args* parseArguments(const char16_t *alias, va_list ap, UErrorCode *status) {
     ufmt_args *arglist = nullptr;
     ufmt_type_info *typelist = nullptr;
     UBool *islonglong = nullptr;
     int32_t size = 0;
     int32_t pos = 0;
-    UChar type;
+    char16_t type;
     uint16_t handlerNum;
-    const UChar *aliasStart = alias;
+    const char16_t *aliasStart = alias;
 
     /* get maximum number of arguments */
     for(;;) {
@@ -1220,7 +1220,7 @@ static ufmt_args* parseArguments(const UChar *alias, va_list ap, UErrorCode *sta
 /* We parse the argument list in Unicode */
 U_CFUNC int32_t
 u_printf_parse(const u_printf_stream_handler *streamHandler,
-               const UChar     *fmt,
+               const char16_t  *fmt,
                void            *context,
                u_localized_print_string *locStringContext,
                ULocaleBundle   *formatBundle,
@@ -1234,10 +1234,10 @@ u_printf_parse(const u_printf_stream_handler *streamHandler,
     u_printf_spec    spec;
     u_printf_spec_info *info = &(spec.fInfo);
 
-    const UChar *alias = fmt;
-    const UChar *backup;
-    const UChar *lastAlias;
-    const UChar *orgAlias = fmt;
+    const char16_t *alias = fmt;
+    const char16_t *backup;
+    const char16_t *lastAlias;
+    const char16_t *orgAlias = fmt;
     /* parsed argument list */
     ufmt_args *arglist = nullptr; /* initialized it to avoid compiler warnings */
     UErrorCode status = U_ZERO_ERROR;
@@ -1345,10 +1345,10 @@ u_printf_parse(const u_printf_stream_handler *streamHandler,
 
                 /* TODO test that all four are numbers */
                 /* first four characters are hex values for pad char */
-                info->fPadChar = (UChar)ufmt_digitvalue(*alias++);
-                info->fPadChar = (UChar)((info->fPadChar * 16) + ufmt_digitvalue(*alias++));
-                info->fPadChar = (UChar)((info->fPadChar * 16) + ufmt_digitvalue(*alias++));
-                info->fPadChar = (UChar)((info->fPadChar * 16) + ufmt_digitvalue(*alias++));
+                info->fPadChar = (char16_t)ufmt_digitvalue(*alias++);
+                info->fPadChar = (char16_t)((info->fPadChar * 16) + ufmt_digitvalue(*alias++));
+                info->fPadChar = (char16_t)((info->fPadChar * 16) + ufmt_digitvalue(*alias++));
+                info->fPadChar = (char16_t)((info->fPadChar * 16) + ufmt_digitvalue(*alias++));
 
                 /* final character is ignored */
                 alias++;
index ce2e47a5881764db915460d558256450fc91cc58..2d72ccf5150835355489099cf5f46a4cfa083eda 100644 (file)
@@ -50,7 +50,7 @@ u_fscanf(UFILE        *f,
 
 U_CAPI int32_t U_EXPORT2
 u_fscanf_u(UFILE        *f,
-           const UChar    *patternSpecification,
+           const char16_t *patternSpecification,
            ... )
 {
     va_list ap;
@@ -69,13 +69,13 @@ u_vfscanf(UFILE        *f,
           va_list        ap)
 {
     int32_t converted;
-    UChar *pattern;
-    UChar patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
+    char16_t *pattern;
+    char16_t patBuffer[UFMT_DEFAULT_BUFFER_SIZE];
     int32_t size = (int32_t)uprv_strlen(patternSpecification) + 1;
 
     /* convert from the default codepage to Unicode */
     if (size >= MAX_UCHAR_BUFFER_SIZE(patBuffer)) {
-        pattern = (UChar *)uprv_malloc(size * sizeof(UChar));
+        pattern = (char16_t *)uprv_malloc(size * sizeof(char16_t));
         if(pattern == 0) {
             return 0;
         }
@@ -98,7 +98,7 @@ u_vfscanf(UFILE        *f,
 
 U_CAPI int32_t  U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_vfscanf_u(UFILE       *f,
-            const UChar *patternSpecification,
+            const char16_t *patternSpecification,
             va_list     ap)
 {
     return u_scanf_parse(f, patternSpecification, ap);
index ef17548d5a64797dbc3e466243e54727b9730ace..0a41dfe07d2bd2bfce21c722c23cda7efb54938c 100644 (file)
@@ -83,9 +83,9 @@
 typedef struct u_scanf_spec_info {
     int32_t fWidth;         /* Width  */
 
-    UChar   fSpec;          /* Format specification  */
+    char16_t   fSpec;          /* Format specification  */
 
-    UChar   fPadChar;       /* Padding character  */
+    char16_t   fPadChar;       /* Padding character  */
 
     UBool   fSkipArg;       /* true if arg should be skipped */
     UBool   fIsLongDouble;  /* L flag  */
@@ -112,11 +112,11 @@ typedef struct u_scanf_spec {
  * @return The number of characters contained in this specifier.
  */
 static int32_t
-u_scanf_parse_spec (const UChar     *fmt,
+u_scanf_parse_spec (const char16_t  *fmt,
             u_scanf_spec    *spec)
 {
-    const UChar *s = fmt;
-    const UChar *backup;
+    const char16_t *s = fmt;
+    const char16_t *backup;
     u_scanf_spec_info *info = &(spec->fInfo);
 
     /* initialize spec to default values */
@@ -175,10 +175,10 @@ u_scanf_parse_spec (const UChar     *fmt,
         case FLAG_PAREN:
 
             /* first four characters are hex values for pad char */
-            info->fPadChar = (UChar)ufmt_digitvalue(*s++);
-            info->fPadChar = (UChar)((info->fPadChar * 16) + ufmt_digitvalue(*s++));
-            info->fPadChar = (UChar)((info->fPadChar * 16) + ufmt_digitvalue(*s++));
-            info->fPadChar = (UChar)((info->fPadChar * 16) + ufmt_digitvalue(*s++));
+            info->fPadChar = (char16_t)ufmt_digitvalue(*s++);
+            info->fPadChar = (char16_t)((info->fPadChar * 16) + ufmt_digitvalue(*s++));
+            info->fPadChar = (char16_t)((info->fPadChar * 16) + ufmt_digitvalue(*s++));
+            info->fPadChar = (char16_t)((info->fPadChar * 16) + ufmt_digitvalue(*s++));
 
             /* final character is ignored */
             s++;
@@ -298,7 +298,7 @@ u_scanf_parse_spec (const UChar     *fmt,
 typedef int32_t (*u_scanf_handler) (UFILE   *stream,
                    u_scanf_spec_info  *info,
                    ufmt_args                *args,
-                   const UChar              *fmt,
+                   const char16_t           *fmt,
                    int32_t                  *fmtConsumed,
                    int32_t                  *argConverted);
 
@@ -316,9 +316,9 @@ typedef struct u_scanf_info {
 
 static int32_t
 u_scanf_skip_leading_ws(UFILE   *input,
-                        UChar   pad)
+                        char16_t   pad)
 {
-    UChar   c;
+    char16_t   c;
     int32_t count = 0;
     UBool isNotEOF;
 
@@ -341,10 +341,10 @@ u_scanf_skip_leading_positive_sign(UFILE   *input,
                                    UNumberFormat *format,
                                    UErrorCode *status)
 {
-    UChar   c;
+    char16_t   c;
     int32_t count = 0;
     UBool isNotEOF;
-    UChar plusSymbol[USCANF_SYMBOL_BUFFER_SIZE];
+    char16_t plusSymbol[USCANF_SYMBOL_BUFFER_SIZE];
     int32_t symbolLen;
     UErrorCode localStatus = U_ZERO_ERROR;
 
@@ -376,7 +376,7 @@ static int32_t
 u_scanf_simple_percent_handler(UFILE        *input,
                                u_scanf_spec_info *info,
                                ufmt_args    *args,
-                               const UChar  *fmt,
+                               const char16_t  *fmt,
                                int32_t      *fmtConsumed,
                                int32_t      *argConverted)
 {
@@ -397,7 +397,7 @@ static int32_t
 u_scanf_count_handler(UFILE         *input,
                       u_scanf_spec_info *info,
                       ufmt_args     *args,
-                      const UChar   *fmt,
+                      const char16_t   *fmt,
                       int32_t       *fmtConsumed,
                       int32_t       *argConverted)
 {
@@ -425,7 +425,7 @@ static int32_t
 u_scanf_double_handler(UFILE        *input,
                        u_scanf_spec_info *info,
                        ufmt_args    *args,
-                       const UChar  *fmt,
+                       const char16_t  *fmt,
                        int32_t      *fmtConsumed,
                        int32_t      *argConverted)
 {
@@ -493,7 +493,7 @@ static int32_t
 u_scanf_scientific_handler(UFILE        *input,
                            u_scanf_spec_info *info,
                            ufmt_args    *args,
-                           const UChar  *fmt,
+                           const char16_t  *fmt,
                            int32_t      *fmtConsumed,
                            int32_t      *argConverted)
 {
@@ -506,9 +506,9 @@ u_scanf_scientific_handler(UFILE        *input,
     int32_t         parsePos    = 0;
     int32_t         skipped;
     UErrorCode      status      = U_ZERO_ERROR;
-    UChar srcExpBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
+    char16_t srcExpBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
     int32_t srcLen, expLen;
-    UChar expBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
+    char16_t expBuf[UPRINTF_SYMBOL_BUFFER_SIZE];
 
 
     /* skip all ws in the input */
@@ -540,7 +540,7 @@ u_scanf_scientific_handler(UFILE        *input,
         &status);
 
     /* Upper/lower case the e */
-    if (info->fSpec == (UChar)0x65 /* e */) {
+    if (info->fSpec == (char16_t)0x65 /* e */) {
         expLen = u_strToLower(expBuf, (int32_t)sizeof(expBuf),
             srcExpBuf, srcLen,
             input->str.fBundle.fLocale,
@@ -593,7 +593,7 @@ static int32_t
 u_scanf_scidbl_handler(UFILE        *input,
                        u_scanf_spec_info *info,
                        ufmt_args    *args,
-                       const UChar  *fmt,
+                       const char16_t  *fmt,
                        int32_t      *fmtConsumed,
                        int32_t      *argConverted)
 {
@@ -686,7 +686,7 @@ static int32_t
 u_scanf_integer_handler(UFILE       *input,
                         u_scanf_spec_info *info,
                         ufmt_args   *args,
-                        const UChar *fmt,
+                        const char16_t *fmt,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
@@ -763,7 +763,7 @@ static int32_t
 u_scanf_uinteger_handler(UFILE          *input,
                          u_scanf_spec_info *info,
                          ufmt_args      *args,
-                         const UChar    *fmt,
+                         const char16_t *fmt,
                          int32_t        *fmtConsumed,
                          int32_t        *argConverted)
 {
@@ -775,7 +775,7 @@ static int32_t
 u_scanf_percent_handler(UFILE       *input,
                         u_scanf_spec_info *info,
                         ufmt_args   *args,
-                        const UChar *fmt,
+                        const char16_t *fmt,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
@@ -835,14 +835,14 @@ static int32_t
 u_scanf_string_handler(UFILE        *input,
                        u_scanf_spec_info *info,
                        ufmt_args    *args,
-                       const UChar  *fmt,
+                       const char16_t  *fmt,
                        int32_t      *fmtConsumed,
                        int32_t      *argConverted)
 {
     (void)fmt;
     (void)fmtConsumed;
 
-    const UChar *source;
+    const char16_t *source;
     UConverter  *conv;
     char        *arg    = (char*)(args[0].ptrValue);
     char        *alias  = arg;
@@ -850,7 +850,7 @@ u_scanf_string_handler(UFILE        *input,
     UErrorCode  status  = U_ZERO_ERROR;
     int32_t     count;
     int32_t     skipped = 0;
-    UChar       c;
+    char16_t    c;
     UBool       isNotEOF = false;
 
     /* skip all ws in the input */
@@ -921,7 +921,7 @@ static int32_t
 u_scanf_char_handler(UFILE          *input,
                      u_scanf_spec_info *info,
                      ufmt_args      *args,
-                     const UChar    *fmt,
+                     const char16_t *fmt,
                      int32_t        *fmtConsumed,
                      int32_t        *argConverted)
 {
@@ -936,18 +936,18 @@ static int32_t
 u_scanf_ustring_handler(UFILE       *input,
                         u_scanf_spec_info *info,
                         ufmt_args   *args,
-                        const UChar *fmt,
+                        const char16_t *fmt,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
     (void)fmt;
     (void)fmtConsumed;
 
-    UChar   *arg     = (UChar*)(args[0].ptrValue);
-    UChar   *alias     = arg;
+    char16_t   *arg     = (char16_t*)(args[0].ptrValue);
+    char16_t   *alias     = arg;
     int32_t count;
     int32_t skipped = 0;
-    UChar   c;
+    char16_t   c;
     UBool   isNotEOF = false;
 
     /* skip all ws in the input */
@@ -993,7 +993,7 @@ static int32_t
 u_scanf_uchar_handler(UFILE         *input,
                       u_scanf_spec_info *info,
                       ufmt_args     *args,
-                      const UChar   *fmt,
+                      const char16_t   *fmt,
                       int32_t       *fmtConsumed,
                       int32_t       *argConverted)
 {
@@ -1008,7 +1008,7 @@ static int32_t
 u_scanf_spellout_handler(UFILE          *input,
                          u_scanf_spec_info *info,
                          ufmt_args      *args,
-                         const UChar    *fmt,
+                         const char16_t *fmt,
                          int32_t        *fmtConsumed,
                          int32_t        *argConverted)
 {
@@ -1070,7 +1070,7 @@ static int32_t
 u_scanf_hex_handler(UFILE       *input,
                     u_scanf_spec_info *info,
                     ufmt_args   *args,
-                    const UChar *fmt,
+                    const char16_t *fmt,
                     int32_t     *fmtConsumed,
                     int32_t     *argConverted)
 {
@@ -1129,7 +1129,7 @@ static int32_t
 u_scanf_octal_handler(UFILE         *input,
                       u_scanf_spec_info *info,
                       ufmt_args     *args,
-                      const UChar   *fmt,
+                      const char16_t   *fmt,
                       int32_t       *fmtConsumed,
                       int32_t       *argConverted)
 {
@@ -1179,7 +1179,7 @@ static int32_t
 u_scanf_pointer_handler(UFILE       *input,
                         u_scanf_spec_info *info,
                         ufmt_args   *args,
-                        const UChar *fmt,
+                        const char16_t *fmt,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
@@ -1230,7 +1230,7 @@ static int32_t
 u_scanf_scanset_handler(UFILE       *input,
                         u_scanf_spec_info *info,
                         ufmt_args   *args,
-                        const UChar *fmt,
+                        const char16_t *fmt,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
@@ -1238,7 +1238,7 @@ u_scanf_scanset_handler(UFILE       *input,
     UErrorCode  status = U_ZERO_ERROR;
     int32_t     chLeft = INT32_MAX;
     UChar32     c;
-    UChar       *alias = (UChar*) (args[0].ptrValue);
+    char16_t    *alias = (char16_t*) (args[0].ptrValue);
     UBool       isNotEOF = false;
     UBool       readCharacter = false;
 
@@ -1355,10 +1355,10 @@ static const u_scanf_info g_u_scanf_infos[USCANF_NUM_FMT_HANDLERS] = {
 
 U_CFUNC int32_t
 u_scanf_parse(UFILE     *f,
-            const UChar *patternSpecification,
+            const char16_t *patternSpecification,
             va_list     ap)
 {
-    const UChar     *alias;
+    const char16_t  *alias;
     int32_t         count, converted, argConsumed, cpConsumed;
     uint16_t        handlerNum;
 
index 648f40af0a9a8ba183e22fd557c9a7f0f0bc1435..4130f340442cb5ab44fd115d9635e9c999755e7b 100644 (file)
 
 /* TODO: is this correct for all codepages? Should we just use \n and let the converter handle it? */
 #if U_PLATFORM_USES_ONLY_WIN32_API
-static const UChar DELIMITERS [] = { DELIM_CR, DELIM_LF, 0x0000 };
+static const char16_t DELIMITERS [] = { DELIM_CR, DELIM_LF, 0x0000 };
 static const uint32_t DELIMITERS_LEN = 2;
 /* TODO: Default newline writing should be detected based upon the converter being used. */
 #else
-static const UChar DELIMITERS [] = { DELIM_LF, 0x0000 };
+static const char16_t DELIMITERS [] = { DELIM_LF, 0x0000 };
 static const uint32_t DELIMITERS_LEN = 1;
 #endif
 
@@ -126,7 +126,7 @@ u_fsettransliterator(UFILE *file, UFileDirection direction,
     return old;
 }
 
-static const UChar * u_file_translit(UFILE *f, const UChar *src, int32_t *count, UBool flush)
+static const char16_t * u_file_translit(UFILE *f, const char16_t *src, int32_t *count, UBool flush)
 {
     int32_t newlen;
     int32_t junkCount = 0;
@@ -150,7 +150,7 @@ static const UChar * u_file_translit(UFILE *f, const UChar *src, int32_t *count,
     if(f->fTranslit->length > f->fTranslit->pos)
     {
         memmove(f->fTranslit->buffer, f->fTranslit->buffer + f->fTranslit->pos,
-            (f->fTranslit->length - f->fTranslit->pos)*sizeof(UChar));
+            (f->fTranslit->length - f->fTranslit->pos)*sizeof(char16_t));
     }
     f->fTranslit->length -= f->fTranslit->pos; /* always */
     f->fTranslit->pos = 0;
@@ -162,11 +162,11 @@ static const UChar * u_file_translit(UFILE *f, const UChar *src, int32_t *count,
     {
         if(f->fTranslit->buffer == nullptr)
         {
-            f->fTranslit->buffer = (UChar*)uprv_malloc(newlen * sizeof(UChar));
+            f->fTranslit->buffer = (char16_t*)uprv_malloc(newlen * sizeof(char16_t));
         }
         else
         {
-            f->fTranslit->buffer = (UChar*)uprv_realloc(f->fTranslit->buffer, newlen * sizeof(UChar));
+            f->fTranslit->buffer = (char16_t*)uprv_realloc(f->fTranslit->buffer, newlen * sizeof(char16_t));
         }
         /* Check for malloc/realloc failure. */
         if (f->fTranslit->buffer == nullptr) {
@@ -282,7 +282,7 @@ ufile_close_translit(UFILE *f)
 /* Input/output */
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_fputs(const UChar    *s,
+u_fputs(const char16_t *s,
         UFILE        *f)
 {
     int32_t count = u_file_write(s, u_strlen(s), f);
@@ -294,7 +294,7 @@ U_CAPI UChar32 U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001
 u_fputc(UChar32      uc,
         UFILE        *f)
 {
-    UChar buf[2];
+    char16_t buf[2];
     int32_t idx = 0;
     UBool isError = false;
 
@@ -307,7 +307,7 @@ u_fputc(UChar32      uc,
 
 
 U_CFUNC int32_t U_EXPORT2
-u_file_write_flush(const UChar *chars,
+u_file_write_flush(const char16_t *chars,
                    int32_t     count,
                    UFILE       *f,
                    UBool       flushIO,
@@ -315,9 +315,9 @@ u_file_write_flush(const UChar *chars,
 {
     /* Set up conversion parameters */
     UErrorCode  status       = U_ZERO_ERROR;
-    const UChar *mySource    = chars;
-    const UChar *mySourceBegin; 
-    const UChar *mySourceEnd;
+    const char16_t *mySource    = chars;
+    const char16_t *mySourceBegin;
+    const char16_t *mySourceEnd;
     char        charBuffer[UFILE_CHARBUFFER_SIZE];
     char        *myTarget   = charBuffer;
     int32_t     written      = 0;
@@ -392,7 +392,7 @@ u_file_write_flush(const UChar *chars,
 }
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_file_write(    const UChar     *chars,
+u_file_write(    const char16_t  *chars,
              int32_t        count,
              UFILE         *f)
 {
@@ -407,7 +407,7 @@ ufile_fill_uchar_buffer(UFILE *f)
     UErrorCode  status;
     const char  *mySource;
     const char  *mySourceEnd;
-    UChar       *myTarget;
+    char16_t    *myTarget;
     int32_t     bufferSize;
     int32_t     maxCPBytes;
     int32_t     bytesRead;
@@ -437,7 +437,7 @@ ufile_fill_uchar_buffer(UFILE *f)
     /* record how much buffer space is available */
     availLength = UFILE_UCHARBUFFER_SIZE - dataSize;
 
-    /* Determine the # of codepage bytes needed to fill our UChar buffer */
+    /* Determine the # of codepage bytes needed to fill our char16_t buffer */
     /* weiv: if converter is nullptr, we use invariant converter with charwidth = 1)*/
     maxCPBytes = availLength / (f->fConverter!=nullptr?(2*ucnv_getMinCharSize(f->fConverter)):1);
 
@@ -483,17 +483,17 @@ ufile_fill_uchar_buffer(UFILE *f)
     str->fLimit  = myTarget;
 }
 
-U_CAPI UChar* U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_fgets(UChar        *s,
+U_CAPI char16_t* U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
+u_fgets(char16_t     *s,
         int32_t       n,
         UFILE        *f)
 {
     int32_t dataSize;
     int32_t count;
-    UChar *alias;
-    const UChar *limit;
-    UChar *sItr;
-    UChar currDelim = 0;
+    char16_t *alias;
+    const char16_t *limit;
+    char16_t *sItr;
+    char16_t currDelim = 0;
     u_localized_string *str;
 
     if (n <= 0) {
@@ -587,7 +587,7 @@ u_fgets(UChar        *s,
 }
 
 U_CFUNC UBool U_EXPORT2
-ufile_getch(UFILE *f, UChar *ch)
+ufile_getch(UFILE *f, char16_t *ch)
 {
     UBool isValidChar = false;
 
@@ -610,10 +610,10 @@ ufile_getch(UFILE *f, UChar *ch)
     return isValidChar;
 }
 
-U_CAPI UChar U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
+U_CAPI char16_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_fgetc(UFILE        *f)
 {
-    UChar ch;
+    char16_t ch;
     ufile_getch(f, &ch);
     return ch;
 }
@@ -637,7 +637,7 @@ ufile_getch32(UFILE *f, UChar32 *c32)
         *c32 = *(str->fPos)++;
         if (U_IS_LEAD(*c32)) {
             if (str->fPos < str->fLimit) {
-                UChar c16 = *(str->fPos)++;
+                char16_t c16 = *(str->fPos)++;
                 *c32 = U16_GET_SUPPLEMENTARY(*c32, c16);
                 isValidChar = true;
             }
@@ -693,7 +693,7 @@ u_fungetc(UChar32        ch,
 }
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_file_read(    UChar        *chars,
+u_file_read(    char16_t     *chars,
     int32_t        count,
     UFILE         *f)
 {
@@ -717,7 +717,7 @@ u_file_read(    UChar        *chars,
         }
 
         /* copy the current data in the buffer */
-        memcpy(chars + read, str->fPos, dataSize * sizeof(UChar));
+        memcpy(chars + read, str->fPos, dataSize * sizeof(char16_t));
 
         /* update number of items read */
         read += dataSize;
index af8b36965dab054565a40d5f57904b801f3a19fb..fd783b3b2394f40f1cb8e66be79da567773ae2a9 100644 (file)
@@ -47,8 +47,8 @@ operator<<(STD_OSTREAM& stream, const UnicodeString& str)
         // use the default converter to convert chunks of text
         converter = u_getDefaultConverter(&errorCode);
         if(U_SUCCESS(errorCode)) {
-            const UChar *us = str.getBuffer();
-            const UChar *uLimit = us + str.length();
+            const char16_t *us = str.getBuffer();
+            const char16_t *uLimit = us + str.length();
             char *s, *sLimit = buffer + (sizeof(buffer) - 1);
             do {
                 errorCode = U_ZERO_ERROR;
@@ -78,7 +78,7 @@ operator>>(STD_ISTREAM& stream, UnicodeString& str)
     }
 
     /* ipfx should eat whitespace when ios::skipws is set */
-    UChar uBuffer[16];
+    char16_t uBuffer[16];
     char buffer[16];
     int32_t idx = 0;
     UConverter *converter;
@@ -87,11 +87,11 @@ operator>>(STD_ISTREAM& stream, UnicodeString& str)
     // use the default converter to convert chunks of text
     converter = u_getDefaultConverter(&errorCode);
     if(U_SUCCESS(errorCode)) {
-        UChar *us = uBuffer;
-        const UChar *uLimit = uBuffer + UPRV_LENGTHOF(uBuffer);
+        char16_t *us = uBuffer;
+        const char16_t *uLimit = uBuffer + UPRV_LENGTHOF(uBuffer);
         const char *s, *sLimit;
         char ch;
-        UChar ch32;
+        char16_t ch32;
         UBool initialWhitespace = true;
         UBool continueReading = true;
 
index 30e2e0715eb4ce5590d5125c9c787e91856acb2d..381749250368b8f31762dcd24e4a547f1b726b72 100644 (file)
@@ -50,9 +50,9 @@ int main( void )
 
     UnicodeString string("This is a test");
     /* lowercase = "istanbul" */ 
-    UChar lowercase[] = {0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0};
+    char16_t lowercase[] = {0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0};
     /* uppercase = "LATIN CAPITAL I WITH DOT ABOVE STANBUL" */  
-    UChar uppercase[] = {0x0130, 0x53, 0x54, 0x41, 0x4e, 0x42, 0x55, 0x4C, 0};
+    char16_t uppercase[] = {0x0130, 0x53, 0x54, 0x41, 0x4e, 0x42, 0x55, 0x4C, 0};
 
     UnicodeString upper(uppercase);
     UnicodeString lower(lowercase);
index b5ed7de83c5c854ff4b8443063ecd280cec90bbe..842d6e2b890b40788ea0d9795ce39ea0e660468a 100644 (file)
@@ -36,7 +36,7 @@ void printUnicodeString(const UnicodeString &s)
 void printUChar(UChar32 ch)
 {
     if(ch < 127) {
-        u_fprintf(out, "%C", (UChar) ch);
+        u_fprintf(out, "%C", (char16_t) ch);
     } else if (ch == CharacterIterator::DONE) {
         u_fprintf(out, "[CharacterIterator::DONE = 0xFFFF]");
     } else {
@@ -56,7 +56,7 @@ void Test::TestUChariter() {
         "to the aid of their country.";
 
     UnicodeString testString(testChars,"");
-    const UChar *testText = testString.getTerminatedBuffer();
+    const char16_t *testText = testString.getTerminatedBuffer();
 
     UCharCharacterIterator iter(testText, u_strlen(testText));
     UCharCharacterIterator* test2 = iter.clone();
@@ -80,7 +80,7 @@ void Test::TestUChariter() {
     // Demonstrates seeking forward using the iterator.
     u_fprintf(out, "Forward  = ");
 
-    UChar c = iter.first();
+    char16_t c = iter.first();
     printUChar(c);    // The first char
     int32_t i = 0;
 
@@ -123,7 +123,7 @@ void Test::TestStringiter() {
         "to the aid of their country.";
 
     UnicodeString testString(testChars,"");
-    const UChar *testText    = testString.getTerminatedBuffer();
+    const char16_t *testText    = testString.getTerminatedBuffer();
 
     StringCharacterIterator iter(testText, u_strlen(testText));
     StringCharacterIterator* test2 = iter.clone();
@@ -142,7 +142,7 @@ void Test::TestStringiter() {
 
     u_fprintf(out, "Backwards: ");
 
-    UChar c = iter.last();
+    char16_t c = iter.last();
     int32_t i = iter.endIndex();
 
     printUChar(c);
index b58ac877cca650cd7d5694114a2f05d4c2a0a27e..c524c71aec6771a47d550c8925182623ea5ab730 100644 (file)
@@ -142,8 +142,8 @@ UBool processOptions(int argc, const char **argv, OptSpec opts[])
  */
 int strcmp() 
 {
-       UChar source[100];
-       UChar target[100];
+       char16_t source[100];
+       char16_t target[100];
        u_unescape(opt_source, source, 100);
        u_unescape(opt_target, target, 100);
     UCollationResult result = ucol_strcoll(collator, source, -1, target, -1);
@@ -163,7 +163,7 @@ UBool processCollator()
 {
        // Set up an ICU collator
     UErrorCode status = U_ZERO_ERROR;
-       UChar rules[100];
+       char16_t rules[100];
 
     if (opt_rules != 0) {
                u_unescape(opt_rules, rules, 100);
index f7c2ade95ee656b6df2fc201eacb4beab29b9939..32d08eddd90522c2165be65f3a9362de4d0dc3bc 100644 (file)
@@ -40,7 +40,7 @@ UnicodeString escape(const UnicodeString &source) {
     UnicodeString target;
     target += "\"";
     for (i=0; i<source.length(); ++i) {
-        UChar ch = source[i];
+        char16_t ch = source[i];
         if (ch < 0x09 || (ch > 0x0A && ch < 0x20) || ch > 0x7E) {
             target += "\\u";
             appendHex(ch, 4, target);
index caff022ac2f45c80a52f1fee0b5712804718e263..172a22e440fc13f265fdc1bd64bf60ec9072890f 100644 (file)
  * Read the text from a file. The text must start with a Unicode Byte
  * Order Mark (BOM) so that we know what order to read the bytes in.
  */
-const UChar *UnicodeReader::readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount)
+const char16_t *UnicodeReader::readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount)
 {
     FILE *f;
     int32_t fileSize;
     
-    UChar *charBuffer;
+    char16_t *charBuffer;
     char *byteBuffer;
     char startBytes[4] = {'\xA5', '\xA5', '\xA5', '\xA5'};
     char errorMessage[128];
@@ -108,7 +108,7 @@ const UChar *UnicodeReader::readFile(const char *fileName, GUISupport *guiSuppor
     delete[] byteBuffer;
     
     charCount = myText.length();
-    charBuffer = LE_NEW_ARRAY(UChar, charCount + 1);
+    charBuffer = LE_NEW_ARRAY(char16_t, charCount + 1);
     if(charBuffer == 0) {
         sprintf(errorMessage,"Couldn't get memory for reading %s: %s \n", fileName, strerror(errno));
         guiSupport->postErrorMessage(errorMessage, "Text File Error");
index 2d7c9cc2fe55b339d148716e12bccf76f45cbe4c..6868f403b77bf7b8c3f84ae7407d15786e198a5b 100644 (file)
@@ -29,7 +29,7 @@ public:
         // nothing, too
     }
 
-    static const UChar *readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount);
+    static const char16_t *readFile(const char *fileName, GUISupport *guiSupport, int32_t &charCount);
 };
 
 #endif
index 4364a4a66250bbf70030f2a55bcb436790f55fc0..5bfc074f92dab6839c4f9cfac4175f61b5f2e0a3 100644 (file)
@@ -264,7 +264,7 @@ Paragraph *Paragraph::paragraphFactory(const char *fileName, const LEFontInstanc
 {
     LEErrorCode status  = LE_NO_ERROR;
     le_int32 charCount;
-    const UChar *text = UnicodeReader::readFile(fileName, guiSupport, charCount);
+    const char16_t *text = UnicodeReader::readFile(fileName, guiSupport, charCount);
     Paragraph *result = nullptr;
 
     if (text == nullptr) {
index 3e38b5a28a360ae65191edbea21ed1647ad97167..fd0345c6b73a5e88414cc1355114e1cf5d76d35a 100644 (file)
@@ -15,7 +15,7 @@
 
 U_CDECL_BEGIN
 
-const UChar *uc_readFile(const char *fileName, gs_guiSupport *guiSupport, int32_t *charCount)
+const char16_t *uc_readFile(const char *fileName, gs_guiSupport *guiSupport, int32_t *charCount)
 {
     return UnicodeReader::readFile(fileName, (GUISupport *) guiSupport, *charCount);
 }
index b377eacdc8d671c044777b67b13824a3fc7a7c74..1f82ecc619338859c28fa9f9e914202a44cac00e 100644 (file)
@@ -15,7 +15,7 @@
 
 U_CDECL_BEGIN
 
-const UChar *uc_readFile(const char *fileName, gs_guiSupport *guiSupport, int32_t *charCount);
+const char16_t *uc_readFile(const char *fileName, gs_guiSupport *guiSupport, int32_t *charCount);
 
 U_CDECL_END
 
index 21858dfb983b1f13a893d07a36eeee01d27c09b4..862080625e33cb1c75819a412f6600e7484326d1 100644 (file)
 #include "unicode/utypes.h"
 #include "unicode/ustring.h"
 
-extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxLen, uint8_t keys[][32]);
-extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]);
+extern "C" void test_current(char16_t data[][5], uint32_t size, uint32_t maxLen, uint8_t keys[][32]);
+extern "C" void test_legacy(char16_t data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]);
 
-void printZTUChar(const UChar *str) {
+void printZTUChar(const char16_t *str) {
   while(*str != 0) {
     if(*str > 0x1F && *str < 0x80) {
       fprintf(stdout, "%c", (*str) & 0xFF);
@@ -42,7 +42,7 @@ void printZTUChar(const UChar *str) {
   }
 }
 
-void printArray(const char* const comment, const UChar UArray[][5], int32_t arraySize) {
+void printArray(const char* const comment, const char16_t UArray[][5], int32_t arraySize) {
   fprintf (stdout, "%s\n", comment);
   int32_t i = 0;
   for(i = 0; i<arraySize; i++) {
@@ -89,7 +89,7 @@ int main(int, const char * const *) {
   };
 #endif
 
-  static UChar uTest[4][5];
+  static char16_t uTest[4][5];
 
   static uint8_t keys[4][32];
 
index 4eded7cbdf6d29beff7a26b84688746c7025edf4..6ca48835d93e6b422d4f8528b784c5cd72f5d81a 100644 (file)
@@ -30,7 +30,7 @@
 
 // Very simple example code - sticks a sortkey in the buffer
 // Not much error checking
-int32_t getSortKey_current(const char *locale, const UChar *string, int32_t sLen, uint8_t *buffer, int32_t bLen) {
+int32_t getSortKey_current(const char *locale, const char16_t *string, int32_t sLen, uint8_t *buffer, int32_t bLen) {
   UErrorCode status = U_ZERO_ERROR;
   UCollator *coll = ucol_open(locale, &status);
   if(U_FAILURE(status)) {
@@ -47,7 +47,7 @@ static UCollator *compareCollator = nullptr;
 
 int compare_current(const void *string1, const void *string2) {
   if(compareCollator != nullptr) {
-    UCollationResult res = ucol_strcoll(compareCollator, (UChar *) string1, -1, (UChar *) string2, -1);
+    UCollationResult res = ucol_strcoll(compareCollator, (char16_t *) string1, -1, (char16_t *) string2, -1);
     if(res == UCOL_LESS) {
       return -1;
     } else if(res == UCOL_GREATER) {
@@ -71,7 +71,7 @@ void closeCollator_current(void) {
 }
 
 
-extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]) {
+extern "C" void test_current(char16_t data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[][32]) {
   uint32_t i = 0;
   int32_t keySize = 0;
   UVersionInfo uvi;
@@ -87,7 +87,7 @@ extern "C" void test_current(UChar data[][5], uint32_t size, uint32_t maxlen, ui
   fprintf(stderr, "Done sortkeys, doing qsort test\n");
   
   initCollator_current("ja");
-  qsort(data, size, maxlen*sizeof(UChar), compare_current);
+  qsort(data, size, maxlen*sizeof(char16_t), compare_current);
   closeCollator_current();
 
   fprintf(stderr, "Done current!\n");
index ba3e3b1e32279f028b255e5e3aac8be3c051f6cb..3dcb9c3b59d9be17ed630f3090cb74db2840bc5f 100644 (file)
@@ -31,7 +31,7 @@
 
 // Very simple example code - sticks a sortkey in the buffer
 // Not much error checking
-int32_t getSortKey_legacy(const char *locale, const UChar *string, int32_t sLen, uint8_t *buffer, int32_t bLen) {
+int32_t getSortKey_legacy(const char *locale, const char16_t *string, int32_t sLen, uint8_t *buffer, int32_t bLen) {
   UErrorCode status = U_ZERO_ERROR;
   UCollator *coll = ucol_open(locale, &status);
   if(U_FAILURE(status)) {
@@ -48,7 +48,7 @@ static UCollator *compareCollator = nullptr;
 
 int compare_legacy(const void *string1, const void *string2) {
   if(compareCollator != nullptr) {
-    UCollationResult res = ucol_strcoll(compareCollator, (UChar *) string1, -1, (UChar *) string2, -1);
+    UCollationResult res = ucol_strcoll(compareCollator, (char16_t *) string1, -1, (char16_t *) string2, -1);
     if(res == UCOL_LESS) {
       return -1;
     } else if(res == UCOL_GREATER) {
@@ -87,7 +87,7 @@ void closeCollator_legacy(void) {
 }
 
 
-extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[4][32]) {
+extern "C" void test_legacy(char16_t data[][5], uint32_t size, uint32_t maxlen, uint8_t keys[4][32]) {
   uint32_t i = 0;
   int32_t keySize = 0;
 
@@ -104,7 +104,7 @@ extern "C" void test_legacy(UChar data[][5], uint32_t size, uint32_t maxlen, uin
   fprintf(stderr, "Done sortkeys, doing qsort test\n");
 
   initCollator_legacy("ja");
-  qsort(data, size, maxlen*sizeof(UChar), compare_legacy);
+  qsort(data, size, maxlen*sizeof(char16_t), compare_legacy);
   closeCollator_legacy();
 
   fprintf(stderr, "Done legacy!\n");
index 8d5fdf3d9608c4d84045aeac610bb0b3bd5296d4..72aa7445cb692fbce632934e1447dab6b81bcc96 100644 (file)
@@ -40,7 +40,7 @@ UnicodeString escape(const UnicodeString &source) {
     UnicodeString target;
     target += "\"";
     for (i=0; i<source.length(); ++i) {
-        UChar ch = source[i];
+        char16_t ch = source[i];
         if (ch < 0x09 || (ch > 0x0A && ch < 0x20) || ch > 0x7E) {
             target += "\\u";
             appendHex(ch, 4, target);
index 059a011460e13a6c1f652576f42520f892eb5097..ad9df5e6589820370e96411ff30cda96ffb92de5 100644 (file)
@@ -145,7 +145,7 @@ setNumberFormatCurrency_2_4(NumberFormat &nf, const char *currency, UErrorCode &
         double roundingIncrement;
 
         // Unicode string with the desired currency display symbol or name
-        UChar symbol[16];
+        char16_t symbol[16];
     } currencyMap[]={
         { "USD", 2, 0.0, { 0x24, 0 } },
         { "GBP", 2, 0.0, { 0xa3, 0 } },
@@ -201,7 +201,7 @@ setNumberFormatCurrency_2_6(NumberFormat &nf, const char *currency, UErrorCode &
     }
 
     // invariant-character conversion to UChars (see utypes.h and putil.h)
-    UChar uCurrency[4];
+    char16_t uCurrency[4];
     u_charsToUChars(currency, uCurrency, 4);
 
     // set the currency
@@ -269,7 +269,7 @@ showCurrencyFormatting(UBool useICU26API) {
             // output=formatted currency value
             output.remove();
             nf->format(12345678.93, output);
-            output+=(UChar)0x0a; // '\n'
+            output+=(char16_t)0x0a; // '\n'
             uprintf(output);
         }
     }
index e67b6d20c41b7aefd66dcce6e0bd718d2b930a5a..7d9640d0317530ee7564ecf4c4b3ae5f1a0a0b56 100644 (file)
@@ -44,7 +44,7 @@ static UnicodeString& appendHex(uint32_t number,
     uint32_t digit;
     while (digits > 0) {
         digit = (number >> ((--digits) * 4)) & 0xF;
-        target += (UChar)(digit < 10 ? 0x30 + digit : 0x41 - 10 + digit);
+        target += (char16_t)(digit < 10 ? 0x30 + digit : 0x41 - 10 + digit);
     }
     return target;
 }
@@ -53,17 +53,17 @@ static UnicodeString& appendHex(uint32_t number,
 UnicodeString escape(const UnicodeString &source) {
     int32_t i;
     UnicodeString target;
-    target += (UChar)U_DQUOTE;
+    target += (char16_t)U_DQUOTE;
     for (i=0; i<source.length(); ++i) {
-        UChar ch = source[i];
+        char16_t ch = source[i];
         if (ch < 0x09 || (ch > 0x0D && ch < 0x20) || ch > 0x7E) {
-            (target += (UChar)U_BACKSLASH) += (UChar)U_SMALL_U;
+            (target += (char16_t)U_BACKSLASH) += (char16_t)U_SMALL_U;
             appendHex(ch, 4, target);
         } else {
             target += ch;
         }
     }
-    target += (UChar)U_DQUOTE;
+    target += (char16_t)U_DQUOTE;
     return target;
 }
 
@@ -110,19 +110,19 @@ UnicodeString formattableToString(const Formattable& f) {
             return UnicodeString(buf, "");
         }
     case Formattable::kString:
-        return UnicodeString((UChar)U_DQUOTE).append(f.getString()).append((UChar)U_DQUOTE);
+        return UnicodeString((char16_t)U_DQUOTE).append(f.getString()).append((char16_t)U_DQUOTE);
     case Formattable::kArray:
         {
             int32_t i, count;
             const Formattable* array = f.getArray(count);
-            UnicodeString result((UChar)U_LEFT_SQUARE_BRACKET);
+            UnicodeString result((char16_t)U_LEFT_SQUARE_BRACKET);
             for (i=0; i<count; ++i) {
                 if (i > 0) {
-                    (result += (UChar)U_COMMA) += (UChar)U_SPACE;
+                    (result += (char16_t)U_COMMA) += (char16_t)U_SPACE;
                 }
                 result += formattableToString(array[i]);
             }
-            result += (UChar)U_RIGHT_SQUARE_BRACKET;
+            result += (char16_t)U_RIGHT_SQUARE_BRACKET;
             return result;
         }
     default:
index 483b5bff983be6554e15d27abf94550d4d1a9e52..3c2e7eb051517bddad63aaeb1d1ae67983cacd4d 100644 (file)
@@ -63,9 +63,9 @@ char const *opt_source      = "International Components for Unicode";
 char const *opt_pattern     = "Unicode";
 UCollator * collator   = 0;
 UStringSearch * search = 0;
-UChar rules[100];
-UChar source[100];
-UChar pattern[100];
+char16_t rules[100];
+char16_t source[100];
+char16_t pattern[100];
 
 /** 
  * Definitions for the command line options
index de5dd47ff6cfd0622efa1bf7ca661d920c6cc8c5..d18c1868d55b401d5c27f75da006f2767c6943cc 100644 (file)
@@ -26,7 +26,7 @@ UnaccentTransliterator::~UnaccentTransliterator() {
 /**
  * Remove accents from a character using Normalizer.
  */
-UChar UnaccentTransliterator::unaccent(UChar c) const {
+char16_t UnaccentTransliterator::unaccent(char16_t c) const {
     UnicodeString str(c);
     UErrorCode status = U_ZERO_ERROR;
     UnaccentTransliterator* t = (UnaccentTransliterator*)this;
@@ -35,7 +35,7 @@ UChar UnaccentTransliterator::unaccent(UChar c) const {
     if (U_FAILURE(status)) {
         return c;
     }
-    return (UChar) t->normalizer.next();
+    return (char16_t) t->normalizer.next();
 }
 
 /**
@@ -46,8 +46,8 @@ void UnaccentTransliterator::handleTransliterate(Replaceable& text,
                                                  UBool incremental) const {
     UnicodeString str("a");
     while (index.start < index.limit) {
-        UChar c = text.charAt(index.start);
-        UChar d = unaccent(c);
+        char16_t c = text.charAt(index.start);
+        char16_t d = unaccent(c);
         if (c != d) {
             str.setCharAt(0, d);
             text.handleReplaceBetween(index.start, index.start+1, str);
index 12fc36866f74745365cbd1f50d3aa552ff45c8cd..a2cf7a340c8843f382b5706201cc13c95bffbbe5 100644 (file)
@@ -39,7 +39,7 @@ class UnaccentTransliterator : public Transliterator {
     /**
      * Unaccent a single character using normalizer.
      */
-    UChar unaccent(UChar c) const;
+    char16_t unaccent(char16_t c) const;
 
     Normalizer normalizer;
 };
index 0a1ff273c5a8600d25501998245527c185d51312..b191326a92a9d15de32918fa792c6461e1eb831f 100644 (file)
@@ -29,7 +29,7 @@ UnaccentTransliterator::~UnaccentTransliterator() {
 /**
  * Remove accents from a character using Normalizer.
  */
-UChar UnaccentTransliterator::unaccent(UChar c) const {
+char16_t UnaccentTransliterator::unaccent(char16_t c) const {
     UnicodeString str(c);
     UErrorCode status = U_ZERO_ERROR;
     UnaccentTransliterator* t = (UnaccentTransliterator*)this;
@@ -38,7 +38,7 @@ UChar UnaccentTransliterator::unaccent(UChar c) const {
     if (U_FAILURE(status)) {
         return c;
     }
-    return (UChar) t->normalizer.next();
+    return (char16_t) t->normalizer.next();
 }
 
 /**
@@ -49,8 +49,8 @@ void UnaccentTransliterator::handleTransliterate(Replaceable& text,
                                                  UBool incremental) const {
     UnicodeString str("a");
     while (index.start < index.limit) {
-        UChar c = text.charAt(index.start);
-        UChar d = unaccent(c);
+        char16_t c = text.charAt(index.start);
+        char16_t d = unaccent(c);
         if (c != d) {
             str.setCharAt(0, d);
             text.handleReplaceBetween(index.start, index.start+1, str);
index bb780394c99dfffbf72f6f68cc38582630080fee..dd14de48eb2acfabf3f43baa6ec6b441e8a70c70 100644 (file)
@@ -41,7 +41,7 @@ class UnaccentTransliterator : public Transliterator {
     /**
      * Unaccent a single character using normalizer.
      */
-    UChar unaccent(UChar c) const;
+    char16_t unaccent(char16_t c) const;
 
     Normalizer normalizer;
 
index 9fa11b2f9ff6df3fac89b5a3079db2b46f799016..db2b4dbb63a679d1abf0b40777d3836eedae344c 100644 (file)
@@ -40,7 +40,7 @@ UnicodeString escape(const UnicodeString &source) {
     UnicodeString target;
     target += "\"";
     for (i=0; i<source.length(); ++i) {
-        UChar ch = source[i];
+        char16_t ch = source[i];
         if (ch < 0x09 || (ch > 0x0A && ch < 0x20) || ch > 0x7E) {
             target += "\\u";
             appendHex(ch, 4, target);
index 543b9482da2807f4d48b96abf7b9a29b530debc1..45a6876180e6a8498ed4805b6dfa768e930151c7 100644 (file)
 #define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
 #endif
 
-static const UChar kNone[] = { 0x0000 };
+static const char16_t kNone[] = { 0x0000 };
 
 #define U_ASSERT(x)  { if(U_FAILURE(x)) {fflush(stdout);fflush(stderr); fprintf(stderr, #x " == %s\n", u_errorName(x)); assert(U_SUCCESS(x)); }}
 
-/* Print a UChar if possible, in seven characters. */
-void prettyPrintUChar(UChar c)
+/* Print a char16_t if possible, in seven characters. */
+void prettyPrintUChar(char16_t c)
 {
   if(  (c <= 0x007F) &&
        (isgraph(c))  ) {
@@ -95,7 +95,7 @@ void prettyPrintUChar(UChar c)
 
 
 void printUChars(const char  *name = "?", 
-                 const UChar *uch  = kNone,
+                 const char16_t *uch  = kNone,
                  int32_t     len   = -1 )
 {
   int32_t i;
@@ -162,7 +162,7 @@ void printUChar(UChar32 ch32)
       printf("ch: U+%06X\n", ch32);
     }
     else {
-      UChar ch = (UChar)ch32;
+      char16_t ch = (char16_t)ch32;
       printUChars("C", &ch, 1);
     }
 }
@@ -171,7 +171,7 @@ void printUChar(UChar32 ch32)
   Very simple C sample to convert the word 'Moscow' in Russian in Unicode,
   followed by an exclamation mark (!) into the KOI8-R Russian code page.
 
-  This example first creates a UChar String out of the Unicode chars.
+  This example first creates a char16_t String out of the Unicode chars.
 
   targetSize must be set to the amount of space available in the target
   buffer. After fromUChars is called, 
@@ -206,7 +206,7 @@ UErrorCode convsample_02()
 
   // **************************** START SAMPLE *******************
   // "cat<cat>OK"
-  UChar source[] = { 0x041C, 0x043E, 0x0441, 0x043A, 0x0432,
+  char16_t source[] = { 0x041C, 0x043E, 0x0441, 0x043A, 0x0432,
                      0x0430, 0x0021, 0x0000 };
   char target[100];
   UErrorCode status = U_ZERO_ERROR;
@@ -301,10 +301,10 @@ UErrorCode convsample_05()
   char inBuf[BUFFERSIZE];
   const char *source;
   const char *sourceLimit;
-  UChar *uBuf;
-  UChar *target;
-  UChar *targetLimit;
-  UChar *p;
+  char16_t *uBuf;
+  char16_t *target;
+  char16_t *targetLimit;
+  char16_t *p;
   int32_t uBufSize = 0;
   UConverter *conv;
   UErrorCode status = U_ZERO_ERROR;
@@ -324,7 +324,7 @@ UErrorCode convsample_05()
   uBufSize = (BUFFERSIZE/ucnv_getMinCharSize(conv));
   printf("input bytes %d / min chars %d = %d UChars\n",
          BUFFERSIZE, ucnv_getMinCharSize(conv), uBufSize);
-  uBuf = (UChar*)malloc(uBufSize * sizeof(UChar));
+  uBuf = (char16_t*)malloc(uBufSize * sizeof(char16_t));
   assert(uBuf!=nullptr);
 
   // grab another buffer's worth
@@ -501,7 +501,7 @@ UErrorCode convsample_06()
       printf("% 5d U+%06X ", info[p].frequency, p);
       if(p <= 0xFFFF)
       {
-        prettyPrintUChar((UChar)p);
+        prettyPrintUChar((char16_t)p);
       }
       printf("\n");
     }
@@ -533,7 +533,7 @@ UErrorCode convsample_12()
   // **************************** START SAMPLE *******************
 
   char source[] = { 0x63, 0x61, 0x74, (char)0x94, 0x4C, (char)0x82, 0x6E, (char)0x82, 0x6A, 0x00 };
-  UChar target[100];
+  char16_t target[100];
   UErrorCode status = U_ZERO_ERROR;
   UConverter *conv;
   int32_t     len;
@@ -620,7 +620,7 @@ UErrorCode convsample_13()
 
 UBool convsample_20_didSubstitute(const char *source)
 {
-  UChar uchars[100];
+  char16_t uchars[100];
   char bytes[100];
   UConverter *conv = nullptr;
   UErrorCode status = U_ZERO_ERROR;
@@ -714,7 +714,7 @@ UErrorCode convsample_20()
 
 UBool convsample_21_didSubstitute(const char *source)
 {
-  UChar uchars[100];
+  char16_t uchars[100];
   char bytes[100];
   UConverter *conv = nullptr, *cloneCnv = nullptr;
   UErrorCode status = U_ZERO_ERROR;
@@ -880,9 +880,9 @@ UErrorCode convsample_40()
   char inBuf[BUFFERSIZE];
   const char *source;
   const char *sourceLimit;
-  UChar *uBuf;
-  UChar *target;
-  UChar *targetLimit;
+  char16_t *uBuf;
+  char16_t *target;
+  char16_t *targetLimit;
   int32_t uBufSize = 0;
   UConverter *conv = nullptr;
   UErrorCode status = U_ZERO_ERROR;
@@ -910,7 +910,7 @@ UErrorCode convsample_40()
   uBufSize = (BUFFERSIZE/ucnv_getMinCharSize(conv));
   printf("input bytes %d / min chars %d = %d UChars\n",
          BUFFERSIZE, ucnv_getMinCharSize(conv), uBufSize);
-  uBuf = (UChar*)malloc(uBufSize * sizeof(UChar));
+  uBuf = (char16_t*)malloc(uBufSize * sizeof(char16_t));
   assert(uBuf!=nullptr);
 
   // grab another buffer's worth
@@ -981,9 +981,9 @@ UErrorCode convsample_46()
   FILE *f;
   FILE *out;
   int32_t count;
-  UChar inBuf[BUFFERSIZE];
-  const UChar *source;
-  const UChar *sourceLimit;
+  char16_t inBuf[BUFFERSIZE];
+  const char16_t *source;
+  const char16_t *sourceLimit;
   char *buf;
   char *target;
   char *targetLimit;
@@ -1020,7 +1020,7 @@ UErrorCode convsample_46()
 
   // grab another buffer's worth
   while((!feof(f)) && 
-        ((count=static_cast<int32_t>(fread(inBuf, sizeof(UChar), BUFFERSIZE , f))) > 0) )
+        ((count=static_cast<int32_t>(fread(inBuf, sizeof(char16_t), BUFFERSIZE , f))) > 0) )
   {
     inchars += count;
 
@@ -1058,7 +1058,7 @@ UErrorCode convsample_46()
     } while (source < sourceLimit); // while simply out of space
   }
 
-  printf("%d Uchars (%d bytes) in, %d chars out.\n", inchars, static_cast<int>(inchars * sizeof(UChar)), total);
+  printf("%d Uchars (%d bytes) in, %d chars out.\n", inchars, static_cast<int>(inchars * sizeof(char16_t)), total);
   
   // ***************************** END SAMPLE ********************
   ucnv_close(conv);
@@ -1084,8 +1084,8 @@ void convsample_50() {
   int32_t signatureLength = 0;
   const char *encoding = ucnv_detectUnicodeSignature(input,sizeof(input),&signatureLength,&err);
   UConverter *conv = nullptr;
-  UChar output[100];
-  UChar *target = output, *out;
+  char16_t output[100];
+  char16_t *target = output, *out;
   const char *source = input;
   if(encoding!=nullptr && U_SUCCESS(err)){
     // should signature be discarded ?
index b19534395b5e4a0b488b613d9bbc16ccd98017a8..ede3baec9640e4e3faf3a4f6faa8199ba9f130bb 100644 (file)
@@ -52,7 +52,7 @@ UBool      displayLineNum  = false;
 const char *fileName;      
 int         fileLen;              // Length, in UTF-16 Code Units.  
 
-UChar      *ucharBuf = 0;         // Buffer, holds converted file.  (Simple minded program, always reads
+char16_t   *ucharBuf = 0;         // Buffer, holds converted file.  (Simple minded program, always reads
                                   //   the whole file at once.
 
 char       *charBuf = 0;          // Buffer, for original, unconverted file data.
@@ -329,7 +329,7 @@ void readFile(const char *name) {
     }
 
     //
-    // Convert the file data to UChar.
+    // Convert the file data to char16_t.
     //  Preflight first to determine required buffer size.
     //
     uint32_t destCap = ucnv_toUChars(conv,
@@ -344,7 +344,7 @@ void readFile(const char *name) {
     };
     
     status = U_ZERO_ERROR;
-    ucharBuf = (UChar *)realloc(ucharBuf, (destCap+1) * sizeof(UChar));
+    ucharBuf = (char16_t *)realloc(ucharBuf, (destCap+1) * sizeof(char16_t));
     ucnv_toUChars(conv,
         ucharBuf,           //  dest,
         destCap+1,
@@ -390,7 +390,7 @@ void nextLine(int  startPos) {
         if (lineEnd >= fileLen) {
             return;
         }
-        UChar c = ucharBuf[lineEnd];
+        char16_t c = ucharBuf[lineEnd];
         lineEnd++;
         if (c == 0x0a   ||       // Line Feed
             c == 0x0c   ||       // Form Feed
index e4dd124ce5794cc6a3adc7af11227cc5b8732419..519831605c0a39f3f8c21192c0a6affd1f7e6370 100644 (file)
@@ -46,7 +46,7 @@ using namespace icu;
 static UConverter *cnv=nullptr;
 
 static void
-printUString(const char *announce, const UChar *s, int32_t length) {
+printUString(const char *announce, const char16_t *s, int32_t length) {
     static char out[200];
     UChar32 c;
     int32_t i;
@@ -113,7 +113,7 @@ printUnicodeString(const char *announce, const UnicodeString &s) {
 
 static void
 demo_utf_h_macros() {
-    static UChar input[]={ 0x0061, 0xd800, 0xdc00, 0xdbff, 0xdfff, 0x0062 };
+    static char16_t input[]={ 0x0061, 0xd800, 0xdc00, 0xdbff, 0xdfff, 0x0062 };
     UChar32 c;
     int32_t i;
     UBool isError;
@@ -158,10 +158,10 @@ demo_utf_h_macros() {
 static void demo_C_Unicode_strings() {
     printf("\n* demo_C_Unicode_strings() --------- ***\n\n");
 
-    static const UChar text[]={ 0x41, 0x42, 0x43, 0 };          /* "ABC" */
-    static const UChar appendText[]={ 0x61, 0x62, 0x63, 0 };    /* "abc" */
-    static const UChar cmpText[]={ 0x61, 0x53, 0x73, 0x43, 0 }; /* "aSsC" */
-    UChar buffer[32];
+    static const char16_t text[]={ 0x41, 0x42, 0x43, 0 };          /* "ABC" */
+    static const char16_t appendText[]={ 0x61, 0x62, 0x63, 0 };    /* "abc" */
+    static const char16_t cmpText[]={ 0x61, 0x53, 0x73, 0x43, 0 }; /* "aSsC" */
+    char16_t buffer[32];
     int32_t compare;
     int32_t length=u_strlen(text); /* length=3 */
 
@@ -200,13 +200,13 @@ static void demoCaseMapInC() {
      *   "<sharp s> <small lig. ffi>"
      *   "<small final sigma><small sigma><capital sigma>"
      */
-    static const UChar input[]={
+    static const char16_t input[]={
         0x61, 0x42, 0x3a3,
         0x69, 0x49, 0x131, 0x130, 0x20,
         0xdf, 0x20, 0xfb03,
         0x3c2, 0x3c3, 0x3a3, 0
     };
-    UChar buffer[32];
+    char16_t buffer[32];
 
     UErrorCode errorCode;
     UChar32 c;
@@ -372,7 +372,7 @@ static void demoCaseMapInCPlusPlus() {
      *   "<sharp s> <small lig. ffi>"
      *   "<small final sigma><small sigma><capital sigma>"
      */
-    static const UChar input[]={
+    static const char16_t input[]={
         0x61, 0x42, 0x3a3,
         0x69, 0x49, 0x131, 0x130, 0x20,
         0xdf, 0x20, 0xfb03,
@@ -413,10 +413,10 @@ static void demoCaseMapInCPlusPlus() {
 
 // sample code for UnicodeString storage models ----------------------------- ***
 
-static const UChar readonly[]={
+static const char16_t readonly[]={
     0x61, 0x31, 0x20ac
 };
-static UChar writeable[]={
+static char16_t writeable[]={
     0x62, 0x32, 0xdbc0, 0xdc01 // includes a surrogate pair for a supplementary code point
 };
 static char out[100];
@@ -454,7 +454,7 @@ demoUnicodeStringStorage() {
     two=one;
     printf("length of longer string copy: %d\n", two.length());
 
-    // * UnicodeString using readonly-alias to a const UChar array
+    // * UnicodeString using readonly-alias to a const char16_t array
     // construct a string that aliases a readonly buffer
     UnicodeString three(false, readonly, UPRV_LENGTHOF(readonly));
     printUnicodeString("readonly-alias string: ", three);
@@ -480,7 +480,7 @@ demoUnicodeStringStorage() {
     printf("verify that a regular copy of a readonly alias uses a different buffer pointer: %d (should be 0)\n",
         one.getBuffer()==two.getBuffer());
 
-    // * UnicodeString using writeable-alias to a non-const UChar array
+    // * UnicodeString using writeable-alias to a non-const char16_t array
     UnicodeString four(writeable, UPRV_LENGTHOF(writeable), UPRV_LENGTHOF(writeable));
     printUnicodeString("writeable-alias string: ", four);
     // a modification writes through to the buffer
@@ -501,7 +501,7 @@ demoUnicodeStringStorage() {
     one.setTo(writeable, UPRV_LENGTHOF(writeable), UPRV_LENGTHOF(writeable));
     // grow the string - it will not fit into the backing buffer any more
     // and will get copied before modification
-    one.append((UChar)0x40);
+    one.append((char16_t)0x40);
     // shrink it back so it would fit
     one.truncate(one.length()-1);
     // we still operate on the copy
@@ -538,9 +538,9 @@ demoUnicodeStringInit() {
     UnicodeString invariantOnly=UNICODE_STRING("such characters are safe 123 %-.", 32);
 
     /*
-     * In C, we need two macros: one to declare the UChar[] array, and
+     * In C, we need two macros: one to declare the char16_t[] array, and
      * one to populate it; the second one is a noop on platforms where
-     * wchar_t is compatible with UChar and ASCII-based.
+     * wchar_t is compatible with char16_t and ASCII-based.
      * The length of the string literal must be counted for both macros.
      */
     /* declare the invString array for the string */
@@ -552,15 +552,15 @@ demoUnicodeStringInit() {
     printf("C and C++ Unicode strings are equal: %d\n", invariantOnly==UnicodeString(true, invString, 32));
 
     /*
-     * convert between char * and UChar * strings that
+     * convert between char * and char16_t * strings that
      * contain only invariant characters
      */
     static const char *cs1="such characters are safe 123 %-.";
-    static UChar us1[40];
+    static char16_t us1[40];
     static char cs2[40];
     u_charsToUChars(cs1, us1, 33); /* include the terminating NUL */
     u_UCharsToChars(us1, cs2, 33);
-    printf("char * -> UChar * -> char * with only "
+    printf("char * -> char16_t * -> char * with only "
            "invariant characters: \"%s\"\n",
            cs2);
 
@@ -575,9 +575,9 @@ demoUnicodeStringInit() {
 
     /*
      * C: convert and unescape a char * string with only invariant
-     * characters to fill a UChar * string
+     * characters to fill a char16_t * string
      */
-    UChar buffer[200];
+    char16_t buffer[200];
     int32_t length;
     length=u_unescape(
         "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n",
index 3f336612426c206d63d1971a25836152d5c30425..7920540a357d2c162a8ee79f004ad53d0e3d8f68 100644 (file)
@@ -37,7 +37,7 @@ extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = {
 #endif
 
         U_CHARSET_FAMILY,
-        sizeof(UChar),   
+        sizeof(char16_t),
         0,               /* reserved      */
         {                /* data format identifier */
            0x54, 0x6f, 0x43, 0x50}, /* "ToCP" */
index 4cf4ceaf4becbda7c78dc1487825200d83b9ead4..ca03cc3b2905d01fa833503554fe26d98e3464f6 100644 (file)
@@ -15,8 +15,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   UParseError pe = { 0 };
   UErrorCode status = U_ZERO_ERROR;
 
-  URegularExpression* re = uregex_open(reinterpret_cast<const UChar*>(data),
-                                       static_cast<int>(size) / sizeof(UChar),
+  URegularExpression* re = uregex_open(reinterpret_cast<const char16_t*>(data),
+                                       static_cast<int>(size) / sizeof(char16_t),
                                        0, &pe, &status);
 
   if (re)
index db14de4bec4e09c931a4406ea25d440126d82431..26a63d115eeb369e4cf44dba918c37b9cee73331 100644 (file)
@@ -9,7 +9,7 @@
 //   file:  alphaindextst.cpp
 //          Alphabetic Index Tests.
 //
-//   Note: please... no character literals cast to UChars.. use (UChar)0xZZZZ
+//   Note: please... no character literals cast to UChars.. use (char16_t)0xZZZZ
 
 #include <stdio.h>  // for snprintf
 
@@ -36,7 +36,7 @@ UnicodeString joinLabelsAndAppend(AlphabeticIndex::ImmutableIndex &index, Unicod
     const AlphabeticIndex::Bucket *bucket;
     for (int32_t i = 0; (bucket = index.getBucket(i)) != nullptr; ++i) {
         if (dest.length() > oldLength) {
-            dest.append((UChar)0x3A);  // ':'
+            dest.append((char16_t)0x3A);  // ':'
         }
         dest.append(bucket->getLabel());
     }
@@ -284,7 +284,7 @@ void AlphabeticIndexTest::APITest() {
         } else if (i <= 26) {
             // Labels A - Z for English locale
             TEST_ASSERT(type == U_ALPHAINDEX_NORMAL);
-            UnicodeString expectedLabel((UChar)(0x40 + i));
+            UnicodeString expectedLabel((char16_t)(0x40 + i));
             TEST_ASSERT(expectedLabel == label);
         } else if (i == 27) {
             TEST_ASSERT(type == U_ALPHAINDEX_OVERFLOW);
@@ -571,16 +571,16 @@ void AlphabeticIndexTest::TestHaniFirst() {
     assertEquals("getBucketCount()", 1, index.getBucketCount(status));   // ... (underflow only)
     index.addLabels(Locale::getEnglish(), status);
     assertEquals("getBucketCount()", 28, index.getBucketCount(status));  // ... A-Z ...
-    int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x897f), status);
+    int32_t bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0x897f), status);
     assertEquals("getBucketIndex(U+897F)", 0, bucketIndex);  // underflow bucket
     bucketIndex = index.getBucketIndex("i", status);
     assertEquals("getBucketIndex(i)", 9, bucketIndex);
-    bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status);
+    bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0x03B1), status);
     assertEquals("getBucketIndex(Greek alpha)", 27, bucketIndex);
     // U+50005 is an unassigned code point which sorts at the end, independent of the Hani group.
     bucketIndex = index.getBucketIndex(UnicodeString((UChar32)0x50005), status);
     assertEquals("getBucketIndex(U+50005)", 27, bucketIndex);
-    bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status);
+    bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0xFFFF), status);
     assertEquals("getBucketIndex(U+FFFF)", 27, bucketIndex);
 }
 
@@ -600,16 +600,16 @@ void AlphabeticIndexTest::TestPinyinFirst() {
     assertEquals("getBucketCount()", 28, index.getBucketCount(status));   // ... A-Z ...
     index.addLabels(Locale::getChinese(), status);
     assertEquals("getBucketCount()", 28, index.getBucketCount(status));  // ... A-Z ...
-    int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x897f), status);
-    assertEquals("getBucketIndex(U+897F)", (int32_t)((UChar)0x0058/*X*/ - (UChar)0x0041/*A*/ + 1), bucketIndex);
+    int32_t bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0x897f), status);
+    assertEquals("getBucketIndex(U+897F)", (int32_t)((char16_t)0x0058/*X*/ - (char16_t)0x0041/*A*/ + 1), bucketIndex);
     bucketIndex = index.getBucketIndex("i", status);
     assertEquals("getBucketIndex(i)", 9, bucketIndex);
-    bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status);
+    bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0x03B1), status);
     assertEquals("getBucketIndex(Greek alpha)", (int32_t)27, bucketIndex);
     // U+50005 is an unassigned code point which sorts at the end, independent of the Hani group.
     bucketIndex = index.getBucketIndex(UnicodeString((UChar32)0x50005), status);
     assertEquals("getBucketIndex(U+50005)", 27, bucketIndex);
-    bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status);
+    bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0xFFFF), status);
     assertEquals("getBucketIndex(U+FFFF)", 27, bucketIndex);
 }
 
@@ -663,9 +663,9 @@ void AlphabeticIndexTest::TestNoLabels() {
     TEST_CHECK_STATUS;
     AlphabeticIndex index(coll.orphan(), status);
     TEST_CHECK_STATUS;
-    index.addRecord(UnicodeString((UChar)0x897f), nullptr, status);
+    index.addRecord(UnicodeString((char16_t)0x897f), nullptr, status);
     index.addRecord("i", nullptr, status);
-    index.addRecord(UnicodeString((UChar)0x03B1), nullptr, status);
+    index.addRecord(UnicodeString((char16_t)0x03B1), nullptr, status);
     assertEquals("getBucketCount()", 1, index.getBucketCount(status));  // ...
     TEST_ASSERT(index.nextBucket(status));
     assertEquals("underflow label type", (int32_t)U_ALPHAINDEX_UNDERFLOW, index.getBucketLabelType());
@@ -680,11 +680,11 @@ void AlphabeticIndexTest::TestChineseZhuyin() {
     LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status));
     TEST_CHECK_STATUS; 
     assertEquals("getBucketCount()", 38, immIndex->getBucketCount());
-    assertEquals("label 1", UnicodeString((UChar)0x3105), immIndex->getBucket(1)->getLabel());
-    assertEquals("label 2", UnicodeString((UChar)0x3106), immIndex->getBucket(2)->getLabel());
-    assertEquals("label 3", UnicodeString((UChar)0x3107), immIndex->getBucket(3)->getLabel());
-    assertEquals("label 4", UnicodeString((UChar)0x3108), immIndex->getBucket(4)->getLabel());
-    assertEquals("label 5", UnicodeString((UChar)0x3109), immIndex->getBucket(5)->getLabel());
+    assertEquals("label 1", UnicodeString((char16_t)0x3105), immIndex->getBucket(1)->getLabel());
+    assertEquals("label 2", UnicodeString((char16_t)0x3106), immIndex->getBucket(2)->getLabel());
+    assertEquals("label 3", UnicodeString((char16_t)0x3107), immIndex->getBucket(3)->getLabel());
+    assertEquals("label 4", UnicodeString((char16_t)0x3108), immIndex->getBucket(4)->getLabel());
+    assertEquals("label 5", UnicodeString((char16_t)0x3109), immIndex->getBucket(5)->getLabel());
 }
 
 void AlphabeticIndexTest::TestJapaneseKanji() {
@@ -726,10 +726,10 @@ void AlphabeticIndexTest::TestChineseUnihan() {
         logln("Chinese/unihan has %d buckets/labels", bucketCount);
     }
     // bucketIndex = radical number, adjusted for simplified radicals in lower buckets.
-    int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x4e5d), status);
+    int32_t bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0x4e5d), status);
     assertEquals("getBucketIndex(U+4E5D)", 5, bucketIndex);
     // radical 100, and there is a 90' since Unicode 8
-    bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x7527), status);
+    bucketIndex = index.getBucketIndex(UnicodeString((char16_t)0x7527), status);
     assertEquals("getBucketIndex(U+7527)", 101, bucketIndex);
 }
 
index b97580327c0b0098880581670eaea9eede8369b9..41881b4f3aa295c8c181e1419863e866e1434f26 100644 (file)
@@ -536,7 +536,7 @@ CollationAPITest::TestCollationKey(/* char* par */)
     CollationKey sortkIgnorable;
     // Most control codes and CGJ are completely ignorable.
     // A string with only completely ignorables must compare equal to an empty string.
-    col->getCollationKey(UnicodeString((UChar)1).append((UChar)0x34f), sortkIgnorable, key1Status);
+    col->getCollationKey(UnicodeString((char16_t)1).append((char16_t)0x34f), sortkIgnorable, key1Status);
     sortkIgnorable.getByteArray(length);
     doAssert(!sortkIgnorable.isBogus() && length == 3,
              "Completely ignorable string should return a collation key with empty levels");
@@ -926,8 +926,8 @@ CollationAPITest::TestDuplicate(/* char* par */)
     doAssert((*col1 == *col3), "Copied object is not equal to the original");
 
     UCollationResult res;
-    UnicodeString first((UChar)0x0061);
-    UnicodeString second((UChar)0x0062);
+    UnicodeString first((char16_t)0x0061);
+    UnicodeString second((char16_t)0x0062);
     UnicodeString copiedEnglishRules(((RuleBasedCollator*)col1)->getRules());
 
     delete col1;
@@ -987,9 +987,9 @@ CollationAPITest::TestCompare(/* char* par */)
     doAssert((col->greaterOrEqual(test1, test2) ), "Result should be \"Abcda\" == \"abcda\"");
 
     // Test different APIs
-    const UChar* t1 = test1.getBuffer();
+    const char16_t* t1 = test1.getBuffer();
     int32_t t1Len = test1.length();
-    const UChar* t2 = test2.getBuffer();
+    const char16_t* t2 = test2.getBuffer();
     int32_t t2Len = test2.length();
 
     doAssert((col->compare(test1, test2) == Collator::EQUAL), "Problem");
@@ -1096,7 +1096,7 @@ void CollationAPITest::TestSortKey()
     /* Need to use identical strength */
     col->setAttribute(UCOL_STRENGTH, UCOL_IDENTICAL, status);
 
-    UChar test1[6] = {0x41, 0x62, 0x63, 0x64, 0x61, 0},
+    char16_t test1[6] = {0x41, 0x62, 0x63, 0x64, 0x61, 0},
           test2[6] = {0x61, 0x62, 0x63, 0x64, 0x61, 0},
           test3[6] = {0x61, 0x62, 0x63, 0x64, 0x61, 0};
 
@@ -1242,7 +1242,7 @@ void CollationAPITest::TestSortKeyOverflow() {
         return;
     }
     col->setAttribute(UCOL_STRENGTH, UCOL_PRIMARY, errorCode);
-    UChar i_and_phi[] = { 0x438, 0x3c6 };  // Cyrillic small i & Greek small phi.
+    char16_t i_and_phi[] = { 0x438, 0x3c6 };  // Cyrillic small i & Greek small phi.
     // The sort key should be 6 bytes:
     // 2 bytes for the Cyrillic i, 1 byte for the primary-compression terminator,
     // 2 bytes for the Greek phi, and 1 byte for the NUL terminator.
@@ -1280,14 +1280,14 @@ void CollationAPITest::TestSortKeyOverflow() {
         }
 
         // Insert an 'a' to match ++prefixLength.
-        s.insert(prefixLength, (UChar)0x61);
+        s.insert(prefixLength, (char16_t)0x61);
     }
 }
 
 void CollationAPITest::TestMaxExpansion()
 {
     UErrorCode          status = U_ZERO_ERROR;
-    UChar               ch     = 0;
+    char16_t            ch     = 0;
     UChar32             unassigned = 0xEFFFD;
     uint32_t            sorder = 0;
     uint32_t            temporder = 0;
@@ -1531,7 +1531,7 @@ void CollationAPITest::TestAttribute()
 void CollationAPITest::TestVariableTopSetting() {
   UErrorCode status = U_ZERO_ERROR;
 
-  UChar vt[256] = { 0 };
+  char16_t vt[256] = { 0 };
 
   // Use the root collator, not the default collator.
   // This test fails with en_US_POSIX which tailors the dollar sign after 'A'.
@@ -1564,8 +1564,8 @@ void CollationAPITest::TestVariableTopSetting() {
     errln("setVariableTop(dollar sign) != following getVariableTop()");
   }
 
-  UnicodeString dollar((UChar)0x24);
-  UnicodeString euro((UChar)0x20AC);
+  UnicodeString dollar((char16_t)0x24);
+  UnicodeString euro((char16_t)0x20AC);
   uint32_t newVarTop2 = coll->setVariableTop(euro, status);
   assertEquals("setVariableTop(Euro sign) == following getVariableTop()",
                (int64_t)newVarTop2, (int64_t)coll->getVariableTop(status));
@@ -1575,7 +1575,7 @@ void CollationAPITest::TestVariableTopSetting() {
   coll->setAttribute(UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, status);
   assertEquals("empty==dollar", (int32_t)UCOL_EQUAL, (int32_t)coll->compare(UnicodeString(), dollar));
   assertEquals("empty==euro", (int32_t)UCOL_EQUAL, (int32_t)coll->compare(UnicodeString(), euro));
-  assertEquals("dollar<zero", (int32_t)UCOL_LESS, (int32_t)coll->compare(dollar, UnicodeString((UChar)0x30)));
+  assertEquals("dollar<zero", (int32_t)UCOL_LESS, (int32_t)coll->compare(dollar, UnicodeString((char16_t)0x30)));
 
   coll->setVariableTop(oldVarTop, status);
 
@@ -1610,15 +1610,15 @@ void CollationAPITest::TestMaxVariable() {
   }
 
   coll->setAttribute(UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, errorCode);
-  assertEquals("empty==dollar", (int32_t)UCOL_EQUAL, (int32_t)coll->compare(UnicodeString(), UnicodeString((UChar)0x24)));
-  assertEquals("empty==euro", (int32_t)UCOL_EQUAL, (int32_t)coll->compare(UnicodeString(), UnicodeString((UChar)0x20AC)));
-  assertEquals("dollar<zero", (int32_t)UCOL_LESS, (int32_t)coll->compare(UnicodeString((UChar)0x24), UnicodeString((UChar)0x30)));
+  assertEquals("empty==dollar", (int32_t)UCOL_EQUAL, (int32_t)coll->compare(UnicodeString(), UnicodeString((char16_t)0x24)));
+  assertEquals("empty==euro", (int32_t)UCOL_EQUAL, (int32_t)coll->compare(UnicodeString(), UnicodeString((char16_t)0x20AC)));
+  assertEquals("dollar<zero", (int32_t)UCOL_LESS, (int32_t)coll->compare(UnicodeString((char16_t)0x24), UnicodeString((char16_t)0x30)));
 }
 
 void CollationAPITest::TestGetLocale() {
   UErrorCode status = U_ZERO_ERROR;
   const char *rules = "&a<x<y<z";
-  UChar rlz[256] = {0};
+  char16_t rlz[256] = {0};
 
   Collator *coll = Collator::createInstance("root", status);
   if(U_FAILURE(status)) {
@@ -1792,7 +1792,7 @@ void CollationAPITest::TestBounds(void) {
     }
 
     uint8_t sortkey[512], lower[512], upper[512];
-    UChar buffer[512];
+    char16_t buffer[512];
 
     static const char * const test[] = {
         "John Smith",
@@ -2011,15 +2011,15 @@ public:
                                       const UnicodeString& target,
                                       int32_t length,
                                       UErrorCode& status) const override;
-    virtual UCollationResult compare(const UChar* source, 
+    virtual UCollationResult compare(const char16_t* source,
                                       int32_t sourceLength, 
-                                      const UChar* target, 
+                                      const char16_t* target,
                                       int32_t targetLength,
                                       UErrorCode& status) const override;
     virtual CollationKey& getCollationKey(const UnicodeString&  source,
                                           CollationKey& key,
                                           UErrorCode& status) const override;
-    virtual CollationKey& getCollationKey(const UChar*source, 
+    virtual CollationKey& getCollationKey(const char16_t*source,
                                           int32_t sourceLength,
                                           CollationKey& key,
                                           UErrorCode& status) const override;
@@ -2033,7 +2033,7 @@ public:
                               UErrorCode &status) override;
     virtual UColAttributeValue getAttribute(UColAttribute attr, 
                                             UErrorCode &status) const override;
-    virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, 
+    virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len,
                                     UErrorCode &status) override;
     virtual uint32_t setVariableTop(const UnicodeString &varTop, 
                                     UErrorCode &status) override;
@@ -2042,7 +2042,7 @@ public:
     virtual int32_t getSortKey(const UnicodeString& source,
                             uint8_t* result,
                             int32_t resultLength) const override;
-    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 override;
     virtual UnicodeSet *getTailoredSet(UErrorCode &status) const override;
     virtual bool operator==(const Collator& other) const override;
@@ -2093,9 +2093,9 @@ UCollationResult TestCollator::compare(const UnicodeString& source,
   }
 }
 
-UCollationResult TestCollator::compare(const UChar* source, 
+UCollationResult TestCollator::compare(const char16_t* source,
                                         int32_t sourceLength, 
-                                        const UChar* target, 
+                                        const char16_t* target,
                                         int32_t targetLength,
                                         UErrorCode& status) const
 {
@@ -2117,7 +2117,7 @@ CollationKey& TestCollator::getCollationKey(const UnicodeString& source,
     return key;
 }
 
-CollationKey& TestCollator::getCollationKey(const UChar*source, 
+CollationKey& TestCollator::getCollationKey(const char16_t*source,
                                           int32_t sourceLength,
                                           CollationKey& key,
                                           UErrorCode& status) const
@@ -2137,7 +2137,7 @@ int32_t TestCollator::getSortKey(const UnicodeString& source, uint8_t* result,
     return length;
 }
 
-int32_t TestCollator::getSortKey(const UChar*source, int32_t sourceLength, 
+int32_t TestCollator::getSortKey(const char16_t*source, int32_t sourceLength,
                                  uint8_t*result, int32_t resultLength) const
 {
     UnicodeString str(source, sourceLength);
@@ -2195,7 +2195,7 @@ UColAttributeValue TestCollator::getAttribute(UColAttribute attr,
     return UCOL_DEFAULT;
 }
 
-uint32_t TestCollator::setVariableTop(const UChar *varTop, int32_t len, 
+uint32_t TestCollator::setVariableTop(const char16_t *varTop, int32_t len,
                                   UErrorCode &status)
 {
     // api not used, this is to make the compiler happy
@@ -2302,10 +2302,10 @@ void CollationAPITest::TestSubclass()
 void CollationAPITest::TestNullptrCharTailoring()
 {
     UErrorCode status = U_ZERO_ERROR;
-    UChar buf[256] = {0};
+    char16_t buf[256] = {0};
     int32_t len = u_unescape("&a < '\\u0000'", buf, 256);
-    UnicodeString first((UChar)0x0061);
-    UnicodeString second((UChar)0);
+    UnicodeString first((char16_t)0x0061);
+    UnicodeString second((char16_t)0);
     RuleBasedCollator *coll = new RuleBasedCollator(UnicodeString(buf, len), status);
     if(U_FAILURE(status)) {
         delete coll;
@@ -2381,7 +2381,7 @@ void CollationAPITest::TestCloneBinary() {
         return;
     }
     rbc->setAttribute(UCOL_STRENGTH, UCOL_PRIMARY, errorCode);
-    UnicodeString uUmlaut((UChar)0xfc);
+    UnicodeString uUmlaut((char16_t)0xfc);
     UnicodeString ue = UNICODE_STRING_SIMPLE("ue");
     assertEquals("rbc/primary: u-umlaut==ue", (int32_t)UCOL_EQUAL, rbc->compare(uUmlaut, ue, errorCode));
     uint8_t bin[25000];
index 0d616f7381517b1c3e93a435e1529d5b2f29b79f..07c3f458b70978f78c06a029de3b50e91b922cd7 100644 (file)
@@ -119,7 +119,7 @@ UBool BiDiConformanceTest::parseOrdering(const char *start) {
     return true;
 }
 
-static const UChar charFromBiDiClass[U_CHAR_DIRECTION_COUNT]={
+static const char16_t charFromBiDiClass[U_CHAR_DIRECTION_COUNT]={
     0x6c,   // 'l' for L
     0x52,   // 'R' for R
     0x33,   // '3' for EN
@@ -461,7 +461,7 @@ void BiDiConformanceTest::TestBidiCharacterTest() {
             continue;  // Skip empty and comment-only lines.
         }
         // Parse the code point string in field 0.
-        UChar *buffer=inputString.getBuffer(200);
+        char16_t *buffer=inputString.getBuffer(200);
         int32_t length=u_parseString(start, buffer, inputString.getCapacity(), nullptr, errorCode);
         if(errorCode.errIfFailureAndReset("Invalid string in field 0")) {
             errln("Input line %d: %s", (int)lineNumber, line);
@@ -562,7 +562,7 @@ void BiDiConformanceTest::TestBidiCharacterTest() {
     }
 }
 
-static UChar printLevel(UBiDiLevel level) {
+static char16_t printLevel(UBiDiLevel level) {
     if(level<UBIDI_DEFAULT_LTR) {
         return 0x30+level;
     } else {
@@ -607,11 +607,11 @@ UBool BiDiConformanceTest::checkLevels(const UBiDiLevel actualLevels[], int32_t
         UnicodeString els("Expected levels:   ");
         int32_t i;
         for(i=0; i<levelsCount; ++i) {
-            els.append((UChar)0x20).append(printLevel(levels[i]));
+            els.append((char16_t)0x20).append(printLevel(levels[i]));
         }
         UnicodeString als("Actual   levels:   ");
         for(i=0; i<actualCount; ++i) {
-            als.append((UChar)0x20).append(printLevel(actualLevels[i]));
+            als.append((char16_t)0x20).append(printLevel(actualLevels[i]));
         }
         errln(els);
         errln(als);
@@ -659,13 +659,13 @@ UBool BiDiConformanceTest::checkOrdering(UBiDi *ubidi) {
         printErrorLine();
         UnicodeString eord("Expected ordering: ");
         for(i=0; i<orderingCount; ++i) {
-            eord.append((UChar)0x20).append((UChar)(0x30+ordering[i]));
+            eord.append((char16_t)0x20).append((char16_t)(0x30+ordering[i]));
         }
         UnicodeString aord("Actual   ordering: ");
         for(i=0; i<resultLength; ++i) {
             int32_t logicalIndex=ubidi_getLogicalIndex(ubidi, i, errorCode);
             if(levels[logicalIndex]<UBIDI_DEFAULT_LTR) {
-                aord.append((UChar)0x20).append((UChar)(0x30+logicalIndex));
+                aord.append((char16_t)0x20).append((char16_t)(0x30+logicalIndex));
             }
         }
         errln(eord);
index 0b9ce900d14aee295fbed9ffbce03d439d0acbe5..9c125d9af5a719dd987c9035586f591a00e5a738 100644 (file)
@@ -170,7 +170,7 @@ void CalendarCaseTest::IslamicCivil()
     c->setLenient(true);
     doTestCases(tests, c);
 
-    static const UChar expectedUChars[] = {
+    static const char16_t expectedUChars[] = {
         0x0627, 0x0644, 0x062e, 0x0645, 0x064a, 0x0633, 0x060c, 0x0020, 0x0662, 0x0662, 0x0020,
         0x0634, 0x0648, 0x0627, 0x0644, 0x0020, 0x0661, 0x0663, 0x0668, 0x0669, 0x0020, 0x0647, 0x0640, 0
      };
index d73cc1f6b8eae4d4a04e7e1ae56722a714a2610f..8631821651abb73e3c3a6e57d246d3f716d44ffa 100644 (file)
@@ -2698,7 +2698,7 @@ void CalendarRegressionTest::TestTimeZoneTransitionAdd() {
 
     UnicodeString buf1, buf2;
 
-    const UChar* id;
+    const char16_t* id;
     while ((id = tz->unext(nullptr, ec)) != nullptr && U_SUCCESS(ec)) {
         if (U_FAILURE(ec)) {
             errln("FAIL: StringEnumeration::unext");
index 754aebd6dff9e55a260e58a1394475a6746ecf45..2802a999363552c77d78dc2034aaa92cd52d1813 100644 (file)
@@ -484,7 +484,7 @@ CalendarTest::TestGenericAPI()
         values->reset(status);
         containsHebrew = false;
         UnicodeString hebrew = UNICODE_STRING_SIMPLE("hebrew");
-        const UChar *ucharValue;
+        const char16_t *ucharValue;
         while ((ucharValue = values->unext(&valueLength, status)) != nullptr) {
             UnicodeString value(false, ucharValue, valueLength);
             if (value == hebrew) {
@@ -2086,11 +2086,11 @@ void CalendarTest::Test3785()
                                          uzone.length(), nullptr, 0, &status));
     if (df.isNull() || U_FAILURE(status)) return;
 
-    UChar upattern[64];
+    char16_t upattern[64];
     u_uastrcpy(upattern, "EEE d MMMM y G, HH:mm:ss");
     udat_applyPattern(df.getAlias(), false, upattern, u_strlen(upattern));
 
-    UChar ubuffer[1024];
+    char16_t ubuffer[1024];
     UDate ud0 = 1337557623000.0;
 
     status = U_ZERO_ERROR;
@@ -3420,7 +3420,7 @@ static const GregoUmmAlQuraMap guMappings[] = {
   {    0, 0, 0,      0, 0, 0 }, // terminator
 };
 
-static const UChar zoneSA[] = {0x41,0x73,0x69,0x61,0x2F,0x52,0x69,0x79,0x61,0x64,0x68,0}; // "Asia/Riyadh"
+static const char16_t zoneSA[] = {0x41,0x73,0x69,0x61,0x2F,0x52,0x69,0x79,0x61,0x64,0x68,0}; // "Asia/Riyadh"
 
 void CalendarTest::TestIslamicUmAlQura() {
 
index addf1fa1a7e0b6533a4fdc0ce7ec65ec237100b1..8864b6a85c1a42294e6efc5db7e134ed46ece11a 100644 (file)
@@ -63,20 +63,20 @@ public:
     virtual int32_t hashCode(void) const override {
         return DONE;
     }
-    virtual UChar nextPostInc(void) override { return text.charAt(pos++);}
+    virtual char16_t nextPostInc(void) override { return text.charAt(pos++);}
     virtual UChar32 next32PostInc(void) override {return text.char32At(pos++);}
     virtual UBool hasNext() override { return true;}
-    virtual UChar first() override {return DONE;}
+    virtual char16_t first() override {return DONE;}
     virtual UChar32 first32() override {return DONE;}
-    virtual UChar last() override {return DONE;}
+    virtual char16_t last() override {return DONE;}
     virtual UChar32 last32() override {return DONE;}
-    virtual UChar setIndex(int32_t /*pos*/) override {return DONE;}
+    virtual char16_t setIndex(int32_t /*pos*/) override {return DONE;}
     virtual UChar32 setIndex32(int32_t /*pos*/) override {return DONE;}
-    virtual UChar current() const override {return DONE;}
+    virtual char16_t current() const override {return DONE;}
     virtual UChar32 current32() const override {return DONE;}
-    virtual UChar next() override {return DONE;}
+    virtual char16_t next() override {return DONE;}
     virtual UChar32 next32() override {return DONE;}
-    virtual UChar previous() override {return DONE;}
+    virtual char16_t previous() override {return DONE;}
     virtual UChar32 previous32() override {return DONE;}
     virtual int32_t move(int32_t delta,CharacterIterator::EOrigin origin) override {
         switch(origin) {
@@ -378,7 +378,7 @@ void CharIterTest::TestConstructionAndEqualityUChariter() {
 void CharIterTest::TestIteration() {
     UnicodeString text("Now is the time for all good men to come to the aid of their country.");
 
-    UChar c;
+    char16_t c;
     int32_t i;
     {
         StringCharacterIterator   iter(text, 5);
@@ -550,7 +550,7 @@ void CharIterTest::TestIteration() {
 
 //Tests for new API for utf-16 support 
 void CharIterTest::TestIterationUChar32() {
-    UChar textChars[]={ 0x0061, 0x0062, 0xd841, 0xdc02, 0x20ac, 0xd7ff, 0xd842, 0xdc06, 0xd801, 0xdc00, 0x0061, 0x0000};
+    char16_t textChars[]={ 0x0061, 0x0062, 0xd841, 0xdc02, 0x20ac, 0xd7ff, 0xd842, 0xdc06, 0xd801, 0xdc00, 0x0061, 0x0000};
     UnicodeString text(textChars);
     UChar32 c;
     int32_t i;
@@ -976,7 +976,7 @@ public:
     }
 
     // useful stuff, mostly dummy but testing coverage and subclassability
-    virtual UChar nextPostInc() override {
+    virtual char16_t nextPostInc() override {
         if(pos<UPRV_LENGTHOF(s)) {
             return s[pos++];
         } else {
@@ -998,7 +998,7 @@ public:
         return pos<UPRV_LENGTHOF(s);
     }
 
-    virtual UChar first() override {
+    virtual char16_t first() override {
         pos=0;
         return s[0];
     }
@@ -1011,7 +1011,7 @@ public:
         return c;
     }
 
-    virtual UChar setIndex(int32_t position) override {
+    virtual char16_t setIndex(int32_t position) override {
         if(0<=position && position<=UPRV_LENGTHOF(s)) {
             pos=position;
             if(pos<UPRV_LENGTHOF(s)) {
@@ -1033,7 +1033,7 @@ public:
         return DONE;
     }
 
-    virtual UChar current() const override {
+    virtual char16_t current() const override {
         if(pos<UPRV_LENGTHOF(s)) {
             return s[pos];
         } else {
@@ -1051,7 +1051,7 @@ public:
         }
     }
 
-    virtual UChar next() override {
+    virtual char16_t next() override {
         if(pos<UPRV_LENGTHOF(s) && ++pos<UPRV_LENGTHOF(s)) {
             return s[pos];
         } else {
@@ -1096,7 +1096,7 @@ public:
         return nullptr;
     }
 
-    virtual UChar last() override {
+    virtual char16_t last() override {
         return 0;
     }
 
@@ -1104,7 +1104,7 @@ public:
         return 0;
     }
 
-    virtual UChar previous() override {
+    virtual char16_t previous() override {
         return 0;
     }
 
@@ -1131,7 +1131,7 @@ public:
 
 private:
     // dummy string data
-    UChar s[4];
+    char16_t s[4];
 
     static const char fgClassID;
 };
@@ -1152,10 +1152,10 @@ public:
     }
 
 private:
-    static const UChar u[3];
+    static const char16_t u[3];
 };
 
-const UChar SubUCharCharIter::u[3]={ 0x61, 0x62, 0x63 };
+const char16_t SubUCharCharIter::u[3]={ 0x61, 0x62, 0x63 };
 
 void CharIterTest::TestCharIteratorSubClasses() {
     SubCharIter *p;
index 38f8dd1173245bf6050781fd3a008e2cea6a8eae..e72c9a4e40bcd9eca8cbaee3ce2fa387a87869a1 100644 (file)
@@ -91,9 +91,9 @@ private:
     static UnicodeString printCollationKey(const CollationKey &key);
 
     // Helpers & fields for data-driven test.
-    static UBool isCROrLF(UChar c) { return c == 0xa || c == 0xd; }
-    static UBool isSpace(UChar c) { return c == 9 || c == 0x20 || c == 0x3000; }
-    static UBool isSectionStarter(UChar c) { return c == 0x25 || c == 0x2a || c == 0x40; }  // %*@
+    static UBool isCROrLF(char16_t c) { return c == 0xa || c == 0xd; }
+    static UBool isSpace(char16_t c) { return c == 9 || c == 0x20 || c == 0x3000; }
+    static UBool isSectionStarter(char16_t c) { return c == 0x25 || c == 0x2a || c == 0x40; }  // %*@
     int32_t skipSpaces(int32_t i) {
         while(isSpace(fileLine[i])) { ++i; }
         return i;
@@ -110,13 +110,13 @@ private:
 
     UBool needsNormalization(const UnicodeString &s, UErrorCode &errorCode) const;
 
-    UBool getSortKeyParts(const UChar *s, int32_t length,
+    UBool getSortKeyParts(const char16_t *s, int32_t length,
                           CharString &dest, int32_t partSize,
                           IcuTestErrorCode &errorCode);
     UBool getCollationKey(const char *norm, const UnicodeString &line,
-                          const UChar *s, int32_t length,
+                          const char16_t *s, int32_t length,
                           CollationKey &key, IcuTestErrorCode &errorCode);
-    UBool getMergedCollationKey(const UChar *s, int32_t length,
+    UBool getMergedCollationKey(const char16_t *s, int32_t length,
                                 CollationKey &key, IcuTestErrorCode &errorCode);
     UBool checkCompareTwo(const char *norm, const UnicodeString &prevFileLine,
                           const UnicodeString &prevString, const UnicodeString &s,
@@ -169,7 +169,7 @@ void CollationTest::TestMinMax() {
         return;
     }
 
-    static const UChar s[2] = { 0xfffe, 0xffff };
+    static const char16_t s[2] = { 0xfffe, 0xffff };
     UVector64 ces(errorCode);
     rbc->internalGetCEs(UnicodeString(false, s, 2), ces, errorCode);
     errorCode.assertSuccess();
@@ -270,7 +270,7 @@ void CollationTest::TestNulTerminated() {
         return;
     }
 
-    static const UChar s[] = { 0x61, 0x62, 0x61, 0x62, 0 };
+    static const char16_t s[] = { 0x61, 0x62, 0x61, 0x62, 0 };
 
     UTF16CollationIterator ci1(data, false, s, s, s + 2);
     UTF16CollationIterator ci2(data, false, s + 2, s + 2, nullptr);
@@ -450,7 +450,7 @@ void CollationTest::TestFCD() {
     }
 
     // Input string, not FCD, NUL-terminated.
-    static const UChar s[] = {
+    static const char16_t s[] = {
         0x308, 0xe1, 0x62, 0x301, 0x327, 0x430, 0x62,
         U16_LEAD(0x1D15F), U16_TRAIL(0x1D15F),  // MUSICAL SYMBOL QUARTER NOTE=1D158 1D165, ccc=0, 216
         0x327, 0x308,  // ccc=202, 230
@@ -950,12 +950,12 @@ void CollationTest::TestTailoredElements() {
 UnicodeString CollationTest::printSortKey(const uint8_t *p, int32_t length) {
     UnicodeString s;
     for(int32_t i = 0; i < length; ++i) {
-        if(i > 0) { s.append((UChar)0x20); }
+        if(i > 0) { s.append((char16_t)0x20); }
         uint8_t b = p[i];
         if(b == 0) {
-            s.append((UChar)0x2e);  // period
+            s.append((char16_t)0x2e);  // period
         } else if(b == 1) {
-            s.append((UChar)0x7c);  // vertical bar
+            s.append((char16_t)0x7c);  // vertical bar
         } else {
             appendHex(b, 2, s);
         }
@@ -972,14 +972,14 @@ UnicodeString CollationTest::printCollationKey(const CollationKey &key) {
 UBool CollationTest::readNonEmptyLine(UCHARBUF *f, IcuTestErrorCode &errorCode) {
     for(;;) {
         int32_t lineLength;
-        const UChar *line = ucbuf_readline(f, &lineLength, errorCode);
+        const char16_t *line = ucbuf_readline(f, &lineLength, errorCode);
         if(line == nullptr || errorCode.isFailure()) {
             fileLine.remove();
             return false;
         }
         ++fileLineNumber;
         // Strip trailing CR/LF, comments, and spaces.
-        const UChar *comment = u_memchr(line, 0x23, lineLength);  // '#'
+        const char16_t *comment = u_memchr(line, 0x23, lineLength);  // '#'
         if(comment != nullptr) {
             lineLength = (int32_t)(comment - line);
         } else {
@@ -999,7 +999,7 @@ void CollationTest::parseString(int32_t &start, UnicodeString &prefix, UnicodeSt
     int32_t length = fileLine.length();
     int32_t i;
     for(i = start; i < length && !isSpace(fileLine[i]); ++i) {}
-    int32_t pipeIndex = fileLine.indexOf((UChar)0x7c, start, i - start);  // '|'
+    int32_t pipeIndex = fileLine.indexOf((char16_t)0x7c, start, i - start);  // '|'
     if(pipeIndex >= 0) {
         prefix = fileLine.tempSubStringBetween(start, pipeIndex).unescape();
         if(prefix.isEmpty()) {
@@ -1026,7 +1026,7 @@ Collation::Level CollationTest::parseRelationAndString(UnicodeString &s, IcuTest
     Collation::Level relation;
     int32_t start;
     if(fileLine[0] == 0x3c) {  // <
-        UChar second = fileLine[1];
+        char16_t second = fileLine[1];
         start = 2;
         switch(second) {
         case 0x31:  // <1
@@ -1118,7 +1118,7 @@ void CollationTest::parseAndSetAttribute(IcuTestErrorCode &errorCode) {
     // Parse attributes even if the Collator could not be created,
     // in order to report syntax errors.
     int32_t start = skipSpaces(1);
-    int32_t equalPos = fileLine.indexOf((UChar)0x3d);
+    int32_t equalPos = fileLine.indexOf((char16_t)0x3d);
     if(equalPos < 0) {
         if(fileLine.compare(start, 7, UNICODE_STRING("reorder", 7)) == 0) {
             parseAndSetReorderCodes(start + 7, errorCode);
@@ -1283,9 +1283,9 @@ void CollationTest::setLocaleCollator(IcuTestErrorCode &errorCode) {
     if(errorCode.isFailure()) { return; }
     delete coll;
     coll = nullptr;
-    int32_t at = fileLine.indexOf((UChar)0x40, 9);  // @ is not invariant
+    int32_t at = fileLine.indexOf((char16_t)0x40, 9);  // @ is not invariant
     if(at >= 0) {
-        fileLine.setCharAt(at, (UChar)0x2a);  // *
+        fileLine.setCharAt(at, (char16_t)0x2a);  // *
     }
     CharString localeID;
     localeID.appendInvariantChars(fileLine.tempSubString(9), errorCode);
@@ -1319,16 +1319,16 @@ UBool CollationTest::needsNormalization(const UnicodeString &s, UErrorCode &erro
     // those composites must be decomposed.
     // Check if s contains 0F71 immediately followed by 0F73 or 0F75 or 0F81.
     int32_t index = 0;
-    while((index = s.indexOf((UChar)0xf71, index)) >= 0) {
+    while((index = s.indexOf((char16_t)0xf71, index)) >= 0) {
         if(++index < s.length()) {
-            UChar c = s[index];
+            char16_t c = s[index];
             if(c == 0xf73 || c == 0xf75 || c == 0xf81) { return true; }
         }
     }
     return false;
 }
 
-UBool CollationTest::getSortKeyParts(const UChar *s, int32_t length,
+UBool CollationTest::getSortKeyParts(const char16_t *s, int32_t length,
                                      CharString &dest, int32_t partSize,
                                      IcuTestErrorCode &errorCode) {
     if(errorCode.isFailure()) { return false; }
@@ -1352,7 +1352,7 @@ UBool CollationTest::getSortKeyParts(const UChar *s, int32_t length,
 }
 
 UBool CollationTest::getCollationKey(const char *norm, const UnicodeString &line,
-                                     const UChar *s, int32_t length,
+                                     const char16_t *s, int32_t length,
                                      CollationKey &key, IcuTestErrorCode &errorCode) {
     if(errorCode.isFailure()) { return false; }
     coll->getCollationKey(s, length, key, errorCode);
@@ -1435,7 +1435,7 @@ UBool CollationTest::getCollationKey(const char *norm, const UnicodeString &line
  * Leaves key unchanged if s does not contain U+FFFE.
  * @return true if the key was successfully changed
  */
-UBool CollationTest::getMergedCollationKey(const UChar *s, int32_t length,
+UBool CollationTest::getMergedCollationKey(const char16_t *s, int32_t length,
                                            CollationKey &key, IcuTestErrorCode &errorCode) {
     if(errorCode.isFailure()) { return false; }
     LocalMemory<uint8_t> mergedKey;
@@ -1506,7 +1506,7 @@ const UnicodeString &surrogatesToFFFD(const UnicodeString &s, UnicodeString &buf
             if(buffer.length() < i) {
                 buffer.append(s, buffer.length(), i - buffer.length());
             }
-            buffer.append((UChar)0xfffd);
+            buffer.append((char16_t)0xfffd);
         }
         i += U16_LENGTH(c);
     }
@@ -1582,7 +1582,7 @@ UBool CollationTest::checkCompareTwo(const char *norm, const UnicodeString &prev
         return false;
     }
     // Test NUL-termination if the strings do not contain NUL characters.
-    UBool containNUL = prevString.indexOf((UChar)0) >= 0 || s.indexOf((UChar)0) >= 0;
+    UBool containNUL = prevString.indexOf((char16_t)0) >= 0 || s.indexOf((char16_t)0) >= 0;
     if(!containNUL) {
         order = coll->compare(prevString.getBuffer(), -1, s.getBuffer(), -1, errorCode);
         if(order != expectedOrder || errorCode.isFailure()) {
index 753d8c926b5991ce49370820ca86cfb77f1f7406..64cd8b8342ec51c68e39a54ae3a70dcea208b03a 100644 (file)
@@ -212,7 +212,7 @@ void StringList::add(const UnicodeString *string, UErrorCode &status)
     strings[listSize++].append(*string);
 }
 
-void StringList::add(const UChar *chars, int32_t count, UErrorCode &status)
+void StringList::add(const char16_t *chars, int32_t count, UErrorCode &status)
 {
     const UnicodeString string(chars, count);
 
@@ -359,7 +359,7 @@ CollData::CollData(UCollator *collator, UErrorCode &status)
     itemCount = uset_getItemCount(charsToTest);
     for(int32_t item = 0; item < itemCount; item += 1) {
         UChar32 start = 0, end = 0;
-        UChar buffer[16];
+        char16_t buffer[16];
         int32_t len = uset_getItem(charsToTest, item, &start, &end,
                                    buffer, 16, &status);
 
@@ -427,7 +427,7 @@ bail:
     // and there are also more Jamo T at U+D7CB..U+D7FB.
     // Maybe use [:HST=T:] and look for the end of the last range?
     // Maybe use script boundary mappings instead of this code??
-    UChar  jamoRanges[] = {Hangul::JAMO_L_BASE, Hangul::JAMO_V_BASE, Hangul::JAMO_T_BASE + 1, 0x11FF};
+    char16_t  jamoRanges[] = {Hangul::JAMO_L_BASE, Hangul::JAMO_V_BASE, Hangul::JAMO_T_BASE + 1, 0x11FF};
      UnicodeString jamoString(false, jamoRanges, UPRV_LENGTHOF(jamoRanges));
      CEList hanList(coll, hanString, status);
      CEList jamoList(coll, jamoString, status);
index 77bd58230dbeb8c4d5726bd63c17b9ad911eb442..1d3c0277490397908e8b47376f9cf714ea661ce9 100644 (file)
@@ -158,7 +158,7 @@ public:
      * @param count - the number of code points in the array
      * @param status - will be set if any errors occur. 
      */
-    void add(const UChar *chars, int32_t count, UErrorCode &status);
+    void add(const char16_t *chars, int32_t count, UErrorCode &status);
 
     /**
      * Get a particular string from the list.
index 3939e698d600b5e7c55ef7b7d5a8a297c25a2a10..1fdce822c7ab383265b939518581dcc81a632ec5 100644 (file)
@@ -254,7 +254,7 @@ private:
     void CheckLocale(
         const Locale& locale, UNumberCompactStyle style,
         const ExpectedResult* expectedResults, int32_t expectedResultLength);
-    void CheckLocaleWithCurrency(const Locale& locale, UNumberCompactStyle style, const UChar* currency,
+    void CheckLocaleWithCurrency(const Locale& locale, UNumberCompactStyle style, const char16_t* currency,
                                  const ExpectedResult* expectedResults, int32_t expectedResultLength);
     void CheckExpectedResult(
         const CompactDecimalFormat* cdf, const ExpectedResult* expectedResult,
@@ -520,7 +520,7 @@ void CompactDecimalFormatTest::CheckLocale(const Locale& locale, UNumberCompactS
 }
 
 void CompactDecimalFormatTest::CheckLocaleWithCurrency(const Locale& locale, UNumberCompactStyle style,
-                                                       const UChar* currency,
+                                                       const char16_t* currency,
                                                        const ExpectedResult* expectedResults,
                                                        int32_t expectedResultLength) {
     UErrorCode status = U_ZERO_ERROR;
index 669514d0d7fdfc464d5c678d14152422997a3c59..1e8b86aaf3a4c53b4c1bb60e99ba904803040e40 100644 (file)
@@ -208,7 +208,7 @@ ConversionTest::TestFromUnicode() {
     TestDataModule *dataModule;
     TestData *testData;
     const DataMap *testCase;
-    const UChar *p;
+    const char16_t *p;
     UErrorCode errorCode;
     int32_t i, length;
 
@@ -263,7 +263,7 @@ ConversionTest::TestFromUnicode() {
                 s=testCase->getString("callback", errorCode);
                 cc.setSub=0; // default: no subchar
 
-                if((index=s.indexOf((UChar)0))>0) {
+                if((index=s.indexOf((char16_t)0))>0) {
                     // read NUL-separated subchar first, if any
                     // copy the subchar from Latin-1 characters
                     // start after the NUL
@@ -286,7 +286,7 @@ ConversionTest::TestFromUnicode() {
 
                     // remove the NUL and subchar from s
                     s.truncate(index);
-                } else if((index=s.indexOf((UChar)0x3d))>0) /* '=' */ {
+                } else if((index=s.indexOf((char16_t)0x3d))>0) /* '=' */ {
                     // read a substitution string, separated by an equal sign
                     p=s.getBuffer()+index+1;
                     length=s.length()-(index+1);
@@ -349,7 +349,7 @@ ConversionTest::TestFromUnicode() {
     }
 }
 
-static const UChar ellipsis[]={ 0x2e, 0x2e, 0x2e };
+static const char16_t ellipsis[]={ 0x2e, 0x2e, 0x2e };
 
 void
 ConversionTest::TestGetUnicodeSet() {
@@ -476,7 +476,7 @@ U_CDECL_BEGIN
 static void U_CALLCONV
 getUnicodeSetCallback(const void *context,
                       UConverterFromUnicodeArgs * /*fromUArgs*/,
-                      const UChar* /*codeUnits*/,
+                      const char16_t* /*codeUnits*/,
                       int32_t /*length*/,
                       UChar32 codePoint,
                       UConverterCallbackReason reason,
@@ -500,35 +500,35 @@ ConversionTest::TestGetUnicodeSet2() {
         cpLimit=0x110000;
         s0Length=0x10000+0x200000;  // BMP + surrogate pairs
     }
-    UChar *s0=new UChar[s0Length];
+    char16_t *s0=new char16_t[s0Length];
     if(s0==nullptr) {
         return;
     }
-    UChar *s=s0;
+    char16_t *s=s0;
     UChar32 c;
-    UChar c2;
+    char16_t c2;
     // low BMP
     for(c=0; c<=0xd7ff; ++c) {
-        *s++=(UChar)c;
+        *s++=(char16_t)c;
     }
     // trail surrogates
     for(c=0xdc00; c<=0xdfff; ++c) {
-        *s++=(UChar)c;
+        *s++=(char16_t)c;
     }
     // lead surrogates
     // (after trails so that there is not even one surrogate pair in between)
     for(c=0xd800; c<=0xdbff; ++c) {
-        *s++=(UChar)c;
+        *s++=(char16_t)c;
     }
     // high BMP
     for(c=0xe000; c<=0xffff; ++c) {
-        *s++=(UChar)c;
+        *s++=(char16_t)c;
     }
     // supplementary code points = surrogate pairs
     if(cpLimit==0x110000) {
         for(c=0xd800; c<=0xdbff; ++c) {
             for(c2=0xdc00; c2<=0xdfff; ++c2) {
-                *s++=(UChar)c;
+                *s++=(char16_t)c;
                 *s++=c2;
             }
         }
@@ -578,7 +578,7 @@ ConversionTest::TestGetUnicodeSet2() {
             do {
                 char *t=buffer;
                 flush=(UBool)(s==s0+s0Length);
-                ucnv_fromUnicode(cnv.getAlias(), &t, buffer+sizeof(buffer), (const UChar **)&s, s0+s0Length, nullptr, flush, &errorCode);
+                ucnv_fromUnicode(cnv.getAlias(), &t, buffer+sizeof(buffer), (const char16_t **)&s, s0+s0Length, nullptr, flush, &errorCode);
                 if(U_FAILURE(errorCode)) {
                     if(errorCode==U_BUFFER_OVERFLOW_ERROR) {
                         errorCode=U_ZERO_ERROR;
@@ -729,10 +729,10 @@ ConversionTest::TestUTF8ToUTF8Overflow() {
     char result[20];
     char *target = result;
     const char *targetLimit = result + sizeof(result);
-    UChar buffer16[20];
-    UChar *pivotSource = buffer16;
-    UChar *pivotTarget = buffer16;
-    const UChar *pivotLimit = buffer16 + UPRV_LENGTHOF(buffer16);
+    char16_t buffer16[20];
+    char16_t *pivotSource = buffer16;
+    char16_t *pivotTarget = buffer16;
+    const char16_t *pivotLimit = buffer16 + UPRV_LENGTHOF(buffer16);
     int32_t length;
 
     // Convert with insufficient target capacity.
@@ -866,10 +866,10 @@ ConversionTest::TestUTF8ToUTF8Streaming() {
     char* target = result;
     const char* targetLimit = result + targetLen;
 
-    UChar buffer16[20];
-    UChar* pivotSource = buffer16;
-    UChar* pivotTarget = buffer16;
-    const UChar* pivotLimit = buffer16 + UPRV_LENGTHOF(buffer16);
+    char16_t buffer16[20];
+    char16_t* pivotSource = buffer16;
+    char16_t* pivotTarget = buffer16;
+    const char16_t* pivotLimit = buffer16 + UPRV_LENGTHOF(buffer16);
 
     int32_t length;
     ucnv_convertEx(cnv2.getAlias(), cnv1.getAlias(),
@@ -944,7 +944,7 @@ printBytes(const uint8_t *bytes, int32_t length, char *out) {
 }
 
 static char *
-printUnicode(const UChar *unicode, int32_t length, char *out) {
+printUnicode(const char16_t *unicode, int32_t length, char *out) {
     UChar32 c;
     int32_t i;
 
@@ -1006,12 +1006,12 @@ printOffsets(const int32_t *offsets, int32_t length, char *out) {
 
 static int32_t
 stepToUnicode(ConversionCase &cc, UConverter *cnv,
-              UChar *result, int32_t resultCapacity,
+              char16_t *result, int32_t resultCapacity,
               int32_t *resultOffsets, /* also resultCapacity */
               int32_t step,
               UErrorCode *pErrorCode) {
     const char *source, *sourceLimit, *bytesLimit;
-    UChar *target, *targetLimit, *resultLimit;
+    char16_t *target, *targetLimit, *resultLimit;
     UBool flush;
 
     source=(const char *)cc.bytes;
@@ -1126,7 +1126,7 @@ stepToUnicode(ConversionCase &cc, UConverter *cnv,
                     break;
                 }
                 if(c<=0xffff) {
-                    *target++=(UChar)c;
+                    *target++=(char16_t)c;
                 } else {
                     *target++=U16_LEAD(c);
                     if(target==resultLimit) {
@@ -1141,7 +1141,7 @@ stepToUnicode(ConversionCase &cc, UConverter *cnv,
                     ++step;
                 }
             } else /* step is even */ {
-                // allow only one UChar output
+                // allow only one char16_t output
                 targetLimit=target<resultLimit ? target+1 : resultLimit;
 
                 // as with ucnv_getNextUChar(), we always flush (if we go to bytesLimit)
@@ -1218,7 +1218,7 @@ ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback
     }
 
     int32_t resultOffsets[256];
-    UChar result[256];
+    char16_t result[256];
     int32_t resultLength;
     UBool ok;
 
@@ -1279,7 +1279,7 @@ ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback
             errln("toUnicode[%d](%s) Conversion wrote too much to offsets at index %d",
                 cc.caseNr, cc.charset, resultLength);
         }
-        if (result[resultLength] != (UChar)-1) {
+        if (result[resultLength] != (char16_t)-1) {
             errln("toUnicode[%d](%s) Conversion wrote too much to result at index %d",
                 cc.caseNr, cc.charset, resultLength);
         }
@@ -1328,7 +1328,7 @@ ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback
 
 UBool
 ConversionTest::checkToUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
-                               const UChar *result, int32_t resultLength,
+                               const char16_t *result, int32_t resultLength,
                                const int32_t *resultOffsets,
                                UErrorCode resultErrorCode) {
     char resultInvalidChars[8];
@@ -1417,8 +1417,8 @@ stepFromUTF8(ConversionCase &cc,
              int32_t step,
              UErrorCode *pErrorCode) {
     const char *source, *sourceLimit, *utf8Limit;
-    UChar pivotBuffer[32];
-    UChar *pivotSource, *pivotTarget, *pivotLimit;
+    char16_t pivotBuffer[32];
+    char16_t *pivotSource, *pivotTarget, *pivotLimit;
     char *target, *targetLimit, *resultLimit;
     UBool flush;
 
@@ -1522,7 +1522,7 @@ stepFromUnicode(ConversionCase &cc, UConverter *cnv,
                 int32_t *resultOffsets, /* also resultCapacity */
                 int32_t step,
                 UErrorCode *pErrorCode) {
-    const UChar *source, *sourceLimit, *unicodeLimit;
+    const char16_t *source, *sourceLimit, *unicodeLimit;
     char *target, *targetLimit, *resultLimit;
     UBool flush;
 
@@ -1786,7 +1786,7 @@ ConversionTest::checkFromUnicode(ConversionCase &cc, UConverter *cnv, const char
                                  const uint8_t *result, int32_t resultLength,
                                  const int32_t *resultOffsets,
                                  UErrorCode resultErrorCode) {
-    UChar resultInvalidUChars[8];
+    char16_t resultInvalidUChars[8];
     int8_t resultInvalidLength;
     UErrorCode errorCode;
 
index 9fb0d9af2970c5b8b172cb3b91cb19f4c0318813..3e01f3f24d2f78864c6bc171e3b91b92913e2dc7 100644 (file)
@@ -32,14 +32,14 @@ struct ConversionCase {
     /* setup */
     int32_t caseNr;
     const char *charset, *cbopt, *name;
-    UChar subString[16];
+    char16_t subString[16];
     char subchar[8];
     int8_t setSub;
 
     /* input and expected output */
     const uint8_t *bytes;
     int32_t bytesLength;
-    const UChar *unicode;
+    const char16_t *unicode;
     int32_t unicodeLength;
     const int32_t *offsets;
 
@@ -52,12 +52,12 @@ struct ConversionCase {
     UBool fallbacks;
     UErrorCode outErrorCode;
     const uint8_t *invalidChars;
-    const UChar *invalidUChars;
+    const char16_t *invalidUChars;
     int32_t invalidLength;
 
     /* actual output */
     uint8_t resultBytes[200];
-    UChar resultUnicode[200];
+    char16_t resultUnicode[200];
     int32_t resultOffsets[200];
     int32_t resultLength;
 
@@ -88,7 +88,7 @@ private:
 
     UBool
     checkToUnicode(ConversionCase &cc, UConverter *cnv, const char *name,
-                   const UChar *result, int32_t resultLength,
+                   const char16_t *result, int32_t resultLength,
                    const int32_t *resultOffsets,
                    UErrorCode resultErrorCode);
 
index 62cf2b9af02803b78dfeeeac49500e0b92ff4131..11e7025928cf578d7d9955c19d5d798137a2c7ac 100644 (file)
@@ -320,7 +320,7 @@ void CompoundTransliteratorTest::TestGetSetAdoptTransliterator(){
 /**
  * Splits a UnicodeString
  */
-UnicodeString* CompoundTransliteratorTest::split(const UnicodeString& str, UChar seperator, int32_t& count) {
+UnicodeString* CompoundTransliteratorTest::split(const UnicodeString& str, char16_t seperator, int32_t& count) {
 
     //get the count
     int32_t i;
index 3518f2f447d78bb07f4ab2d4b61aec9a3ec75be8..4840f97694640d6999729c53b4c3973781aeb5b0 100644 (file)
@@ -49,7 +49,7 @@ public:
     /**
      * Splits a UnicodeString
      */
-    UnicodeString* split(const UnicodeString& str, UChar seperator, int32_t& count);
+    UnicodeString* split(const UnicodeString& str, char16_t seperator, int32_t& count);
 
     void expect(const CompoundTransliterator& t,
                 const UnicodeString& source,
index 878225546ec87996efa01444cb18e69ee56a6962..229c5cb0253a8a91a0aac348a2f15d61d6a61c91 100644 (file)
@@ -118,7 +118,7 @@ void CharsetDetectionTest::runIndexedTest( int32_t index, UBool exec, const char
     }
 }
 
-static UnicodeString *split(const UnicodeString &src, UChar ch, int32_t &splits)
+static UnicodeString *split(const UnicodeString &src, char16_t ch, int32_t &splits)
 {
     int32_t offset = -1;
 
@@ -190,7 +190,7 @@ void CharsetDetectionTest::checkEncoding(const UnicodeString &testString, const
 
     UnicodeString name(ucsdet_getName(matches[0], &status));
     UnicodeString lang(ucsdet_getLanguage(matches[0], &status));
-    UChar *decoded = nullptr;
+    char16_t *decoded = nullptr;
     int32_t dLength = 0;
 
     if (matchCount == 0) {
@@ -218,7 +218,7 @@ void CharsetDetectionTest::checkEncoding(const UnicodeString &testString, const
         return;
     }
 
-    decoded = new UChar[testLength];
+    decoded = new char16_t[testLength];
     dLength = ucsdet_getUChars(matches[0], decoded, testLength, &status);
 
     if (testString.compare(decoded, dLength) != 0) {
@@ -328,7 +328,7 @@ void CharsetDetectionTest::UTF8Test()
     char *bytes = extractBytes(s, "UTF-8", byteLength);
     UCharsetDetector *csd = ucsdet_open(&status);
     const UCharsetMatch *match;
-    UChar *detected = new UChar[sLength];
+    char16_t *detected = new char16_t[sLength];
 
     ucsdet_setText(csd, bytes, byteLength, &status);
     match = ucsdet_detect(csd, &status);
@@ -356,7 +356,7 @@ void CharsetDetectionTest::UTF16Test()
 {
     UErrorCode status = U_ZERO_ERROR;
     /* Notice the BOM on the start of this string */
-    UChar chars[] = {
+    char16_t chars[] = {
         0xFEFF, 0x0623, 0x0648, 0x0631, 0x0648, 0x0628, 0x0627, 0x002C,
         0x0020, 0x0628, 0x0631, 0x0645, 0x062c, 0x064a, 0x0627, 0x062a,
         0x0020, 0x0627, 0x0644, 0x062d, 0x0627, 0x0633, 0x0648, 0x0628,
@@ -576,7 +576,7 @@ void CharsetDetectionTest::IBM424Test()
 #if !UCONFIG_ONLY_HTML_CONVERSION
     UErrorCode status = U_ZERO_ERROR;
     
-    static const UChar chars[] = {
+    static const char16_t chars[] = {
             0x05D4, 0x05E4, 0x05E8, 0x05E7, 0x05DC, 0x05D9, 0x05D8, 0x0020, 0x05D4, 0x05E6, 0x05D1, 0x05D0, 0x05D9, 0x0020, 0x05D4, 0x05E8,
             0x05D0, 0x05E9, 0x05D9, 0x002C, 0x0020, 0x05EA, 0x05EA, 0x0020, 0x05D0, 0x05DC, 0x05D5, 0x05E3, 0x0020, 0x05D0, 0x05D1, 0x05D9,
             0x05D7, 0x05D9, 0x0020, 0x05DE, 0x05E0, 0x05D3, 0x05DC, 0x05D1, 0x05DC, 0x05D9, 0x05D8, 0x002C, 0x0020, 0x05D4, 0x05D5, 0x05E8,
@@ -596,7 +596,7 @@ void CharsetDetectionTest::IBM424Test()
             0x05EA, 0x05DE, 0x05DC, 0x05D9, 0x05DC, 0x0020, 0x05D4, 0x05E2, 0x05D3, 0x05D5, 0x05D9, 0x05D5, 0x05EA, 0x0000
     };
     
-    static const UChar chars_reverse[] = {
+    static const char16_t chars_reverse[] = {
             0x05EA, 0x05D5, 0x05D9, 0x05D5, 0x05D3, 0x05E2, 0x05D4, 0x0020, 0x05DC, 0x05D9, 0x05DC, 0x05DE, 0x05EA,
             0x05D1, 0x0020, 0x05DF, 0x05D9, 0x05D9, 0x05E2, 0x05E9, 0x0020, 0x05E8, 0x05D7, 0x05D0, 0x05DC, 0x0020, 0x05D5, 0x05EA, 0x05D8,
             0x05DC, 0x05D7, 0x05D4, 0x0020, 0x05EA, 0x05D0, 0x0020, 0x05DC, 0x05D1, 0x05D9, 0x05E7, 0x0020, 0x05D8, 0x05D9, 0x05DC, 0x05D1,
@@ -674,7 +674,7 @@ void CharsetDetectionTest::IBM420Test()
 #if !UCONFIG_ONLY_HTML_CONVERSION
     UErrorCode status = U_ZERO_ERROR;
     
-    static const UChar chars[] = {
+    static const char16_t chars[] = {
         0x0648, 0x064F, 0x0636, 0x0639, 0x062A, 0x0020, 0x0648, 0x0646, 0x064F, 0x0641, 0x0630, 0x062A, 0x0020, 0x0628, 0x0631, 0x0627,
         0x0645, 0x062C, 0x0020, 0x062A, 0x0623, 0x0645, 0x064A, 0x0646, 0x0020, 0x0639, 0x062F, 0x064A, 0x062F, 0x0629, 0x0020, 0x0641,
         0x064A, 0x0020, 0x0645, 0x0624, 0x0633, 0x0633, 0x0629, 0x0020, 0x0627, 0x0644, 0x062A, 0x0623, 0x0645, 0x064A, 0x0646, 0x0020,
@@ -690,7 +690,7 @@ void CharsetDetectionTest::IBM420Test()
         0x062F, 0x064A, 0x0629, 0x0020, 0x0648, 0x0627, 0x0644, 0x0627, 0x062C, 0x062A, 0x0645, 0x0627, 0x0639, 0x064A, 0x0629, 0x002E,
         0x0000
     };
-    static const UChar chars_reverse[] = {
+    static const char16_t chars_reverse[] = {
         0x002E, 0x0629, 0x064A, 0x0639, 0x0627, 0x0645, 0x062A, 0x062C, 0x0627, 0x0644, 0x0627, 0x0648, 0x0020, 0x0629, 0x064A, 0x062F,
         0x0627, 0x0635, 0x062A, 0x0642, 0x0627, 0x0644, 0x0627, 0x0020, 0x0631, 0x0637, 0x0627, 0x062E, 0x0645, 0x0644, 0x0627, 0x0020,
         0x0647, 0x062C, 0x0648, 0x0628, 0x0020, 0x0644, 0x064A, 0x0626, 0x0627, 0x0631, 0x0633, 0x0627, 0x0020, 0x0629, 0x0644, 0x0648,
index d82ec91b4769fa532d7207ca3c8ec21c77cc7e19..fc77c57de142e696e27867499eadcdbcddfdc21b 100644 (file)
@@ -44,7 +44,7 @@ CollationCurrencyTest::~CollationCurrencyTest()
 void CollationCurrencyTest::currencyTest(/*char *par*/)
 {
     // All the currency symbols, in collation order
-    static const UChar currency[][2] =
+    static const char16_t currency[][2] =
     {
       { 0x00A4, 0x0000}, /*00A4; L; [14 36, 03, 03]    # [082B.0020.0002] # CURRENCY SIGN*/
       { 0x00A2, 0x0000}, /*00A2; L; [14 38, 03, 03]    # [082C.0020.0002] # CENT SIGN*/
index 89482d5d70d3e90f9287493761a56a45d602cef5..75f1e4353eab9dfdfd1dbee2280fb0df35bb0976 100644 (file)
@@ -446,11 +446,11 @@ void DataDrivenCalendarTest::testConvert(TestData *testData,
 
 void DataDrivenCalendarTest::processTest(TestData *testData) {
     //Calendar *cal= nullptr;
-    //const UChar *arguments= nullptr;
+    //const char16_t *arguments= nullptr;
     //int32_t argLen = 0;
     char testType[256] = "";
     const DataMap *settings= nullptr;
-    //const UChar *type= nullptr;
+    //const char16_t *type= nullptr;
     UErrorCode status = U_ZERO_ERROR;
     UnicodeString testSetting;
     int n = 0;
index 14d8fa7abaab5d88a41119f404796a654d58d4b2..e782169dd3d5165c516a4d4158268bd477062e0e 100644 (file)
@@ -328,11 +328,11 @@ void DataDrivenFormatTest::testConvertDate(TestData *testData,
 
 void DataDrivenFormatTest::processTest(TestData *testData) {
     //Format *cal= nullptr;
-    //const UChar *arguments= nullptr;
+    //const char16_t *arguments= nullptr;
     //int32_t argLen = 0;
     char testType[256] = "";
     const DataMap *settings= nullptr;
-    //const UChar *type= nullptr;
+    //const char16_t *type= nullptr;
     UErrorCode status = U_ZERO_ERROR;
     UnicodeString testSetting;
     int n = 0;
index 57f4a21d504111a899a28cbf24e7047d14428b0e..353b0478239f0c7ebbf63b929a1a3d3117415640 100644 (file)
@@ -15,8 +15,8 @@
 #include "unicode/localpointer.h"
 #include "ustrfmt.h"
 
-static UBool isCROrLF(UChar c) { return c == 0xa || c == 0xd; }
-static UBool isSpace(UChar c) { return c == 9 || c == 0x20 || c == 0x3000; }
+static UBool isCROrLF(char16_t c) { return c == 0xa || c == 0xd; }
+static UBool isSpace(char16_t c) { return c == 9 || c == 0x20 || c == 0x3000; }
 
 void DataDrivenNumberFormatTestSuite::run(const char *fileName, UBool runAllTests) {
     fFileLineNumber = 0;
@@ -119,7 +119,7 @@ DataDrivenNumberFormatTestSuite::~DataDrivenNumberFormatTestSuite() {
 }
 
 UBool DataDrivenNumberFormatTestSuite::breaksC() {
-    return (NFTT_GET_FIELD(fTuple, breaks, "").toUpper().indexOf((UChar)0x43) != -1);
+    return (NFTT_GET_FIELD(fTuple, breaks, "").toUpper().indexOf((char16_t)0x43) != -1);
 }
 
 void DataDrivenNumberFormatTestSuite::setTupleField(UErrorCode &status) {
@@ -146,12 +146,12 @@ int32_t
 DataDrivenNumberFormatTestSuite::splitBy(
         UnicodeString *columnValues,
         int32_t columnValuesCount,
-        UChar delimiter) {
+        char16_t delimiter) {
     int32_t colIdx = 0;
     int32_t colStart = 0;
     int32_t len = fFileLine.length();
     for (int32_t idx = 0; colIdx < columnValuesCount - 1 && idx < len; ++idx) {
-        UChar ch = fFileLine.charAt(idx);
+        char16_t ch = fFileLine.charAt(idx);
         if (ch == delimiter) {
             columnValues[colIdx++] = 
                     fFileLine.tempSubString(colStart, idx - colStart);
@@ -175,7 +175,7 @@ void DataDrivenNumberFormatTestSuite::showError(const char *message) {
 }
 
 void DataDrivenNumberFormatTestSuite::showFailure(const UnicodeString &message) {
-    UChar lineStr[20];
+    char16_t lineStr[20];
     uprv_itou(
             lineStr, UPRV_LENGTHOF(lineStr), (uint32_t) fFileLineNumber, 10, 1);
     UnicodeString fullMessage("line ");
@@ -187,7 +187,7 @@ void DataDrivenNumberFormatTestSuite::showFailure(const UnicodeString &message)
 UBool DataDrivenNumberFormatTestSuite::readLine(
         UCHARBUF *f, UErrorCode &status) {
     int32_t lineLength;
-    const UChar *line = ucbuf_readline(f, &lineLength, &status);
+    const char16_t *line = ucbuf_readline(f, &lineLength, &status);
     if(line == nullptr || U_FAILURE(status)) {
         if (U_FAILURE(status)) {
             errln("Error reading line from file.");
index 4dc0c2628e24735ec3a7befe20eca3f80b23da93..ad92df18371e292d00a387d12611f4c438481027 100644 (file)
@@ -129,7 +129,7 @@ class DataDrivenNumberFormatTestSuite : public IntlTest {
     int32_t splitBy(
             UnicodeString *columnValues,
             int32_t columnValueCount,
-            UChar delimiter);
+            char16_t delimiter);
     void showError(const char *message);
     void showFailure(const UnicodeString &message);
     void showLineInfo();
index ed8e3802411e759042741c2dcaa55a05dcf0da6b..10c4abde5a3c5deff53acbc099f0e3c149332224 100644 (file)
@@ -218,7 +218,7 @@ void DecimalFormatTest::DataDrivenTests() {
     }
 
     int32_t    len;
-    UChar *testData = ReadAndConvertFile(srcPath, len, "utf-8", status);
+    char16_t *testData = ReadAndConvertFile(srcPath, len, "utf-8", status);
     if (U_FAILURE(status)) {
         return; /* something went wrong, error already output */
     }
index 8d48c203a81cd2812f90bbbf7994b865d964ea18..93b969e988ba699040f1e640d230317dd7893d13 100644 (file)
@@ -52,7 +52,7 @@ CollationGermanTest::~CollationGermanTest()
     delete myCollation;
 }
 
-const UChar CollationGermanTest::testSourceCases[][CollationGermanTest::MAX_TOKEN_LEN] =
+const char16_t CollationGermanTest::testSourceCases[][CollationGermanTest::MAX_TOKEN_LEN] =
 {
     {0x47, 0x72, 0x00F6, 0x00DF, 0x65, 0},
     {0x61, 0x62, 0x63, 0},
@@ -68,7 +68,7 @@ const UChar CollationGermanTest::testSourceCases[][CollationGermanTest::MAX_TOKE
     {0x53, 0x74, 0x72, 0x61, 0x00DF, 0x65, 0}
 };
 
-const UChar CollationGermanTest::testTargetCases[][CollationGermanTest::MAX_TOKEN_LEN] =
+const char16_t CollationGermanTest::testTargetCases[][CollationGermanTest::MAX_TOKEN_LEN] =
 {
     {0x47, 0x72, 0x6f, 0x73, 0x73, 0x69, 0x73, 0x74, 0},
     {0x61, 0x0308, 0x62, 0x63, 0},
index 8b3a625850e9f1d492a2111d82946d58c46d0e81..5459c9b14f36d831c48a14dbcfd049ad2c449416 100644 (file)
@@ -40,8 +40,8 @@ public:
     void TestTertiary(/* char* par */);
 
 private:
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[][2];
 
     Collator *myCollation;
index 6afd92330b4ff384985592a970f4a7943af787e5..22f4147ab8705283eebda94c4a4b4854072559a7 100644 (file)
@@ -140,7 +140,7 @@ void DateFormatTest::TestPatterns() {
         const char *actualPattern;
         const char *expectedPattern;
         const char *localeID;
-        const UChar *expectedLocalPattern;
+        const char16_t *expectedLocalPattern;
     } EXPECTED[] = {
         {UDAT_YEAR, "y", "en",u"y"},
 
@@ -420,7 +420,7 @@ DateFormatTest::TestTwoDigitYearDSTParse(void)
 
 // -------------------------------------
 
-UChar toHexString(int32_t i) { return (UChar)(i + (i < 10 ? 0x30 : (0x41 - 10))); }
+char16_t toHexString(int32_t i) { return (char16_t)(i + (i < 10 ? 0x30 : (0x41 - 10))); }
 
 UnicodeString&
 DateFormatTest::escape(UnicodeString& s)
@@ -428,10 +428,10 @@ DateFormatTest::escape(UnicodeString& s)
     UnicodeString buf;
     for (int32_t i=0; i<s.length(); ++i)
     {
-        UChar c = s[(int32_t)i];
-        if (c <= (UChar)0x7F) buf += c;
+        char16_t c = s[(int32_t)i];
+        if (c <= (char16_t)0x7F) buf += c;
         else {
-            buf += (UChar)0x5c; buf += (UChar)0x55;
+            buf += (char16_t)0x5c; buf += (char16_t)0x55;
             buf += toHexString((c & 0xF000) >> 12);
             buf += toHexString((c & 0x0F00) >> 8);
             buf += toHexString((c & 0x00F0) >> 4);
@@ -533,7 +533,7 @@ void DateFormatTest::TestFieldPosition() {
     dateFormats[1] = DateFormat::createDateTimeInstance(DateFormat::kFull, DateFormat::kFull, Locale::getFrance());
     // Make the pattern "G y M d..."
     buf.remove().append(PATTERN_CHARS);
-    for (j=buf.length()-1; j>=0; --j) buf.insert(j, (UChar)32/*' '*/);
+    for (j=buf.length()-1; j>=0; --j) buf.insert(j, (char16_t)32/*' '*/);
     dateFormats[2] = new SimpleDateFormat(buf, Locale::getUS(), ec);
     // Make the pattern "GGGG yyyy MMMM dddd..."
     for (j=buf.length()-1; j>=0; j-=2) {
@@ -3802,11 +3802,11 @@ void DateFormatTest::Test6726(void)
 
 
     logln("strm.charAt(10)=%04X wanted 0x20\n", strm.charAt(10));
-    if (strm.charAt(10) != UChar(0x0020)) {
+    if (strm.charAt(10) != char16_t(0x0020)) {
       errln((UnicodeString)"FAIL: Improper formatted date: " + strm );
     }
     logln("strs.charAt(10)=%04X wanted 0x20\n", strs.charAt(8));
-    if (strs.charAt(10)  != UChar(0x0020)) {
+    if (strs.charAt(10)  != char16_t(0x0020)) {
         errln((UnicodeString)"FAIL: Improper formatted date: " + strs);
     }
 
@@ -4808,7 +4808,7 @@ void DateFormatTest::TestNumberFormatOverride() {
         fmt->adoptNumberFormat(fields, check_nf, status);
         assertSuccess("adoptNumberFormat check_nf", status);
 
-        const NumberFormat* get_nf = fmt->getNumberFormatForField((UChar)0x004D /*'M'*/);
+        const NumberFormat* get_nf = fmt->getNumberFormatForField((char16_t)0x004D /*'M'*/);
         if (get_nf != check_nf) errln("FAIL: getter and setter do not work");
     }
     NumberFormat* check_nf = NumberFormat::createInstance(Locale("en_US"), status);
@@ -5005,7 +5005,7 @@ void DateFormatTest::TestPatternFromSkeleton() {
     static const struct {
         const Locale& locale;
         const char* const skeleton;
-        const UChar* const pattern;
+        const char16_t* const pattern;
     } TESTDATA[] = {
         // Ticket #11985
         {Locale::getEnglish(), "jjmm", u"h:mm\u202Fa"},
index 278f878b5587a2a79ceeb96c1fe1f8f191727d77..0ddb32a95b9415632122088f81956c5cd3347415 100644 (file)
@@ -1331,7 +1331,7 @@ void DateIntervalFormatTest::testContext() {
         const char * skeleton;
         UDisplayContext context;
         const UDate  deltaDate;
-        const UChar* expectResult;
+        const char16_t* expectResult;
     } DateIntervalContextItem;
     static const DateIntervalContextItem testItems[] = {
         { "cs",    "MMMEd",    CAP_NONE,  60.0*_DAY,  u"po 27. 9. – pá 26. 11." },
index cad25502d63e5e44e949d3cf3c56aa4f57bc8cb3..1fa1a8b19f79072402590616fd5f5599360f3a61 100644 (file)
@@ -782,12 +782,12 @@ void IntlTestDateTimePatternGeneratorAPI::testAPI(/*char *par*/)
         dataerrln("ERROR: Could not create DateTimePatternGenerator (Locale::getFrench()) - exiting");
         return;
     }
-    UChar newChar;
+    char16_t newChar;
     for (i=0; i<10; ++i) {
         UnicodeString randomSkeleton;
         int32_t len = rand() % 20;
         for (int32_t j=0; j<len; ++j ) {
-            while ((newChar = (UChar)(rand()%0x7f))>=(UChar)0x20) {
+            while ((newChar = (char16_t)(rand()%0x7f))>=(char16_t)0x20) {
                 randomSkeleton += newChar;
             }
         }
@@ -920,7 +920,7 @@ void IntlTestDateTimePatternGeneratorAPI::testAPI(/*char *par*/)
 typedef struct DTPtnGenOptionsData {
     const char *locale;
     const char *skel;
-    const UChar *expectedPattern;
+    const char16_t *expectedPattern;
     UDateTimePatternMatchOptions    options;
 } DTPtnGenOptionsData;
 void IntlTestDateTimePatternGeneratorAPI::testOptions(/*char *par*/)
@@ -1112,7 +1112,7 @@ void IntlTestDateTimePatternGeneratorAPI::testAllFieldPatterns(/*char *par*/)
                         int32_t patIndx, patLen = pattern.length();
                         UBool inQuoted = false;
                         for (patIndx = 0; patIndx < patLen; patIndx++) {
-                            UChar c = pattern.charAt(patIndx);
+                            char16_t c = pattern.charAt(patIndx);
                             if (c == 0x27) {
                                 inQuoted = !inQuoted;
                             } else if (!inQuoted && c <= 0x007A && c >= 0x0041) {
@@ -1316,7 +1316,7 @@ void IntlTestDateTimePatternGeneratorAPI::testGetFieldDisplayNames() {
         if (U_FAILURE(status)) {
             dataerrln("FAIL: DateTimePatternGenerator::createInstance failed for locale %s", testDataPtr->locale);
         } else {
-            UChar expName[kFieldDisplayNameMax+1];
+            char16_t expName[kFieldDisplayNameMax+1];
             u_unescape(testDataPtr->expected, expName, kFieldDisplayNameMax);
             expName[kFieldDisplayNameMax] = 0; // ensure 0 termination
             UnicodeString getName = dtpg->getFieldDisplayName(testDataPtr->field, testDataPtr->width);
@@ -1329,7 +1329,7 @@ void IntlTestDateTimePatternGeneratorAPI::testGetFieldDisplayNames() {
     }
 }
 
-static const UChar timeCycleChars[] = { (UChar)0x0048, (UChar)0x0068, (UChar)0x004B, (UChar)0x006B, (UChar)0 };
+static const char16_t timeCycleChars[] = { (char16_t)0x0048, (char16_t)0x0068, (char16_t)0x004B, (char16_t)0x006B, (char16_t)0 };
 
 void IntlTestDateTimePatternGeneratorAPI::testJjMapping() {
     UErrorCode status = U_ZERO_ERROR;
@@ -1390,8 +1390,8 @@ void IntlTestDateTimePatternGeneratorAPI::testJjMapping() {
             errln("FAIL: DateTimePatternGenerator::staticGetSkeleton locale %s: %s", localeID, u_errorName(status));
             continue;
         }
-        const UChar* charPtr = timeCycleChars;
-        for (; *charPtr != (UChar)0; charPtr++) {
+        const char16_t* charPtr = timeCycleChars;
+        for (; *charPtr != (char16_t)0; charPtr++) {
              if (jPatSkeleton.indexOf(*charPtr) >= 0) {
                  if (shortPatSkeleton.indexOf(*charPtr) < 0) {
                      char jcBuf[2], spBuf[32], jpBuf[32];
@@ -1522,7 +1522,7 @@ void IntlTestDateTimePatternGeneratorAPI::test_jConsistencyOddLocales() { // ICU
         "xz-ZX",  // unknown language with unknown country
         "ars", "wuu" // aliased locales
     };
-    static const UChar* skeleton = u"jm";
+    static const char16_t* skeleton = u"jm";
     for (const char* localeID: localeIDs) {
         UErrorCode status = U_ZERO_ERROR;
         Locale locale(localeID);
@@ -1566,7 +1566,7 @@ void IntlTestDateTimePatternGeneratorAPI::testBestPattern() {
     const struct TestCase {
         const char* localeID;
         const char* skeleton;
-        const UChar* expectedPattern;
+        const char16_t* expectedPattern;
     } testCases[] = {
         // ICU-21650: (See the "week day" section of https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
         // for a full explanation of why this is the desired behavior)
@@ -1764,7 +1764,7 @@ void IntlTestDateTimePatternGeneratorAPI::testDateTimePatterns() {
 void IntlTestDateTimePatternGeneratorAPI::testRegionOverride() {
     const struct TestCase {
         const char* locale;
-        const UChar* expectedPattern;
+        const char16_t* expectedPattern;
         UDateFormatHourCycle expectedHourCycle;
     } testCases[] = {
         { "en_US",           u"h:mm\u202fa", UDAT_HOUR_CYCLE_12 },
index fd913bf45241f77f74bd9ec85978727d6a7101be..97845a32b67ed60fd36ef287d24823edc121e15a 100644 (file)
@@ -29,108 +29,108 @@ CollationEnglishTest::~CollationEnglishTest()
     delete myCollation;
 }
 
-static const UChar testSourceCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0020 /* ' ' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0048 /* 'H' */, (UChar)0x0065 /* 'e' */, (UChar)0x006C /* 'l' */, (UChar)0x006C /* 'l' */, (UChar)0x006F /* 'o' */, 0},
-        {(UChar)0x0041 /* 'A' */, (UChar)0x0042 /* 'B' */, (UChar)0x0043 /* 'C' */, 0}, 
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0070 /* 'p' */, 0x00EA, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, 0},                                            
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, 0x00E9, 0},
-        {0x00C4, (UChar)0x0042 /* 'B' */, 0x0308, (UChar)0x0043 /* 'C' */, 0x0308, 0},
-        {(UChar)0x0061 /* 'a' */, 0x0308, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, (UChar)0x0072 /* 'r' */, 0},
-        {(UChar)0x0072 /* 'r' */, (UChar)0x006F /* 'o' */, (UChar)0x006C /* 'l' */, (UChar)0x0065 /* 'e' */, (UChar)0x0073 /* 's' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0041 /* 'A' */, 0},
-        {(UChar)0x0041 /* 'A' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, 0},                                                                
-        {(UChar)0x0074 /* 't' */, (UChar)0x0063 /* 'c' */, (UChar)0x006F /* 'o' */, (UChar)0x006D /* 'm' */, (UChar)0x0070 /* 'p' */, (UChar)0x0061 /* 'a' */, (UChar)0x0072 /* 'r' */, (UChar)0x0065 /* 'e' */, (UChar)0x0070 /* 'p' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0069 /* 'i' */, (UChar)0x006E /* 'n' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, 0}, 
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0023 /* '#' */, (UChar)0x0062 /* 'b' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0023 /* '#' */, (UChar)0x0062 /* 'b' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0041 /* 'A' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {0x00E6, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},                                            
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x0048 /* 'H' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, 0x0308, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0074 /* 't' */, (UChar)0x0068 /* 'h' */, (UChar)0x0069 /* 'i' */, 0x0302, (UChar)0x0073 /* 's' */, 0},
-        {(UChar)0x0070 /* 'p' */, 0x00EA, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},                                                         
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, 0x00E6, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, 0x00E6, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},               
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, 0x00E9, 0}                                            // 49
+static const char16_t testSourceCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x002D /* '-' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x0020 /* ' ' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x002D /* '-' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0048 /* 'H' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x006C /* 'l' */, (char16_t)0x006C /* 'l' */, (char16_t)0x006F /* 'o' */, 0},
+        {(char16_t)0x0041 /* 'A' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0043 /* 'C' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x002D /* '-' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x002D /* '-' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00EA, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, 0x00E9, 0},
+        {0x00C4, (char16_t)0x0042 /* 'B' */, 0x0308, (char16_t)0x0043 /* 'C' */, 0x0308, 0},
+        {(char16_t)0x0061 /* 'a' */, 0x0308, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x0072 /* 'r' */, 0},
+        {(char16_t)0x0072 /* 'r' */, (char16_t)0x006F /* 'o' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x0073 /* 's' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0041 /* 'A' */, 0},
+        {(char16_t)0x0041 /* 'A' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, 0},
+        {(char16_t)0x0074 /* 't' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006F /* 'o' */, (char16_t)0x006D /* 'm' */, (char16_t)0x0070 /* 'p' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x0070 /* 'p' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x006E /* 'n' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0023 /* '#' */, (char16_t)0x0062 /* 'b' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0023 /* '#' */, (char16_t)0x0062 /* 'b' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0041 /* 'A' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {0x00E6, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0048 /* 'H' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, 0x0308, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0074 /* 't' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0069 /* 'i' */, 0x0302, (char16_t)0x0073 /* 's' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00EA, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, 0x00E6, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, 0x00E6, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, 0x00E9, 0}                                            // 49
 };
 
-static const UChar testTargetCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x002D /* '-' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, 0},
-        {(UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, (UChar)0x006C /* 'l' */, (UChar)0x006C /* 'l' */, (UChar)0x006F /* 'o' */, 0},
-        {(UChar)0x0041 /* 'A' */, (UChar)0x0042 /* 'B' */, (UChar)0x0043 /* 'C' */, 0},
-        {(UChar)0x0041 /* 'A' */, (UChar)0x0042 /* 'B' */, (UChar)0x0043 /* 'C' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, (UChar)0x0073 /* 's' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, (UChar)0x0073 /* 's' */, 0},
-        {(UChar)0x0062 /* 'b' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0063 /* 'c' */, (UChar)0x006B /* 'k' */, (UChar)0x0062 /* 'b' */, (UChar)0x0069 /* 'i' */, (UChar)0x0072 /* 'r' */, (UChar)0x0064 /* 'd' */, 0},                             
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, 0x00E9, 0},
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, (UChar)0x0072 /* 'r' */, 0},
-        {0x00C4, (UChar)0x0042 /* 'B' */, 0x0308, (UChar)0x0043 /* 'C' */, 0x0308, 0},
-        {(UChar)0x0041 /* 'A' */, 0x0308, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, 0},
-        {(UChar)0x0072 /* 'r' */, (UChar)0x006F /* 'o' */, 0x0302, (UChar)0x006C /* 'l' */, (UChar)0x0065 /* 'e' */, 0},
-        {(UChar)0x0041 /* 'A' */, 0x00E1, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0041 /* 'A' */, 0x00E1, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},                                                             
-        {(UChar)0x0054 /* 'T' */, (UChar)0x0043 /* 'C' */, (UChar)0x006F /* 'o' */, (UChar)0x006D /* 'm' */, (UChar)0x0070 /* 'p' */, (UChar)0x0061 /* 'a' */, (UChar)0x0072 /* 'r' */, (UChar)0x0065 /* 'e' */, (UChar)0x0050 /* 'P' */, (UChar)0x006C /* 'l' */, (UChar)0x0061 /* 'a' */, (UChar)0x0069 /* 'i' */, (UChar)0x006E /* 'n' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0042 /* 'B' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0023 /* '#' */, (UChar)0x0042 /* 'B' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0026 /* '&' */, (UChar)0x0062 /* 'b' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0023 /* '#' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {0x00C4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {0x00C4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},
-        {0x00C4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, (UChar)0x0064 /* 'd' */, (UChar)0x0061 /* 'a' */, 0},                                             
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0023 /* '#' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x003D /* '=' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0064 /* 'd' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0043 /* 'C' */, (UChar)0x0048 /* 'H' */, (UChar)0x0063 /* 'c' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0074 /* 't' */, (UChar)0x0068 /* 'h' */, 0x00EE, (UChar)0x0073 /* 's' */, 0},
-        {(UChar)0x0070 /* 'p' */, 0x00E9, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, 0x00E9, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0042 /* 'B' */, (UChar)0x0043 /* 'C' */, 0},                                                          
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0062 /* 'b' */, (UChar)0x0064 /* 'd' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, 0x00C6, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0042 /* 'B' */, (UChar)0x0064 /* 'd' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, 0x00C6, (UChar)0x0063 /* 'c' */, 0},
-        {(UChar)0x0061 /* 'a' */, (UChar)0x0042 /* 'B' */, (UChar)0x0064 /* 'd' */, 0},
-        {0x00E4, (UChar)0x0062 /* 'b' */, (UChar)0x0063 /* 'c' */, 0},          
-        {(UChar)0x0070 /* 'p' */, 0x00EA, (UChar)0x0063 /* 'c' */, (UChar)0x0068 /* 'h' */, (UChar)0x0065 /* 'e' */, 0}                                           // 49
+static const char16_t testTargetCases[][CollationEnglishTest::MAX_TOKEN_LEN] = {
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x002D /* '-' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, 0},
+        {(char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x006C /* 'l' */, (char16_t)0x006C /* 'l' */, (char16_t)0x006F /* 'o' */, 0},
+        {(char16_t)0x0041 /* 'A' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0043 /* 'C' */, 0},
+        {(char16_t)0x0041 /* 'A' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0043 /* 'C' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0073 /* 's' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0073 /* 's' */, 0},
+        {(char16_t)0x0062 /* 'b' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x006B /* 'k' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, 0x00E9, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x0072 /* 'r' */, 0},
+        {0x00C4, (char16_t)0x0042 /* 'B' */, 0x0308, (char16_t)0x0043 /* 'C' */, 0x0308, 0},
+        {(char16_t)0x0041 /* 'A' */, 0x0308, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */, 0},
+        {(char16_t)0x0072 /* 'r' */, (char16_t)0x006F /* 'o' */, 0x0302, (char16_t)0x006C /* 'l' */, (char16_t)0x0065 /* 'e' */, 0},
+        {(char16_t)0x0041 /* 'A' */, 0x00E1, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0041 /* 'A' */, 0x00E1, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0054 /* 'T' */, (char16_t)0x0043 /* 'C' */, (char16_t)0x006F /* 'o' */, (char16_t)0x006D /* 'm' */, (char16_t)0x0070 /* 'p' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0072 /* 'r' */, (char16_t)0x0065 /* 'e' */, (char16_t)0x0050 /* 'P' */, (char16_t)0x006C /* 'l' */, (char16_t)0x0061 /* 'a' */, (char16_t)0x0069 /* 'i' */, (char16_t)0x006E /* 'n' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0023 /* '#' */, (char16_t)0x0042 /* 'B' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0026 /* '&' */, (char16_t)0x0062 /* 'b' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0023 /* '#' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {0x00C4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {0x00C4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {0x00C4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, (char16_t)0x0064 /* 'd' */, (char16_t)0x0061 /* 'a' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0023 /* '#' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x003D /* '=' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0064 /* 'd' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0043 /* 'C' */, (char16_t)0x0048 /* 'H' */, (char16_t)0x0063 /* 'c' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0074 /* 't' */, (char16_t)0x0068 /* 'h' */, 0x00EE, (char16_t)0x0073 /* 's' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00E9, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, 0x00E9, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0043 /* 'C' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0062 /* 'b' */, (char16_t)0x0064 /* 'd' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, 0x00C6, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0064 /* 'd' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, 0x00C6, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0061 /* 'a' */, (char16_t)0x0042 /* 'B' */, (char16_t)0x0064 /* 'd' */, 0},
+        {0x00E4, (char16_t)0x0062 /* 'b' */, (char16_t)0x0063 /* 'c' */, 0},
+        {(char16_t)0x0070 /* 'p' */, 0x00EA, (char16_t)0x0063 /* 'c' */, (char16_t)0x0068 /* 'h' */, (char16_t)0x0065 /* 'e' */, 0}                                           // 49
 };
 
 static const Collator::EComparisonResult results[] = {
@@ -189,7 +189,7 @@ static const Collator::EComparisonResult results[] = {
         Collator::LESS                                                                  // 49
 };
 
-static const UChar testBugs[][CollationEnglishTest::MAX_TOKEN_LEN] = {
+static const char16_t testBugs[][CollationEnglishTest::MAX_TOKEN_LEN] = {
     {0x61, 0},
     {0x41, 0},
     {0x65, 0},
@@ -204,7 +204,7 @@ static const UChar testBugs[][CollationEnglishTest::MAX_TOKEN_LEN] = {
 
 // 0x0300 is grave, 0x0301 is acute
 // the order of elements in this array must be different than the order in CollationFrenchTest
-static const UChar testAcute[][CollationEnglishTest::MAX_TOKEN_LEN] = {
+static const char16_t testAcute[][CollationEnglishTest::MAX_TOKEN_LEN] = {
     {0x65, 0x65, 0},
     {0x65, 0x65, 0x0301, 0},
     {0x65, 0x65, 0x0301, 0x0300, 0},
@@ -232,15 +232,15 @@ static const UChar testAcute[][CollationEnglishTest::MAX_TOKEN_LEN] = {
     {0x65, 0x0300, 0x0301, 0x65, 0x0300, 0x0301, 0}
 };
 
-static const UChar testMore[][CollationEnglishTest::MAX_TOKEN_LEN] = {
-    {(UChar)0x0061 /* 'a' */, (UChar)0x0065 /* 'e' */, 0},
+static const char16_t testMore[][CollationEnglishTest::MAX_TOKEN_LEN] = {
+    {(char16_t)0x0061 /* 'a' */, (char16_t)0x0065 /* 'e' */, 0},
     { 0x00E6, 0},
     { 0x00C6, 0},
-    {(UChar)0x0061 /* 'a' */, (UChar)0x0066 /* 'f' */, 0},
-    {(UChar)0x006F /* 'o' */, (UChar)0x0065 /* 'e' */, 0},
+    {(char16_t)0x0061 /* 'a' */, (char16_t)0x0066 /* 'f' */, 0},
+    {(char16_t)0x006F /* 'o' */, (char16_t)0x0065 /* 'e' */, 0},
     { 0x0153, 0},
     { 0x0152, 0},
-    {(UChar)0x006F /* 'o' */, (UChar)0x0066 /* 'f' */, 0},
+    {(char16_t)0x006F /* 'o' */, (char16_t)0x0066 /* 'f' */, 0},
 };
 
 void CollationEnglishTest::TestTertiary(/* char* par */)
index cea658a338635719eed29c2fd157608dae202c68..45afc6a08f2572be177185d1a2104afb5b77d4e1 100644 (file)
@@ -45,7 +45,7 @@ CollationSpanishTest::~CollationSpanishTest()
     delete myCollation;
 }
 
-const UChar CollationSpanishTest::testSourceCases[][CollationSpanishTest::MAX_TOKEN_LEN] = {
+const char16_t CollationSpanishTest::testSourceCases[][CollationSpanishTest::MAX_TOKEN_LEN] = {
     {0x61, 0x6c, 0x69, 0x61, 0x73, 0},
     {0x45, 0x6c, 0x6c, 0x69, 0x6f, 0x74, 0},
     {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0},
@@ -57,7 +57,7 @@ const UChar CollationSpanishTest::testSourceCases[][CollationSpanishTest::MAX_TO
     {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0},
 };
 
-const UChar CollationSpanishTest::testTargetCases[][CollationSpanishTest::MAX_TOKEN_LEN] = {
+const char16_t CollationSpanishTest::testTargetCases[][CollationSpanishTest::MAX_TOKEN_LEN] = {
     {0x61, 0x6c, 0x6c, 0x69, 0x61, 0x73, 0},
     {0x45, 0x6d, 0x69, 0x6f, 0x74, 0},
     {0x68, 0x65, 0x6c, 0x6c, 0x4f, 0},
index d4b79b0ba8f285684dcd739709306b6eb649efa7..60d8b95a4718a3563c40f062d9a91c689aef02c4 100644 (file)
@@ -39,8 +39,8 @@ public:
     void TestTertiary(/* char* par */);
 
 private:
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[];
 
     Collator *myCollation;
index bdea267b6de9f7ae5d8f5d7ce426e94c310685d7..1cd3bcf2fa0107c508fcd523bb227189c2929a28 100644 (file)
@@ -43,7 +43,7 @@ CollationFinnishTest::~CollationFinnishTest()
     delete myCollation;
 }
 
-const UChar CollationFinnishTest::testSourceCases[][CollationFinnishTest::MAX_TOKEN_LEN] = {
+const char16_t CollationFinnishTest::testSourceCases[][CollationFinnishTest::MAX_TOKEN_LEN] = {
     {0x77, 0x61, 0x74, 0},  // "wat"
     {0x76, 0x61, 0x74, 0},  // "vat"
     {0x61, 0x00FC, 0x62, 0x65, 0x63, 0x6b, 0},
@@ -51,7 +51,7 @@ const UChar CollationFinnishTest::testSourceCases[][CollationFinnishTest::MAX_TO
     {0x77, 0x61, 0x74, 0}   // "wat"
 };
 
-const UChar CollationFinnishTest::testTargetCases[][CollationFinnishTest::MAX_TOKEN_LEN] = {
+const char16_t CollationFinnishTest::testTargetCases[][CollationFinnishTest::MAX_TOKEN_LEN] = {
     {0x76, 0x61, 0x74, 0},  // "vat"
     {0x77, 0x61, 0x79, 0},
     {0x61, 0x78, 0x62, 0x65, 0x63, 0x6b, 0},
index 2f8c0a6fe6a87b99b61667d19c9f182e631ae797..ab00cd7e5b5105dd6f26f8570b606e2443fa124f 100644 (file)
@@ -38,8 +38,8 @@ public:
     void TestTertiary(/* char* par */);
 
 private:
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[];
 
     Collator *myCollation;
index 5415531e0e880c911401ca89f2c0afb06b4b7877..8352da2fde58e4128fca2454fbf2b4205e62a06c 100644 (file)
@@ -67,7 +67,7 @@ UnicodeString FieldsSet::diffFrom(const FieldsSet& other, UErrorCode& status) co
     return str;
 }
 
-static UnicodeString *split(const UnicodeString &src, UChar ch, int32_t &splits)
+static UnicodeString *split(const UnicodeString &src, char16_t ch, int32_t &splits)
 {
     int32_t offset = -1;
 
@@ -116,7 +116,7 @@ int32_t FieldsSet::parseFrom(const UnicodeString& str, const
 
         if(U_FAILURE(status)) {
             char ch[256];
-            const UChar *u = kv[0].getBuffer();
+            const char16_t *u = kv[0].getBuffer();
             int32_t len = kv[0].length();
             u_UCharsToChars(u, ch, len);
             ch[len] = 0; /* include terminating \0 */
@@ -131,7 +131,7 @@ int32_t FieldsSet::parseFrom(const UnicodeString& str, const
 
             if(U_FAILURE(status)) {
                 char ch[256];
-                const UChar *u = kv[1].getBuffer();
+                const char16_t *u = kv[1].getBuffer();
                 int32_t len = kv[1].length();
                 u_UCharsToChars(u, ch, len);
                 ch[len] = 0; /* include terminating \0 */
index e9bf31e316e3b4185d56a2e4051453202882ba4e..76655c24dd92e98180c9ccaf6ecba1dc9f578c34 100644 (file)
@@ -44,7 +44,7 @@ CollationFrenchTest::~CollationFrenchTest()
     delete myCollation;
 }
 
-const UChar CollationFrenchTest::testSourceCases[][CollationFrenchTest::MAX_TOKEN_LEN] =
+const char16_t CollationFrenchTest::testSourceCases[][CollationFrenchTest::MAX_TOKEN_LEN] =
 {
     {0x0061/*'a'*/, 0x0062/*'b'*/, 0x0063/*'c'*/, 0x0000},
     {0x0043/*'C'*/, 0x004f/*'O'*/, 0x0054/*'T'*/, 0x0045/*'E'*/, 0x0000},
@@ -60,7 +60,7 @@ const UChar CollationFrenchTest::testSourceCases[][CollationFrenchTest::MAX_TOKE
     {0x0101, 0x0000}
 };
 
-const UChar CollationFrenchTest::testTargetCases[][CollationFrenchTest::MAX_TOKEN_LEN] =
+const char16_t CollationFrenchTest::testTargetCases[][CollationFrenchTest::MAX_TOKEN_LEN] =
 {
     {0x0041/*'A'*/, 0x0042/*'B'*/, 0x0043/*'C'*/, 0x0000},
     {0x0063/*'c'*/, 0x00f4, 0x0074/*'t'*/, 0x0065/*'e'*/, 0x0000},
@@ -94,7 +94,7 @@ const Collator::EComparisonResult CollationFrenchTest::results[] =
 
 // 0x0300 is grave, 0x0301 is acute
 // the order of elements in this array must be different than the order in CollationEnglishTest
-const UChar CollationFrenchTest::testAcute[][CollationFrenchTest::MAX_TOKEN_LEN] =
+const char16_t CollationFrenchTest::testAcute[][CollationFrenchTest::MAX_TOKEN_LEN] =
 {
 /*00*/    {0x0065/*'e'*/, 0x0065/*'e'*/,  0x0000},
 /*01*/    {0x0065/*'e'*/, 0x0301, 0x0065/*'e'*/,  0x0000},
@@ -123,7 +123,7 @@ const UChar CollationFrenchTest::testAcute[][CollationFrenchTest::MAX_TOKEN_LEN]
 /*18*/    {0x0065/*'e'*/, 0x0301, 0x0300, 0x0065/*'e'*/, 0x0301, 0x0300, 0x0000}
 };
 
-const UChar CollationFrenchTest::testBugs[][CollationFrenchTest::MAX_TOKEN_LEN] =
+const char16_t CollationFrenchTest::testBugs[][CollationFrenchTest::MAX_TOKEN_LEN] =
 {
     {0x0061/*'a'*/, 0x000},
     {0x0041/*'A'*/, 0x000},
index 70ca87d1f0ccc46db80dce19bd8fff0b5cceac63..a55deb6d5372e1f58286e143518afdc1d81597be 100644 (file)
@@ -40,11 +40,11 @@ public:
     void TestExtra(/* char* par */);
 
 private:
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
-    static const UChar testBugs[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testBugs[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[];
-    static const UChar testAcute[][MAX_TOKEN_LEN];
+    static const char16_t testAcute[][MAX_TOKEN_LEN];
 
     Collator *myCollation;
 };
index 93af4afa0a89587fb44416ab7c958b1902eaf114..b2a26cecf680a84f7af2ead89ad20f0acec1792e 100644 (file)
@@ -18,7 +18,7 @@
 #include "sfwdchit.h"
 #include "cmemory.h"
 
-static const UChar testCases[][G7CollationTest::MAX_TOKEN_LEN] = {
+static const char16_t testCases[][G7CollationTest::MAX_TOKEN_LEN] = {
     {  0x0062 /*'b'*/, 0x006c /*'l'*/, 0x0061 /*'a'*/, 0x0062 /*'c'*/, 0x006b /*'k'*/, 
         0x0062 /*'b'*/, 0x0069 /*'i'*/, 0x0072 /*'r'*/, 0x0064 /*'d'*/, 0x0073 /*'s'*/, 0x0000},                    /* 9 */
     { 0x0050 /*'P'*/, 0x0061 /*'a'*/, 0x0074/*'t'*/, 0x0000},                                                    /* 1 */
index e3a8485f6227bab1e199dd4f917dfa399b15bb70..0896787b225b0a5303ef8fdd9290a7afdecb5c1e 100644 (file)
 #include "idnaconf.h"
 #include "charstr.h"
 
-static const UChar C_TAG[] = {0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0}; // =====
-static const UChar C_NAMEZONE[] = {0x6E, 0x61, 0x6D, 0x65, 0x7A, 0x6F, 0x6E, 0x65, 0}; // namezone 
-static const UChar C_NAMEBASE[] = {0x6E, 0x61, 0x6D, 0x65, 0x62, 0x61, 0x73, 0x65, 0}; // namebase 
+static const char16_t C_TAG[] = {0x3D, 0x3D, 0x3D, 0x3D, 0x3D, 0}; // =====
+static const char16_t C_NAMEZONE[] = {0x6E, 0x61, 0x6D, 0x65, 0x7A, 0x6F, 0x6E, 0x65, 0}; // namezone
+static const char16_t C_NAMEBASE[] = {0x6E, 0x61, 0x6D, 0x65, 0x62, 0x61, 0x73, 0x65, 0}; // namebase
 
-static const UChar C_TYPE[] = {0x74, 0x79, 0x70, 0x65, 0}; // type
-static const UChar C_TOASCII[]  =  {0x74, 0x6F, 0x61, 0x73, 0x63, 0x69, 0x69, 0};       // toascii
-static const UChar C_TOUNICODE[] = {0x74, 0x6F, 0x75, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0}; // tounicode
+static const char16_t C_TYPE[] = {0x74, 0x79, 0x70, 0x65, 0}; // type
+static const char16_t C_TOASCII[]  =  {0x74, 0x6F, 0x61, 0x73, 0x63, 0x69, 0x69, 0};       // toascii
+static const char16_t C_TOUNICODE[] = {0x74, 0x6F, 0x75, 0x6E, 0x69, 0x63, 0x6F, 0x64, 0x65, 0}; // tounicode
 
-static const UChar C_PASSFAIL[] = {0x70, 0x61, 0x73, 0x73, 0x66, 0x61, 0x69, 0x6C, 0}; // passfail
-static const UChar C_PASS[] = {0x70, 0x61, 0x73, 0x73, 0}; // pass
-static const UChar C_FAIL[] = {0x66, 0x61, 0x69, 0x6C, 0}; // fail
+static const char16_t C_PASSFAIL[] = {0x70, 0x61, 0x73, 0x73, 0x66, 0x61, 0x69, 0x6C, 0}; // passfail
+static const char16_t C_PASS[] = {0x70, 0x61, 0x73, 0x73, 0}; // pass
+static const char16_t C_FAIL[] = {0x66, 0x61, 0x69, 0x6C, 0}; // fail
 
-static const UChar C_DESC[] = {0x64, 0x65, 0x73, 0x63, 0}; // desc
-static const UChar C_USESTD3ASCIIRULES[] = {0x55, 0x73, 0x65, 0x53, 0x54, 0x44, 
+static const char16_t C_DESC[] = {0x64, 0x65, 0x73, 0x63, 0}; // desc
+static const char16_t C_USESTD3ASCIIRULES[] = {0x55, 0x73, 0x65, 0x53, 0x54, 0x44,
        0x33, 0x41, 0x53, 0x43, 0x49, 0x49, 0x52, 0x75, 0x6C, 0x65, 0x73, 0}; // UseSTD3ASCIIRules
 
 IdnaConfTest::IdnaConfTest(){
@@ -58,9 +58,9 @@ IdnaConfTest::~IdnaConfTest(){
 #if !UCONFIG_NO_IDNA
 
 int IdnaConfTest::isNewlineMark(){
-    static const UChar LF        = 0x0a;
-    static const UChar CR        = 0x0d;
-    UChar c = base[curOffset];
+    static const char16_t LF        = 0x0a;
+    static const char16_t CR        = 0x0d;
+    char16_t c = base[curOffset];
     // CR LF
     if ( c == CR && curOffset + 1 < len && base[curOffset + 1] == LF){
         return 2;
@@ -84,7 +84,7 @@ int IdnaConfTest::isNewlineMark(){
 UBool IdnaConfTest::ReadOneLine(UnicodeString& buf){
     if ( !(curOffset < len) ) return false; // stream end
 
-    static const UChar BACKSLASH = 0x5c;
+    static const char16_t BACKSLASH = 0x5c;
     buf.remove();
     int t = 0;
     while (curOffset < len){
@@ -92,7 +92,7 @@ UBool IdnaConfTest::ReadOneLine(UnicodeString& buf){
             curOffset += t;
             break;
         }
-        UChar c = base[curOffset];
+        char16_t c = base[curOffset];
         if (c == BACKSLASH && curOffset < len -1){  // escaped new line mark
             if ((t = isNewlineMark())){
                 curOffset += 1 + t;  // BACKSLAH and NewlineMark
@@ -116,9 +116,9 @@ UBool IdnaConfTest::ReadOneLine(UnicodeString& buf){
  * and, of course, will shift tail elements.
  */
 void IdnaConfTest::ExplainCodePointTag(UnicodeString& buf){
-    buf.append((UChar)0);    // add a terminal NUL
-    UChar* bufBase = buf.getBuffer(buf.length());
-    UChar* p = bufBase;
+    buf.append((char16_t)0);    // add a terminal NUL
+    char16_t* bufBase = buf.getBuffer(buf.length());
+    char16_t* p = bufBase;
     while (*p != 0){
         if ( *p != 0x3C){    // <
             *bufBase++ = *p++;
@@ -153,8 +153,8 @@ void IdnaConfTest::Call(){
         errln("Incomplete record");
     } else {
         UErrorCode status = U_ZERO_ERROR;
-        UChar result[200] = {0,};   // simple life
-        const UChar *p = namebase.getTerminatedBuffer();
+        char16_t result[200] = {0,};   // simple life
+        const char16_t *p = namebase.getTerminatedBuffer();
         const int p_len = namebase.length();
 
         if (type == 0 && option == 0){
@@ -239,7 +239,7 @@ void IdnaConfTest::Test(void){
             Call();
        } else {
             // explain      key:value
-            int p = s.indexOf((UChar)0x3A);    // :
+            int p = s.indexOf((char16_t)0x3A);    // :
             key.setTo(s,0,p).trim();
             value.setTo(s,p+1).trim();
             if (key.compare(C_TYPE, -1) == 0){
@@ -260,7 +260,7 @@ void IdnaConfTest::Test(void){
                 } else {
                     option = 0;
                 }
-                id.setTo(value, 0, value.indexOf((UChar)0x20));    // space
+                id.setTo(value, 0, value.indexOf((char16_t)0x20));    // space
             } else if (key.compare(C_NAMEZONE, -1) == 0){
                 ExplainCodePointTag(value);
                 namezone.setTo(value);
index 80330c7b3fda7c540db491e0bf3c6523166eb066..a47751ddcff66fba7f10ecc1ec510593320f1f09 100644 (file)
@@ -28,7 +28,7 @@ private:
     void Test(void);
 
     // for test file handling
-    UChar* base;
+    char16_t* base;
     int len ;
     int curOffset;
 
index 74c24c0a922bd903790db334fa7e39231b6c945c..061705cb3e82d7c16bb667a33176dd1da8ed5760 100644 (file)
@@ -30,7 +30,7 @@
 #include "unicode/ustring.h"
 
 /* it is official IDNA ACE Prefix is "xn--" */
-static const UChar ACE_PREFIX[] ={ 0x0078,0x006E,0x002d,0x002d } ;
+static const char16_t ACE_PREFIX[] ={ 0x0078,0x006E,0x002d,0x002d } ;
 #define ACE_PREFIX_LENGTH 4
 
 #define MAX_LABEL_LENGTH 63
@@ -46,7 +46,7 @@ static const UChar ACE_PREFIX[] ={ 0x0078,0x006E,0x002d,0x002d } ;
 
 
 inline static UBool
-startsWithPrefix(const UChar* src , int32_t srcLength){
+startsWithPrefix(const char16_t* src , int32_t srcLength){
     UBool startsWithPrefix = true;
 
     if(srcLength < ACE_PREFIX_LENGTH){
@@ -61,8 +61,8 @@ startsWithPrefix(const UChar* src , int32_t srcLength){
     return startsWithPrefix;
 }
 
-inline static UChar
-toASCIILower(UChar ch){
+inline static char16_t
+toASCIILower(char16_t ch){
     if(CAPITAL_A <= ch && ch <= CAPITAL_Z){
         return ch + LOWER_CASE_DELTA;
     }
@@ -70,12 +70,12 @@ toASCIILower(UChar ch){
 }
 
 inline static int32_t
-compareCaseInsensitiveASCII(const UChar* s1, int32_t s1Len,
-                            const UChar* s2, int32_t s2Len){
+compareCaseInsensitiveASCII(const char16_t* s1, int32_t s1Len,
+                            const char16_t* s2, int32_t s2Len){
     if(s1Len != s2Len){
         return (s1Len > s2Len) ? s1Len : s2Len;
     }
-    UChar c1,c2;
+    char16_t c1,c2;
     int32_t rc;
 
     for(int32_t i =0;/* no condition */;i++) {
@@ -113,14 +113,14 @@ static UErrorCode getError(enum punycode_status status){
     }
 }
 
-static inline int32_t convertASCIIToUChars(const char* src,UChar* dest, int32_t length){
+static inline int32_t convertASCIIToUChars(const char* src,char16_t* dest, int32_t length){
     int i;
     for(i=0;i<length;i++){
         dest[i] = src[i];
     }
     return i;
 }
-static inline int32_t convertUCharsToASCII(const UChar* src,char* dest, int32_t length){
+static inline int32_t convertUCharsToASCII(const char16_t* src,char* dest, int32_t length){
     int i;
     for(i=0;i<length;i++){
         dest[i] = (char)src[i];
@@ -128,8 +128,8 @@ static inline int32_t convertUCharsToASCII(const UChar* src,char* dest, int32_t
     return i;
 }
 // wrapper around the reference Punycode implementation
-static int32_t convertToPuny(const UChar* src, int32_t srcLength,
-                             UChar* dest, int32_t destCapacity,
+static int32_t convertToPuny(const char16_t* src, int32_t srcLength,
+                             char16_t* dest, int32_t destCapacity,
                              UErrorCode& status){
     uint32_t b1Stack[MAX_LABEL_BUFFER_SIZE];
     int32_t b1Len = 0, b1Capacity = MAX_LABEL_BUFFER_SIZE;
@@ -209,8 +209,8 @@ static NamePrepTransform* getInstance(UErrorCode& status){
 }
 
 
-static int32_t convertFromPuny(  const UChar* src, int32_t srcLength,
-                                 UChar* dest, int32_t destCapacity,
+static int32_t convertFromPuny(  const char16_t* src, int32_t srcLength,
+                                 char16_t* dest, int32_t destCapacity,
                                  UErrorCode& status){
     char b1Stack[MAX_LABEL_BUFFER_SIZE];
     char* b1 = b1Stack;
@@ -254,8 +254,8 @@ CLEANUP:
 
 
 U_CFUNC int32_t U_EXPORT2
-idnaref_toASCII(const UChar* src, int32_t srcLength,
-              UChar* dest, int32_t destCapacity,
+idnaref_toASCII(const char16_t* src, int32_t srcLength,
+              char16_t* dest, int32_t destCapacity,
               int32_t options,
               UParseError* parseError,
               UErrorCode* status){
@@ -267,9 +267,9 @@ idnaref_toASCII(const UChar* src, int32_t srcLength,
         *status = U_ILLEGAL_ARGUMENT_ERROR;
         return 0;
     }
-    UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE];
+    char16_t b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE];
     //initialize pointers to stack buffers
-    UChar  *b1 = b1Stack, *b2 = b2Stack;
+    char16_t  *b1 = b1Stack, *b2 = b2Stack;
     int32_t b1Len=0, b2Len=0,
             b1Capacity = MAX_LABEL_BUFFER_SIZE,
             b2Capacity = MAX_LABEL_BUFFER_SIZE ,
@@ -311,7 +311,7 @@ idnaref_toASCII(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+            b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
             if(b1==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -370,7 +370,7 @@ idnaref_toASCII(const UChar* src, int32_t srcLength,
             if(*status == U_BUFFER_OVERFLOW_ERROR){
                 // redo processing of string
                 /* we do not have enough room so grow the buffer*/
-                b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
+                b2 = (char16_t*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
                 if(b2 == nullptr){
                     *status = U_MEMORY_ALLOCATION_ERROR;
                     goto CLEANUP;
@@ -423,8 +423,8 @@ CLEANUP:
 
 
 U_CFUNC int32_t U_EXPORT2
-idnaref_toUnicode(const UChar* src, int32_t srcLength,
-                UChar* dest, int32_t destCapacity,
+idnaref_toUnicode(const char16_t* src, int32_t srcLength,
+                char16_t* dest, int32_t destCapacity,
                 int32_t options,
                 UParseError* parseError,
                 UErrorCode* status){
@@ -439,10 +439,10 @@ idnaref_toUnicode(const UChar* src, int32_t srcLength,
 
 
 
-    UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stack[MAX_LABEL_BUFFER_SIZE];
+    char16_t b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stack[MAX_LABEL_BUFFER_SIZE];
 
     //initialize pointers to stack buffers
-    UChar  *b1 = b1Stack, *b2 = b2Stack, *b1Prime=nullptr, *b3=b3Stack;
+    char16_t  *b1 = b1Stack, *b2 = b2Stack, *b1Prime=nullptr, *b3=b3Stack;
     int32_t b1Len, b2Len, b1PrimeLen, b3Len,
             b1Capacity = MAX_LABEL_BUFFER_SIZE,
             b2Capacity = MAX_LABEL_BUFFER_SIZE,
@@ -500,7 +500,7 @@ idnaref_toUnicode(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+            b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
             if(b1==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -521,7 +521,7 @@ idnaref_toUnicode(const UChar* src, int32_t srcLength,
             u_memmove(b1, src, srcLength);
         }else{
             /* we do not have enough room so grow the buffer*/
-            b1 = (UChar*) uprv_malloc(srcLength * U_SIZEOF_UCHAR);
+            b1 = (char16_t*) uprv_malloc(srcLength * U_SIZEOF_UCHAR);
             if(b1==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -544,7 +544,7 @@ idnaref_toUnicode(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
+            b2 = (char16_t*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
             if(b2==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -563,7 +563,7 @@ idnaref_toUnicode(const UChar* src, int32_t srcLength,
         if(*status == U_BUFFER_OVERFLOW_ERROR){
             // redo processing of string
             /* we do not have enough room so grow the buffer*/
-            b3 = (UChar*) uprv_malloc(b3Len * U_SIZEOF_UCHAR);
+            b3 = (char16_t*) uprv_malloc(b3Len * U_SIZEOF_UCHAR);
             if(b3==nullptr){
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto CLEANUP;
@@ -652,8 +652,8 @@ CLEANUP:
 
 
 static int32_t
-getNextSeparator(UChar *src,int32_t srcLength,NamePrepTransform* prep,
-                 UChar **limit,
+getNextSeparator(char16_t *src,int32_t srcLength,NamePrepTransform* prep,
+                 char16_t **limit,
                  UBool *done,
                  UErrorCode *status){
     if(srcLength == -1){
@@ -688,8 +688,8 @@ getNextSeparator(UChar *src,int32_t srcLength,NamePrepTransform* prep,
 }
 
 U_CFUNC int32_t U_EXPORT2
-idnaref_IDNToASCII(  const UChar* src, int32_t srcLength,
-                   UChar* dest, int32_t destCapacity,
+idnaref_IDNToASCII(  const char16_t* src, int32_t srcLength,
+                   char16_t* dest, int32_t destCapacity,
                    int32_t options,
                    UParseError* parseError,
                    UErrorCode* status){
@@ -708,11 +708,11 @@ idnaref_IDNToASCII(  const UChar* src, int32_t srcLength,
     NamePrepTransform* prep = getInstance(*status);
 
     //initialize pointers to stack buffers
-    UChar b1Stack[MAX_LABEL_BUFFER_SIZE];
-    UChar  *b1 = b1Stack;
+    char16_t b1Stack[MAX_LABEL_BUFFER_SIZE];
+    char16_t  *b1 = b1Stack;
     int32_t b1Len, labelLen;
-    UChar* delimiter = (UChar*)src;
-    UChar* labelStart = (UChar*)src;
+    char16_t* delimiter = (char16_t*)src;
+    char16_t* labelStart = (char16_t*)src;
     int32_t remainingLen = srcLength;
     int32_t b1Capacity = MAX_LABEL_BUFFER_SIZE;
 
@@ -743,7 +743,7 @@ idnaref_IDNToASCII(  const UChar* src, int32_t srcLength,
                 if(*status == U_BUFFER_OVERFLOW_ERROR){
                     // redo processing of string
                     /* we do not have enough room so grow the buffer*/
-                    b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+                    b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
                     if(b1==nullptr){
                         *status = U_MEMORY_ALLOCATION_ERROR;
                         goto CLEANUP;
@@ -793,7 +793,7 @@ idnaref_IDNToASCII(  const UChar* src, int32_t srcLength,
             if(*status == U_BUFFER_OVERFLOW_ERROR){
                 // redo processing of string
                 /* we do not have enough room so grow the buffer*/
-                b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+                b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
                 if(b1==nullptr){
                     *status = U_MEMORY_ALLOCATION_ERROR;
                     goto CLEANUP;
@@ -843,8 +843,8 @@ CLEANUP:
 }
 
 U_CFUNC int32_t U_EXPORT2
-idnaref_IDNToUnicode(  const UChar* src, int32_t srcLength,
-                     UChar* dest, int32_t destCapacity,
+idnaref_IDNToUnicode(  const char16_t* src, int32_t srcLength,
+                     char16_t* dest, int32_t destCapacity,
                      int32_t options,
                      UParseError* parseError,
                      UErrorCode* status){
@@ -864,11 +864,11 @@ idnaref_IDNToUnicode(  const UChar* src, int32_t srcLength,
     NamePrepTransform* prep = getInstance(*status);
 
     //initialize pointers to stack buffers
-    UChar b1Stack[MAX_LABEL_BUFFER_SIZE];
-    UChar  *b1 = b1Stack;
+    char16_t b1Stack[MAX_LABEL_BUFFER_SIZE];
+    char16_t  *b1 = b1Stack;
     int32_t b1Len, labelLen;
-    UChar* delimiter = (UChar*)src;
-    UChar* labelStart = (UChar*)src;
+    char16_t* delimiter = (char16_t*)src;
+    char16_t* labelStart = (char16_t*)src;
     int32_t remainingLen = srcLength;
     int32_t b1Capacity = MAX_LABEL_BUFFER_SIZE;
 
@@ -898,7 +898,7 @@ idnaref_IDNToUnicode(  const UChar* src, int32_t srcLength,
             if(*status == U_BUFFER_OVERFLOW_ERROR){
                 // redo processing of string
                 /* we do not have enough room so grow the buffer*/
-                b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+                b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
                 if(b1==nullptr){
                     *status = U_MEMORY_ALLOCATION_ERROR;
                     goto CLEANUP;
@@ -950,7 +950,7 @@ idnaref_IDNToUnicode(  const UChar* src, int32_t srcLength,
             if(*status == U_BUFFER_OVERFLOW_ERROR){
                 // redo processing of string
                 /* we do not have enough room so grow the buffer*/
-                b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+                b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
                 if(b1==nullptr){
                     *status = U_MEMORY_ALLOCATION_ERROR;
                     goto CLEANUP;
@@ -999,8 +999,8 @@ CLEANUP:
 }
 
 U_CFUNC int32_t U_EXPORT2
-idnaref_compare(  const UChar *s1, int32_t length1,
-                const UChar *s2, int32_t length2,
+idnaref_compare(  const char16_t *s1, int32_t length1,
+                const char16_t *s2, int32_t length2,
                 int32_t options,
                 UErrorCode* status){
 
@@ -1008,8 +1008,8 @@ idnaref_compare(  const UChar *s1, int32_t length1,
         return -1;
     }
 
-    UChar b1Stack[MAX_IDN_BUFFER_SIZE], b2Stack[MAX_IDN_BUFFER_SIZE];
-    UChar *b1 = b1Stack, *b2 = b2Stack;
+    char16_t b1Stack[MAX_IDN_BUFFER_SIZE], b2Stack[MAX_IDN_BUFFER_SIZE];
+    char16_t *b1 = b1Stack, *b2 = b2Stack;
     int32_t b1Len, b2Len, b1Capacity = MAX_IDN_BUFFER_SIZE, b2Capacity = MAX_IDN_BUFFER_SIZE;
     int32_t result = -1;
 
@@ -1019,7 +1019,7 @@ idnaref_compare(  const UChar *s1, int32_t length1,
     if(*status == U_BUFFER_OVERFLOW_ERROR){
         // redo processing of string
         /* we do not have enough room so grow the buffer*/
-        b1 = (UChar*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
+        b1 = (char16_t*) uprv_malloc(b1Len * U_SIZEOF_UCHAR);
         if(b1==nullptr){
             *status = U_MEMORY_ALLOCATION_ERROR;
             goto CLEANUP;
@@ -1035,7 +1035,7 @@ idnaref_compare(  const UChar *s1, int32_t length1,
     if(*status == U_BUFFER_OVERFLOW_ERROR){
         // redo processing of string
         /* we do not have enough room so grow the buffer*/
-        b2 = (UChar*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
+        b2 = (char16_t*) uprv_malloc(b2Len * U_SIZEOF_UCHAR);
         if(b2==nullptr){
             *status = U_MEMORY_ALLOCATION_ERROR;
             goto CLEANUP;
index 86bdf2fc8fd2f7db552983116ea0796df62ce94e..4be0af09ed2aba5fa32721d00982c0108f3f1f25 100644 (file)
@@ -36,7 +36,7 @@ static UnicodeString escape( const UnicodeString&src)
   UnicodeString dst;
     dst.remove();
     for (int32_t i = 0; i < src.length(); ++i) {
-        UChar c = src[i];
+        char16_t c = src[i];
         if(c < 0x0080) 
             dst += c;
         else {
index 81416b02aee55951fc6acfa87c2f0ab13d4acb55..4b1d889a4d91c9ae626725383100ccbb2ed0cbd9 100644 (file)
@@ -67,7 +67,7 @@ static UBool noKnownIssues = false; // if true, don't emit known issues
 
 // [LIU] Just to get things working
 UnicodeString
-UCharToUnicodeString(UChar c)
+UCharToUnicodeString(char16_t c)
 { return UnicodeString(c); }
 
 // [rtg] Just to get things working
@@ -222,9 +222,9 @@ UnicodeString _toString(const Formattable& f) {
  * + char* ambiguous. - liu
  */
 UnicodeString toString(const Formattable& f) {
-    UnicodeString s((UChar)91/*[*/);
+    UnicodeString s((char16_t)91/*[*/);
     s.append(_toString(f));
-    s.append((UChar)0x5d/*]*/);
+    s.append((char16_t)0x5d/*]*/);
     return s;
 }
 
@@ -271,7 +271,7 @@ IntlTest::appendHex(uint32_t number,
             int32_t digits,
             UnicodeString& target)
 {
-    static const UChar digitString[] = {
+    static const char16_t digitString[] = {
         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
         0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0
     }; /* "0123456789ABCDEF" */
@@ -385,7 +385,7 @@ IntlTest::prettify(const UnicodeString &source, UBool parseBackslash)
                 // Delete a backslash.
                 int32_t backslashCount = 0;
                 for (int32_t j=target.length()-1; j>=0; --j) {
-                    if (target.charAt(j) == (UChar)92) {
+                    if (target.charAt(j) == (char16_t)92) {
                         ++backslashCount;
                     } else {
                         break;
@@ -1135,7 +1135,7 @@ void IntlTest::LL_message( UnicodeString message, UBool newline )
 
     // string that starts with a LineFeed character and continues
     // with spaces according to the current indentation
-    static const UChar indentUChars[] = {
+    static const char16_t indentUChars[] = {
         '\n',
         32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
         32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
@@ -1161,7 +1161,7 @@ void IntlTest::LL_message( UnicodeString message, UBool newline )
     }
 
     // replace each LineFeed by the indentation string
-    message.findAndReplace(UnicodeString((UChar)'\n'), indent);
+    message.findAndReplace(UnicodeString((char16_t)'\n'), indent);
 
     // stream out the message
     length = message.extract(0, message.length(), buffer, sizeof(buffer));
@@ -1880,18 +1880,18 @@ uint32_t IntlTest::icu_rand::getSeed() {
 
 
 
-static inline UChar toHex(int32_t i) {
-    return (UChar)(i + (i < 10 ? 0x30 : (0x41 - 10)));
+static inline char16_t toHex(int32_t i) {
+    return (char16_t)(i + (i < 10 ? 0x30 : (0x41 - 10)));
 }
 
 static UnicodeString& escape(const UnicodeString& s, UnicodeString& result) {
     for (int32_t i=0; i<s.length(); ++i) {
-        UChar c = s[i];
-        if (c <= (UChar)0x7F) {
+        char16_t c = s[i];
+        if (c <= (char16_t)0x7F) {
             result += c;
         } else {
-            result += (UChar)0x5c;
-            result += (UChar)0x75;
+            result += (char16_t)0x5c;
+            result += (char16_t)0x75;
             result += toHex((c >> 12) & 0xF);
             result += toHex((c >>  8) & 0xF);
             result += toHex((c >>  4) & 0xF);
@@ -2330,7 +2330,7 @@ const char* IntlTest::getProperty(const char* prop) {
 //-------------------------------------------------------------------------------
 //
 //    ReadAndConvertFile   Read a text data file, convert it to UChars, and
-//    return the data in one big UChar * buffer, which the caller must delete.
+//    return the data in one big char16_t * buffer, which the caller must delete.
 //
 //    parameters:
 //          fileName:   the name of the file, with no directory part.  The test data directory
@@ -2341,14 +2341,14 @@ const char* IntlTest::getProperty(const char* prop) {
 //                      Pass nullptr for the system default encoding.
 //          status
 //    returns:
-//                      The file data, converted to UChar.
+//                      The file data, converted to char16_t.
 //                      The caller must delete this when done with
 //                           delete [] theBuffer;
 //
 //
 //--------------------------------------------------------------------------------
-UChar *IntlTest::ReadAndConvertFile(const char *fileName, int &ulen, const char *encoding, UErrorCode &status) {
-    UChar       *retPtr  = nullptr;
+char16_t *IntlTest::ReadAndConvertFile(const char *fileName, int &ulen, const char *encoding, UErrorCode &status) {
+    char16_t    *retPtr  = nullptr;
     char        *fileBuf = nullptr;
     UConverter* conv     = nullptr;
     FILE        *f       = nullptr;
@@ -2408,7 +2408,7 @@ UChar *IntlTest::ReadAndConvertFile(const char *fileName, int &ulen, const char
     }
 
     //
-    // Convert the rules to UChar.
+    // Convert the rules to char16_t.
     //  Preflight first to determine required buffer size.
     //
     ulen = ucnv_toUChars(conv,
@@ -2421,7 +2421,7 @@ UChar *IntlTest::ReadAndConvertFile(const char *fileName, int &ulen, const char
         // Buffer Overflow is expected from the preflight operation.
         status = U_ZERO_ERROR;
 
-        retPtr = new UChar[ulen+1];
+        retPtr = new char16_t[ulen+1];
         ucnv_toUChars(conv,
             retPtr,       //  dest,
             ulen+1,
index 60d3635a083a3c64ac2d3227dc19a1c260563998..93b7d2376bdfc10ea56e53ef2dfe3d22862c84f2 100644 (file)
@@ -32,7 +32,7 @@ U_NAMESPACE_USE
 //-----------------------------------------------------------------------------
 //convenience classes to ease porting code that uses the Java
 //string-concatenation operator (moved from findword test by rtg)
-UnicodeString UCharToUnicodeString(UChar c);
+UnicodeString UCharToUnicodeString(char16_t c);
 UnicodeString Int64ToUnicodeString(int64_t num);
 UnicodeString DoubleToUnicodeString(double num);
 //UnicodeString operator+(const UnicodeString& left, int64_t num); // Some compilers don't allow this because of the long type.
@@ -421,7 +421,7 @@ public:
     virtual const char* getTestDataPath(UErrorCode& err) override;
     static const char* getSourceTestData(UErrorCode& err);
     static char *getUnidataPath(char path[]);
-    UChar *ReadAndConvertFile(const char *fileName, int &ulen, const char *encoding, UErrorCode &status);
+    char16_t *ReadAndConvertFile(const char *fileName, int &ulen, const char *encoding, UErrorCode &status);
 
 
 // static members
index 90eb6841c396ac99817e5facec68bd5b9fdeecf8..3b6465d051fb746f96e4148ede222badcbc39bf2 100644 (file)
@@ -48,7 +48,7 @@ CollationIteratorTest::~CollationIteratorTest()
 void CollationIteratorTest::TestUnicodeChar()
 {
     CollationElementIterator *iter;
-    UChar codepoint;
+    char16_t codepoint;
     UnicodeString source;
     
     for (codepoint = 1; codepoint < 0xFFFE;)
@@ -351,7 +351,7 @@ void CollationIteratorTest::TestMaxExpansion(/* char* par */)
     UErrorCode          status = U_ZERO_ERROR; 
     UnicodeString rule("&a < ab < c/aba < d < z < ch");
     RuleBasedCollator  *coll   = new RuleBasedCollator(rule, status);
-    UChar               ch     = 0;
+    char16_t            ch     = 0;
     UnicodeString       str(ch);
 
     CollationElementIterator *iter   = coll->createCollationElementIterator(str);
index 95cc791dac7a717778defd306c636254200ede36..87a573c33d7e342996cf0e97b2d769c59933331f 100644 (file)
@@ -93,7 +93,7 @@ private:
 
     struct ExpansionRecord
     {
-        UChar character;
+        char16_t character;
         int32_t count;
     };
 
index f376107ba7e525ab3c04ab5680f5a0e1a10b8764..fbeb84d9b28fabcfa002cb9a892ef6fe5af8558c 100644 (file)
@@ -93,7 +93,7 @@ void IntlTestRBNF::runIndexedTest(int32_t index, UBool exec, const char* &name,
 void IntlTestRBNF::TestHebrewFraction() {
 
     // this is the expected output for 123.45, with no '<' in it.
-    UChar text1[] = { 
+    char16_t text1[] = {
         0x05de, 0x05d0, 0x05d4, 0x0020, 
         0x05e2, 0x05e9, 0x05e8, 0x05d9, 0x05dd, 0x0020,
         0x05d5, 0x05e9, 0x05dc, 0x05d5, 0x05e9, 0x0020, 
@@ -101,7 +101,7 @@ void IntlTestRBNF::TestHebrewFraction() {
         0x05d0, 0x05e8, 0x05d1, 0x05e2, 0x0020,
         0x05d7, 0x05de, 0x05e9, 0x0000,
     };
-    UChar text2[] = { 
+    char16_t text2[] = {
         0x05DE, 0x05D0, 0x05D4, 0x0020, 
         0x05E2, 0x05E9, 0x05E8, 0x05D9, 0x05DD, 0x0020, 
         0x05D5, 0x05E9, 0x05DC, 0x05D5, 0x05E9, 0x0020, 
@@ -202,12 +202,12 @@ IntlTestRBNF::TestAPI() {
       LocalUResourceBundlePointer ruleSets(ures_getByKey(rbnfRules.getAlias(), "SpelloutRules", nullptr, &status));
       UnicodeString desc;
       while (ures_hasNext(ruleSets.getAlias())) {
-           const UChar* currentString = ures_getNextString(ruleSets.getAlias(), &len, nullptr, &status);
+           const char16_t* currentString = ures_getNextString(ruleSets.getAlias(), &len, nullptr, &status);
            ruleLen += len;
            desc.append(currentString);
       }
 
-      const UChar *spelloutRules = desc.getTerminatedBuffer();
+      const char16_t *spelloutRules = desc.getTerminatedBuffer();
 
       if(U_FAILURE(status) || ruleLen == 0 || spelloutRules == nullptr) {
         errln("Unable to access the rules string!");
@@ -457,14 +457,14 @@ void IntlTestRBNF::TestFractionalRuleSet()
     int len = fracRules.length();
     int change = 2;
     for (int i = 0; i < len; ++i) {
-        UChar ch = fracRules.charAt(i);
+        char16_t ch = fracRules.charAt(i);
         if (ch == '\n') {
             change = 2; // change ok
         } else if (ch == ':') {
             change = 1; // change, but once we hit a non-space char, don't change
         } else if (ch == ' ') {
             if (change != 0) {
-                fracRules.setCharAt(i, (UChar)0x200e);
+                fracRules.setCharAt(i, (char16_t)0x200e);
             }
         } else {
             if (change == 1) {
@@ -1099,12 +1099,12 @@ void IntlTestRBNF::TestLLong()
 #endif
 
     // u_atoll
-    const UChar uempty[] = { 0 };
-    const UChar uzero[] = { 0x30, 0 };
-    const UChar uneg_one[] = { 0x2d, 0x31, 0 };
-    const UChar uneg_12345[] = { 0x2d, 0x31, 0x32, 0x33, 0x34, 0x35, 0 };
-    const UChar ubig1[] = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x30, 0 };
-    const UChar ubig2[] = { 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0 };
+    const char16_t uempty[] = { 0 };
+    const char16_t uzero[] = { 0x30, 0 };
+    const char16_t uneg_one[] = { 0x2d, 0x31, 0 };
+    const char16_t uneg_12345[] = { 0x2d, 0x31, 0x32, 0x33, 0x34, 0x35, 0 };
+    const char16_t ubig1[] = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x30, 0 };
+    const char16_t ubig2[] = { 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0x66, 0x46, 0 };
     LLAssert(llong::utoll(uempty) == llong(0, 0));
     LLAssert(llong::utoll(uzero) == llong(0, 0));
     LLAssert(llong::utoll(uneg_one) == llong(0xffffffff, 0xffffffff));
@@ -1127,7 +1127,7 @@ void IntlTestRBNF::TestLLong()
     logln("Testing u_lltoa");
     // u_lltoa
     {
-        UChar buf[64];
+        char16_t buf[64];
         LLAssert((llong(0, 0).lltou(buf, (uint32_t)sizeof(buf)) == 1) && (u_strcmp(buf, uzero) == 0));
         LLAssert((llong(0xffffffff, 0xffffffff).lltou(buf, (uint32_t)sizeof(buf)) == 2) && (u_strcmp(buf, uneg_one) == 0));
         LLAssert(((-llong(0, 12345)).lltou(buf, (uint32_t)sizeof(buf)) == 6) && (u_strcmp(buf, uneg_12345) == 0));
@@ -2323,7 +2323,7 @@ void IntlTestRBNF::TestCompactDecimalFormatStyle() {
 void IntlTestRBNF::TestParseFailure() {
     UErrorCode status = U_ZERO_ERROR;
     RuleBasedNumberFormat rbnf(URBNF_SPELLOUT, Locale::getJapanese(), status);
-    static const UChar* testData[] = {
+    static const char16_t* testData[] = {
         u"・・・・・・・・・・・・・・・・・・・・・・・・"
     };
     if (assertSuccess("", status, true, __FILE__, __LINE__)) {
index 2ad9c406613ead36562e9bfb6863440eee9aca68..4e224488e2168586f6a6f94a11004bcf44f1e9e1 100644 (file)
@@ -149,8 +149,8 @@ IntlTestRBNFParse::testfmt(RuleBasedNumberFormat* formatter, double val, UErrorC
     UnicodeString us;
     formatter->format((const Formattable)val, us, status);
     if (U_SUCCESS(status)) {
-        us.insert(0, (UChar)'"');
-        us.append((UChar)'"');
+        us.insert(0, (char16_t)'"');
+        us.append((char16_t)'"');
         logln(us);
     } else {
         logln("error: could not format %g, returned status: %d", val, status);
@@ -162,8 +162,8 @@ IntlTestRBNFParse::testfmt(RuleBasedNumberFormat* formatter, int val, UErrorCode
     UnicodeString us;
     formatter->format((const Formattable)(int32_t)val, us, status);
     if (U_SUCCESS(status)) {
-        us.insert(0, (UChar)'"');
-        us.append((UChar)'"');
+        us.insert(0, (char16_t)'"');
+        us.append((char16_t)'"');
         logln(us);
     } else {
         logln("error: could not format %d, returned status: %d", val, status);
index 9abd6ed9f444bcb9b709d48eef0bb77a83833207..bb6fddb1631a134b00ec16ea7fd27cca685575dd 100644 (file)
@@ -293,7 +293,7 @@ static UnicodeString parseHex(const UnicodeString &in) {
     UnicodeString result;
     UChar32 cc = 0;
     for (int32_t i=0; i<in.length(); i++) {
-        UChar c = in.charAt(i);
+        char16_t c = in.charAt(i);
         if (c == 0x20) {   // Space
             if (cc > 0) {
                result.append(cc);
@@ -328,10 +328,10 @@ static void appendHexUChar(UnicodeString &dest, UChar32 c) {
         int hexDigit = (c>>bitNum) & 0x0f;
         if (hexDigit != 0 || doZeroes) {
             doZeroes = true;
-            dest.append((UChar)(hexDigit<=9? hexDigit + 0x30: hexDigit -10 + 0x41));
+            dest.append((char16_t)(hexDigit<=9? hexDigit + 0x30: hexDigit -10 + 0x41));
         }
     }
-    dest.append((UChar)0x20);
+    dest.append((char16_t)0x20);
 }
 
 U_DEFINE_LOCAL_OPEN_POINTER(LocalStdioFilePointer, FILE, fclose);
index b9106d8410f0eb014c1e57222b3fbdcaa5d4d53a..c0fc56cc0c8fb11cfa6dbacf7b88b086d8fafd1f 100644 (file)
@@ -362,7 +362,7 @@ void LocalPointerTest::TestLocalPointer() {
         errln("LocalPointer access failure");
     }
     // adoptInstead(), orphan()
-    s.adoptInstead(new UnicodeString((UChar)0xfffc));
+    s.adoptInstead(new UnicodeString((char16_t)0xfffc));
     if(s->length()!=1) {
         errln("LocalPointer adoptInstead(U+FFFC) failure");
     }
@@ -423,8 +423,8 @@ void moveFrom(T &dest, T &src) {
 }
 
 void LocalPointerTest::TestLocalPointerMoveSwap() {
-    UnicodeString *p1 = new UnicodeString((UChar)0x61);
-    UnicodeString *p2 = new UnicodeString((UChar)0x62);
+    UnicodeString *p1 = new UnicodeString((char16_t)0x61);
+    UnicodeString *p2 = new UnicodeString((char16_t)0x62);
     LocalPointer<UnicodeString> s1(p1);
     LocalPointer<UnicodeString> s2(p2);
     s1.swap(s2);
@@ -475,14 +475,14 @@ void LocalPointerTest::TestLocalArray() {
     // constructor
     LocalArray<UnicodeString> a(new UnicodeString[2]);
     // operator[]()
-    a[0].append((UChar)0x61);
+    a[0].append((char16_t)0x61);
     a[1].append((UChar32)0x60006);
     if(a[0].length()!=1 || a[1].length()!=2) {
         errln("LocalArray access failure");
     }
     // adoptInstead()
     a.adoptInstead(new UnicodeString[4]);
-    a[3].append((UChar)0x62).append((UChar)0x63).reverse();
+    a[3].append((char16_t)0x62).append((char16_t)0x63).reverse();
     if(a[3].length()!=2 || a[3][1]!=0x62) {
         errln("LocalArray adoptInstead() failure");
     }
index f2b614c09b5d1a3a50ceabedfad91cb6c9607d29..f297fc85cde7070e01eb0a5cf27302b11f2e3659 100644 (file)
@@ -37,7 +37,7 @@ CollationKanaTest::~CollationKanaTest()
     delete myCollation;
 }
 
-const UChar CollationKanaTest::testSourceCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testSourceCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
     {0xff9E, 0x0000},
     {0x3042, 0x0000},
     {0x30A2, 0x0000},
@@ -46,7 +46,7 @@ const UChar CollationKanaTest::testSourceCases[][CollationKanaTest::MAX_TOKEN_LE
     {0x30A2, 0x30FC, 0x30C8, 0x0000}                               /*  6 */
 };
 
-const UChar CollationKanaTest::testTargetCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testTargetCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
     {0xFF9F, 0x0000},
     {0x30A2, 0x0000},
     {0x3042, 0x3042, 0x0000},
@@ -64,35 +64,35 @@ const Collator::EComparisonResult CollationKanaTest::results[] = {
     Collator::LESS,    //Collator::GREATER /* Prolonged sound mark sorts BEFORE equivalent vowel (ICU 2.0)*//*  6 */
 };
 
-const UChar CollationKanaTest::testBaseCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testBaseCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
   {0x30AB, 0x0000},
   {0x30AB, 0x30AD, 0x0000},
   {0x30AD, 0x0000},
   {0x30AD, 0x30AD, 0x0000}
 };
 
-const UChar CollationKanaTest::testPlainDakutenHandakutenCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testPlainDakutenHandakutenCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
   {0x30CF, 0x30AB, 0x0000},
   {0x30D0, 0x30AB, 0x0000},
   {0x30CF, 0x30AD, 0x0000},
   {0x30D0, 0x30AD, 0x0000}
 };
 
-const UChar CollationKanaTest::testSmallLargeCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testSmallLargeCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
   {0x30C3, 0x30CF, 0x0000},
   {0x30C4, 0x30CF, 0x0000},
   {0x30C3, 0x30D0, 0x0000},
   {0x30C4, 0x30D0, 0x0000}
 };
 
-const UChar CollationKanaTest::testKatakanaHiraganaCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testKatakanaHiraganaCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
   {0x3042, 0x30C3, 0x0000},
   {0x30A2, 0x30C3, 0x0000},
   {0x3042, 0x30C4, 0x0000},
   {0x30A2, 0x30C4, 0x0000}
 };
 
-const UChar CollationKanaTest::testChooonKigooCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
+const char16_t CollationKanaTest::testChooonKigooCases[][CollationKanaTest::MAX_TOKEN_LEN] = {
   /*0*/ {0x30AB, 0x30FC, 0x3042, 0x0000},
   /*1*/ {0x30AB, 0x30FC, 0x30A2, 0x0000},
   /*2*/ {0x30AB, 0x30A4, 0x3042, 0x0000},
index 98e144ea21e155b43252aa144c0b25d8439ff130..755c545f1f0238f1327293a5530406e2aaff6ee1 100644 (file)
@@ -50,14 +50,14 @@ public:
     void TestChooonKigoo();
 
 private:
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[];
-    static const UChar testBaseCases[][MAX_TOKEN_LEN];
-    static const UChar testPlainDakutenHandakutenCases[][MAX_TOKEN_LEN];
-    static const UChar testSmallLargeCases[][MAX_TOKEN_LEN];
-    static const UChar testKatakanaHiraganaCases[][MAX_TOKEN_LEN];
-    static const UChar testChooonKigooCases[][MAX_TOKEN_LEN];
+    static const char16_t testBaseCases[][MAX_TOKEN_LEN];
+    static const char16_t testPlainDakutenHandakutenCases[][MAX_TOKEN_LEN];
+    static const char16_t testSmallLargeCases[][MAX_TOKEN_LEN];
+    static const char16_t testKatakanaHiraganaCases[][MAX_TOKEN_LEN];
+    static const char16_t testChooonKigooCases[][MAX_TOKEN_LEN];
 
     Collator *myCollation;
 };
index 69d04537540366b31d879f8a4c3074b0dd49f924..90ca4c855d1d6078cf9e991e70f2e7e7d7c58cd1 100644 (file)
@@ -154,7 +154,7 @@ JamoTest::TestJamo() {
  * latin and back.
  */
 void JamoTest::TestPiecemeal(void) {
-    UnicodeString hangul; hangul.append((UChar)0xBC0F);
+    UnicodeString hangul; hangul.append((char16_t)0xBC0F);
     UnicodeString jamo = nameToJamo("(Mi)(I)(Cf)");
     UnicodeString latin("mic");
     UnicodeString latin2("mich");
index 8cbf299103a82f6cf44c1b55df942d73e24df86e..7123e8c29a81c0f6379acbc8ac43c912c1f67f88 100644 (file)
@@ -50,12 +50,12 @@ LotusCollationKoreanTest::~LotusCollationKoreanTest()
     delete myCollation;
 }
 
-const UChar LotusCollationKoreanTest::testSourceCases[][LotusCollationKoreanTest::MAX_TOKEN_LEN] = {
+const char16_t LotusCollationKoreanTest::testSourceCases[][LotusCollationKoreanTest::MAX_TOKEN_LEN] = {
     {0xac00, 0}
     
 };
 
-const UChar LotusCollationKoreanTest::testTargetCases[][LotusCollationKoreanTest::MAX_TOKEN_LEN] = {
+const char16_t LotusCollationKoreanTest::testTargetCases[][LotusCollationKoreanTest::MAX_TOKEN_LEN] = {
     {0xac01, 0}
 };
 
index 952b17fd416a091d0d8e3b97fc2e0907640b3a07..1399b03b039f0c6f1ce0dab1df1eca813728622f 100644 (file)
@@ -30,8 +30,8 @@ public:
     void TestTertiary(/* char* par */);
 
 private:
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[];
 
     Collator *myCollation;
index 44fee4eddb73f5f7c3ef37c0478e1363ca698c5c..c9ce207059ee8220ec9f91071ae4081992ee0136 100644 (file)
@@ -651,7 +651,7 @@ void LocaleMatcherTest::testDataDriven() {
         return;
     }
     int32_t lineLength;
-    const UChar *p;
+    const char16_t *p;
     UnicodeString line;
     TestCase test;
     int32_t numPassed = 0;
index 47dd10b2ff75bea28a61c0cdaed0e1a8de95df6c..846017c9b24bf0568cfc220ef746e7ddb59e4430 100644 (file)
@@ -161,7 +161,7 @@ void LocaleDisplayNamesTest::TestPrivateUse() {
 void LocaleDisplayNamesTest::TestUldnOpen() {
   UErrorCode status = U_ZERO_ERROR;
   const int32_t kMaxResultSize = 150;  // long enough
-  UChar result[150];
+  char16_t result[150];
   ULocaleDisplayNames *ldn = uldn_open(Locale::getGermany().getName(), ULDN_STANDARD_NAMES, &status);
   int32_t len = uldn_localeDisplayName(ldn, "de_DE", result, kMaxResultSize, &status);
   uldn_close(ldn);
@@ -183,7 +183,7 @@ void LocaleDisplayNamesTest::TestUldnOpen() {
 void LocaleDisplayNamesTest::TestUldnOpenDialect() {
   UErrorCode status = U_ZERO_ERROR;
   const int32_t kMaxResultSize = 150;  // long enough
-  UChar result[150];
+  char16_t result[150];
   ULocaleDisplayNames *ldn = uldn_open(Locale::getUS().getName(), ULDN_DIALECT_NAMES, &status);
   int32_t len = uldn_localeDisplayName(ldn, "en_GB", result, kMaxResultSize, &status);
   uldn_close(ldn);
@@ -196,7 +196,7 @@ void LocaleDisplayNamesTest::TestUldnOpenDialect() {
 void LocaleDisplayNamesTest::TestUldnWithGarbage() {
   UErrorCode status = U_ZERO_ERROR;
   const int32_t kMaxResultSize = 150;  // long enough
-  UChar result[150];
+  char16_t result[150];
   ULocaleDisplayNames *ldn = uldn_open(Locale::getUS().getName(), ULDN_DIALECT_NAMES, &status);
   int32_t len = uldn_localeDisplayName(ldn, "english (United States) [w", result, kMaxResultSize, &status);
   uldn_close(ldn);
@@ -206,7 +206,7 @@ void LocaleDisplayNamesTest::TestUldnWithGarbage() {
 void LocaleDisplayNamesTest::TestUldnWithKeywordsAndEverything() {
   UErrorCode status = U_ZERO_ERROR;
   const int32_t kMaxResultSize = 150;  // long enough
-  UChar result[150];
+  char16_t result[150];
   const char *locname = "en_Hant_US_VALLEY@calendar=gregorian;collation=phonebook";
   const char *target = "English (Traditional, United States, VALLEY, "
     "Gregorian Calendar, Phonebook Sort Order)";
@@ -222,7 +222,7 @@ void LocaleDisplayNamesTest::TestUldnWithKeywordsAndEverything() {
 void LocaleDisplayNamesTest::TestUldnComponents() {
   UErrorCode status = U_ZERO_ERROR;
   const int32_t kMaxResultSize = 150;  // long enough
-  UChar result[150];
+  char16_t result[150];
 
   ULocaleDisplayNames *ldn = uldn_open(Locale::getGermany().getName(), ULDN_STANDARD_NAMES, &status);
   test_assert(U_SUCCESS(status));
@@ -287,7 +287,7 @@ typedef struct {
     UDisplayContext capitalization;
     UDisplayContext displayLength;
     const char * localeToBeNamed;
-    const UChar * result;
+    const char16_t * result;
 } LocNameDispContextItem;
 
 static char en[] = "en";
@@ -295,27 +295,27 @@ static char en_cabud[] = "en@calendar=buddhist";
 static char en_GB[] = "en_GB";
 static char uz_Latn[] = "uz_Latn";
 
-static UChar daFor_en[]       = {0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"engelsk"
-static UChar daFor_en_cabud[] = {0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x62,0x75,0x64,0x64,0x68,0x69,0x73,0x74,0x69,0x73,0x6B,0x20,
+static char16_t daFor_en[]       = {0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"engelsk"
+static char16_t daFor_en_cabud[] = {0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x62,0x75,0x64,0x64,0x68,0x69,0x73,0x74,0x69,0x73,0x6B,0x20,
                                  0x6B,0x61,0x6C,0x65,0x6E,0x64,0x65,0x72,0x29,0}; //"engelsk (buddhistisk kalender)"
-static UChar daFor_en_GB[]    = {0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x53,0x74,0x6F,0x72,0x62,0x72,0x69,0x74,0x61,0x6E,0x6E,0x69,0x65,0x6E,0x29,0}; //"engelsk (Storbritannien)"
-static UChar daFor_en_GB_D[]  = {0x62,0x72,0x69,0x74,0x69,0x73,0x6B,0x20,0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"britisk engelsk"
-static UChar esFor_en[]       = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0}; //"ingles" with acute on the e
-static UChar esFor_en_GB[]    = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x65,0x69,0x6E,0x6F,0x20,0x55,0x6E,0x69,0x64,0x6F,0x29,0}; //"ingles (Reino Unido)" ...
-static UChar esFor_en_GB_S[]  = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x55,0x29,0}; //"ingles (RU)" ...
-static UChar esFor_en_GB_D[]  = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x62,0x72,0x69,0x74,0xE1,0x6E,0x69,0x63,0x6F,0}; //"ingles britanico" with acute on the e, a
-static UChar ruFor_uz_Latn[]  = {0x0443,0x0437,0x0431,0x0435,0x043A,0x0441,0x043A,0x0438,0x0439,0x20,0x28,0x043B,0x0430,0x0442,0x0438,0x043D,0x0438,0x0446,0x0430,0x29,0}; // all lowercase
+static char16_t daFor_en_GB[]    = {0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x53,0x74,0x6F,0x72,0x62,0x72,0x69,0x74,0x61,0x6E,0x6E,0x69,0x65,0x6E,0x29,0}; //"engelsk (Storbritannien)"
+static char16_t daFor_en_GB_D[]  = {0x62,0x72,0x69,0x74,0x69,0x73,0x6B,0x20,0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"britisk engelsk"
+static char16_t esFor_en[]       = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0}; //"ingles" with acute on the e
+static char16_t esFor_en_GB[]    = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x65,0x69,0x6E,0x6F,0x20,0x55,0x6E,0x69,0x64,0x6F,0x29,0}; //"ingles (Reino Unido)" ...
+static char16_t esFor_en_GB_S[]  = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x55,0x29,0}; //"ingles (RU)" ...
+static char16_t esFor_en_GB_D[]  = {0x69,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x62,0x72,0x69,0x74,0xE1,0x6E,0x69,0x63,0x6F,0}; //"ingles britanico" with acute on the e, a
+static char16_t ruFor_uz_Latn[]  = {0x0443,0x0437,0x0431,0x0435,0x043A,0x0441,0x043A,0x0438,0x0439,0x20,0x28,0x043B,0x0430,0x0442,0x0438,0x043D,0x0438,0x0446,0x0430,0x29,0}; // all lowercase
 #if !UCONFIG_NO_BREAK_ITERATION
-static UChar daFor_en_T[]     = {0x45,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"Engelsk"
-static UChar daFor_en_cabudT[]= {0x45,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x62,0x75,0x64,0x64,0x68,0x69,0x73,0x74,0x69,0x73,0x6B,0x20,
+static char16_t daFor_en_T[]     = {0x45,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"Engelsk"
+static char16_t daFor_en_cabudT[]= {0x45,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x62,0x75,0x64,0x64,0x68,0x69,0x73,0x74,0x69,0x73,0x6B,0x20,
                                  0x6B,0x61,0x6C,0x65,0x6E,0x64,0x65,0x72,0x29,0}; //"Engelsk (buddhistisk kalender)"
-static UChar daFor_en_GB_T[]  = {0x45,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x53,0x74,0x6F,0x72,0x62,0x72,0x69,0x74,0x61,0x6E,0x6E,0x69,0x65,0x6E,0x29,0}; //"Engelsk (Storbritannien)"
-static UChar daFor_en_GB_DT[] = {0x42,0x72,0x69,0x74,0x69,0x73,0x6B,0x20,0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"Britisk engelsk"
-static UChar esFor_en_T[]     = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0}; //"Ingles" with acute on the e
-static UChar esFor_en_GB_T[]  = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x65,0x69,0x6E,0x6F,0x20,0x55,0x6E,0x69,0x64,0x6F,0x29,0}; //"Ingles (Reino Unido)" ...
-static UChar esFor_en_GB_ST[] = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x55,0x29,0}; //"Ingles (RU)" ...
-static UChar esFor_en_GB_DT[] = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x62,0x72,0x69,0x74,0xE1,0x6E,0x69,0x63,0x6F,0}; //"Ingles britanico" with acute on the e, a
-static UChar ruFor_uz_Latn_T[]= {0x0423,0x0437,0x0431,0x0435,0x043A,0x0441,0x043A,0x0438,0x0439,0x20,0x28,0x043B,0x0430,0x0442,0x0438,0x043D,0x0438,0x0446,0x0430,0x29,0}; // first char upper
+static char16_t daFor_en_GB_T[]  = {0x45,0x6E,0x67,0x65,0x6C,0x73,0x6B,0x20,0x28,0x53,0x74,0x6F,0x72,0x62,0x72,0x69,0x74,0x61,0x6E,0x6E,0x69,0x65,0x6E,0x29,0}; //"Engelsk (Storbritannien)"
+static char16_t daFor_en_GB_DT[] = {0x42,0x72,0x69,0x74,0x69,0x73,0x6B,0x20,0x65,0x6E,0x67,0x65,0x6C,0x73,0x6B,0}; //"Britisk engelsk"
+static char16_t esFor_en_T[]     = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0}; //"Ingles" with acute on the e
+static char16_t esFor_en_GB_T[]  = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x65,0x69,0x6E,0x6F,0x20,0x55,0x6E,0x69,0x64,0x6F,0x29,0}; //"Ingles (Reino Unido)" ...
+static char16_t esFor_en_GB_ST[] = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x28,0x52,0x55,0x29,0}; //"Ingles (RU)" ...
+static char16_t esFor_en_GB_DT[] = {0x49,0x6E,0x67,0x6C,0xE9,0x73,0x20,0x62,0x72,0x69,0x74,0xE1,0x6E,0x69,0x63,0x6F,0}; //"Ingles britanico" with acute on the e, a
+static char16_t ruFor_uz_Latn_T[]= {0x0423,0x0437,0x0431,0x0435,0x043A,0x0441,0x043A,0x0438,0x0439,0x20,0x28,0x043B,0x0430,0x0442,0x0438,0x043D,0x0438,0x0446,0x0430,0x29,0}; // first char upper
 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
 
 static const LocNameDispContextItem ctxtItems[] = {
@@ -388,7 +388,7 @@ void LocaleDisplayNamesTest::TestUldnDisplayContext() {
                        displayLength != ctxtItemPtr->displayLength) {
                 errln("FAIL: uldn_getContext retrieved incorrect dialectHandling, capitalization, or displayLength");
             } else {
-                UChar nameBuf[ULOC_FULLNAME_CAPACITY];
+                char16_t nameBuf[ULOC_FULLNAME_CAPACITY];
                 int32_t len = uldn_localeDisplayName(uldn, ctxtItemPtr->localeToBeNamed, nameBuf, ULOC_FULLNAME_CAPACITY, &status);
                 if (U_FAILURE(status)) {
                     dataerrln(UnicodeString("FAIL: uldn_localeDisplayName status: ") + u_errorName(status));
@@ -424,7 +424,7 @@ void LocaleDisplayNamesTest::TestRootEtc() {
 void LocaleDisplayNamesTest::TestNumericRegionID() {
     UErrorCode err = U_ZERO_ERROR;
     ULocaleDisplayNames* ldn = uldn_open("es_MX", ULDN_STANDARD_NAMES, &err);
-    UChar displayName[200];
+    char16_t displayName[200];
     uldn_regionDisplayName(ldn, "019", displayName, 200, &err);
     test_assert(U_SUCCESS(err));
     test_assert_equal(UnicodeString(u"América"), UnicodeString(displayName));
index 0e12f03eed4963983fe9e0168ed6b816efdc2eaa..057d2984509d11c0b26f9f9976f1d97a09814a2f 100644 (file)
@@ -1226,7 +1226,7 @@ LocaleTest::TestThaiCurrencyFormat()
 void
 LocaleTest::TestEuroSupport()
 {
-    UChar euro = 0x20ac;
+    char16_t euro = 0x20ac;
     const UnicodeString EURO_CURRENCY(&euro, 1, 1); // Look for this UnicodeString in formatted Euro currency
     const char* localeArr[] = {
                             "ca_ES",
@@ -1287,8 +1287,8 @@ LocaleTest::TestEuroSupport()
         delete nf;
     }
 
-    UnicodeString dollarStr("USD", ""), euroStr("EUR", ""), genericStr((UChar)0x00a4), resultStr;
-    UChar tmp[4];
+    UnicodeString dollarStr("USD", ""), euroStr("EUR", ""), genericStr((char16_t)0x00a4), resultStr;
+    char16_t tmp[4];
     status = U_ZERO_ERROR;
 
     ucurr_forLocale("en_US", tmp, 4, &status);
@@ -1405,8 +1405,8 @@ LocaleTest::Test4139940()
     df_full.format(mydate, str, pos);
     // Make sure that o circumflex (\u00F4) is NOT there, and
     // o double acute (\u0151) IS.
-    UChar ocf = 0x00f4;
-    UChar oda = 0x0151;
+    char16_t ocf = 0x00f4;
+    char16_t oda = 0x0151;
     if (str.indexOf(oda) < 0 || str.indexOf(ocf) >= 0) {
       /* If the default locale is "th" this test will fail because of the buddhist calendar. */
       if (strcmp(Locale::getDefault().getLanguage(), "th") != 0) {
@@ -5058,7 +5058,7 @@ void LocaleTest::TestCurrencyByDate(void)
 #if !UCONFIG_NO_FORMATTING
     UErrorCode status = U_ZERO_ERROR;
     UDate date = uprv_getUTCtime();
-       UChar TMP[4] = {0, 0, 0, 0};
+       char16_t TMP[4] = {0, 0, 0, 0};
        int32_t index = 0;
        int32_t resLen = 0;
     UnicodeString tempStr, resultStr;
@@ -5349,10 +5349,10 @@ void LocaleTest::TestCurrencyByDate(void)
        status = U_ZERO_ERROR; // reset
     date = uprv_getUTCtime();
 
-    UChar USD[4];
+    char16_t USD[4];
     ucurr_forLocaleAndDate("en_US", date, 1, USD, 4, &status);
     
-       UChar YEN[4];
+       char16_t YEN[4];
     ucurr_forLocaleAndDate("ja_JP", date, 1, YEN, 4, &status);
 
     ucurr_forLocaleAndDate("en_US", date, 1, TMP, 4, &status);
@@ -6624,7 +6624,7 @@ void LocaleTest::TestSierraLeoneCurrency21997() {
     // Test will fail once SLE is declared legal.
     // CLDR 42: Now check that currency of Sierra Leone is SLE (which is legal tender)
     UnicodeString sllStr("SLE", ""), resultStr;
-    UChar tmp[4];
+    char16_t tmp[4];
     UErrorCode status = U_ZERO_ERROR;
 
     ucurr_forLocale("en_SL", tmp, 4, &status);
index 072c4693fb0d52eff53d87f7400e15bc3bd0ec06..0e3fe8c3f9e47a8d50e7bb4fbab124cb49bee3ef 100644 (file)
@@ -82,7 +82,7 @@ void LSTMBETest::runTestFromFile(const char* filename) {
     testFileName.append(filename, -1, status);
 
     int len;
-    UChar *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
+    char16_t *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
     if (U_FAILURE(status)) {
         errln("%s:%d Error %s opening test file %s", __FILE__, __LINE__, u_errorName(status), filename);
         return;
index 40a05b19a15816a1fbb67ee7923a86373fd60c3b..749673a16e665b06dc57b9c9ac0f60170fe2cdb5 100644 (file)
@@ -4359,7 +4359,7 @@ void MeasureFormatTest::TestGram() {
 }
 
 void MeasureFormatTest::TestCurrencies() {
-    UChar USD[4] = {};
+    char16_t USD[4] = {};
     u_uastrcpy(USD, "USD");
     UErrorCode status = U_ZERO_ERROR;
     CurrencyUnit USD_unit(USD, status);
index 4fc2460251d361488b0f7139a111e0ddb6216613..535db88c7781666ee2d3c77ef9f0c648589161fc 100644 (file)
@@ -290,7 +290,7 @@ void
 DateFormatMiscTests::test4117335()
 {
     //UnicodeString bc = "\u7d00\u5143\u524d";
-    UChar bcC [] = {
+    char16_t bcC [] = {
         0x7D00,
         0x5143,
         0x524D
@@ -298,21 +298,21 @@ DateFormatMiscTests::test4117335()
     UnicodeString bc(bcC, 3, 3);
 
     //UnicodeString ad = "\u897f\u66a6";
-    UChar adC [] = {
+    char16_t adC [] = {
         0x897F,
         0x66A6
     };
     UnicodeString ad(adC, 2, 2);
     
     //UnicodeString jstLong = "\u65e5\u672c\u6a19\u6e96\u6642";
-    UChar jstLongC [] = {
+    char16_t jstLongC [] = {
         0x65e5,
         0x672c,
         0x6a19,
         0x6e96,
         0x6642
     };
-    UChar jdtLongC [] = {0x65E5, 0x672C, 0x590F, 0x6642, 0x9593};
+    char16_t jdtLongC [] = {0x65E5, 0x672C, 0x590F, 0x6642, 0x9593};
 
     UnicodeString jstLong(jstLongC, 5, 5);
 
index 55dea60812ea5a8cf721a29e6a7c2e1ec147987b..b67eea910e855b33b6c4d34a4b22d47b1d8bd9bc 100644 (file)
@@ -206,12 +206,12 @@ CollationMonkeyTest::TestCompare(/* char* par */)
     }
 }
 void CollationMonkeyTest::TestRules(/* char* par */){
-    UChar testSourceCases[][10] = {
+    char16_t testSourceCases[][10] = {
     {0x0061, 0x0062, 0x007a, 0},
     {0x0061, 0x0062, 0x007a, 0},
     };
 
-    UChar testTargetCases[][10] = {
+    char16_t testTargetCases[][10] = {
         {0x0061, 0x0062, 0x00e4, 0},
         {0x0061, 0x0062, 0x0061, 0x0308, 0},
     };
@@ -222,7 +222,7 @@ void CollationMonkeyTest::TestRules(/* char* par */){
     Collator *col = Collator::createInstance("en_US", status);
     const UnicodeString baseRules = ((RuleBasedCollator*)col)->getRules();
     UnicodeString newRules(" & z < ");
-    newRules.append((UChar)0x00e4);
+    newRules.append((char16_t)0x00e4);
     newRules.insert(0, baseRules);
     RuleBasedCollator *myCollation = new RuleBasedCollator(newRules, status);
     if (U_FAILURE(status)) {
@@ -237,7 +237,7 @@ void CollationMonkeyTest::TestRules(/* char* par */){
     logln("Demo Test 2 : Create a new table collation with rules \"& z < a 0x0308\"");
     newRules.remove();
     newRules.append(" & z < a");
-    newRules.append((UChar)0x0308);
+    newRules.append((char16_t)0x0308);
     newRules.insert(0, baseRules);
     myCollation = new RuleBasedCollator(newRules, status);
     if (U_FAILURE(status)) {
index 7b217c07b71512d92b676510aee3a96c7ce05aee..fa3337eaa5436eda7f930dc2fc2b18d0f4d4ac6b 100644 (file)
@@ -640,9 +640,9 @@ void MessageFormatRegressionTest::Test4094906()
 {
     UErrorCode status = U_ZERO_ERROR;
     UnicodeString pattern("-");
-    pattern += (UChar) 0x221E;
+    pattern += (char16_t) 0x221E;
     pattern += "<are negative|0<are no or fraction|1#is one|1<is 1+|";
-    pattern += (UChar) 0x221E;
+    pattern += (char16_t) 0x221E;
     pattern += "<are many.";
 
     ChoiceFormat *fmt = new ChoiceFormat(pattern, status);
index 41dcabb6b272bf9165ad37c4e51b8fd9fcde46ef..77e56ffd37e98dcd7a0a58c9023ba9b8f91beb99 100644 (file)
@@ -330,9 +330,9 @@ IntlTestNumberFormatAPI::testRegistration()
     } else {
         float n = 1234.567f;
         UnicodeString res0, res1, res2, res3, res4, res5;
-        UChar ures3[50];
-        UChar ures4[50];
-        UChar ures5[50];
+        char16_t ures3[50];
+        char16_t ures4[50];
+        char16_t ures5[50];
 
         f0->format(n, res0);
         f1->format(n, res1);
index d94ceba49fdfa541553eeedf44cc05346c4adacb..0e9e4ceac0cdff56cbab49aa15607142440c0106 100644 (file)
@@ -63,9 +63,9 @@ NamePrepTransform::NamePrepTransform(UParseError& parseError, UErrorCode& status
     if(lbundle.isValid() && U_SUCCESS(status)){
         // create the mapping transliterator
         int32_t ruleLen = 0;
-        const UChar* ruleUChar = ures_getStringByKey(lbundle.getAlias(), "MapNFKC",&ruleLen, &status);
+        const char16_t* ruleUChar = ures_getStringByKey(lbundle.getAlias(), "MapNFKC",&ruleLen, &status);
         int32_t mapRuleLen = 0;
-        const UChar *mapRuleUChar = ures_getStringByKey(lbundle.getAlias(), "MapNoNormalization", &mapRuleLen, &status);
+        const char16_t *mapRuleUChar = ures_getStringByKey(lbundle.getAlias(), "MapNoNormalization", &mapRuleLen, &status);
         UnicodeString rule(mapRuleUChar, mapRuleLen);
         rule.append(ruleUChar, ruleLen);
 
@@ -77,7 +77,7 @@ NamePrepTransform::NamePrepTransform(UParseError& parseError, UErrorCode& status
 
         //create the unassigned set
         int32_t patternLen =0;
-        const UChar* pattern = ures_getStringByKey(lbundle.getAlias(),"UnassignedSet",&patternLen, &status);
+        const char16_t* pattern = ures_getStringByKey(lbundle.getAlias(),"UnassignedSet",&patternLen, &status);
         unassigned.applyPattern(UnicodeString(pattern, patternLen), status);
 
         //create prohibited set
@@ -91,7 +91,7 @@ NamePrepTransform::NamePrepTransform(UParseError& parseError, UErrorCode& status
         }
 
         if(U_SUCCESS(status)){
-            if(prohibited.contains((UChar) 0x644)){
+            if(prohibited.contains((char16_t) 0x644)){
                 printf("The string contains 0x644 ... !!\n");
             }
             UnicodeString temp;
@@ -135,8 +135,8 @@ NamePrepTransform::~NamePrepTransform(){
 }
 
 
-int32_t NamePrepTransform::map(const UChar* src, int32_t srcLength, 
-                        UChar* dest, int32_t destCapacity, 
+int32_t NamePrepTransform::map(const char16_t* src, int32_t srcLength,
+                        char16_t* dest, int32_t destCapacity,
                         UBool allowUnassigned,
                         UParseError* /*parseError*/,
                         UErrorCode& status ){
@@ -155,7 +155,7 @@ int32_t NamePrepTransform::map(const UChar* src, int32_t srcLength,
     // transliteration also performs NFKC
     mapping->transliterate(rsource);
     
-    const UChar* buffer = rsource.getBuffer();
+    const char16_t* buffer = rsource.getBuffer();
     int32_t bufLen = rsource.length();
     // check if unassigned
     if(allowUnassigned == false){
@@ -180,8 +180,8 @@ int32_t NamePrepTransform::map(const UChar* src, int32_t srcLength,
 
 #define MAX_BUFFER_SIZE 300
 
-int32_t NamePrepTransform::process( const UChar* src, int32_t srcLength, 
-                                    UChar* dest, int32_t destCapacity, 
+int32_t NamePrepTransform::process( const char16_t* src, int32_t srcLength,
+                                    char16_t* dest, int32_t destCapacity,
                                     UBool allowUnassigned,
                                     UParseError* parseError,
                                     UErrorCode& status ){
@@ -197,7 +197,7 @@ int32_t NamePrepTransform::process( const UChar* src, int32_t srcLength,
     }
 
     UnicodeString b1String;
-    UChar *b1 = b1String.getBuffer(MAX_BUFFER_SIZE);
+    char16_t *b1 = b1String.getBuffer(MAX_BUFFER_SIZE);
     int32_t b1Len;
 
     int32_t b1Index = 0;
index 88c15ed3b1ec8deca7e3250611a60da9e065d42e..75ac403705aab1ec085fdbc1e424371934519edc 100644 (file)
@@ -70,7 +70,7 @@ public :
      * that that a character be mapped to nothing, mapped to one 
      * other character or to a string of other characters.
      *
-     * @param src           Pointer to UChar buffer containing a single label
+     * @param src           Pointer to char16_t buffer containing a single label
      * @param srcLength     Number of characters in the source label
      * @param dest          Pointer to the destination buffer to receive the output
      * @param destCapacity  The capacity of destination array
@@ -81,8 +81,8 @@ public :
      *                      Must fulfill U_SUCCESS before the function call.
      * @return The number of UChars in the destination buffer
      */
-    int32_t map(const UChar* src, int32_t srcLength, 
-                        UChar* dest, int32_t destCapacity, 
+    int32_t map(const char16_t* src, int32_t srcLength,
+                        char16_t* dest, int32_t destCapacity,
                         UBool allowUnassigned,
                         UParseError* parseError,
                         UErrorCode& status );
@@ -91,7 +91,7 @@ public :
      * Prepare the input stream with for use. This operation maps, normalizes(NFKC),
      * checks for prohited and BiDi characters in the order defined by RFC 3454
      * 
-     * @param src           Pointer to UChar buffer containing a single label
+     * @param src           Pointer to char16_t buffer containing a single label
      * @param srcLength     Number of characters in the source label
      * @param dest          Pointer to the destination buffer to receive the output
      * @param destCapacity  The capacity of destination array
@@ -102,8 +102,8 @@ public :
      *                      Must fulfill U_SUCCESS before the function call.
      * @return The number of UChars in the destination buffer
      */
-    int32_t process(const UChar* src, int32_t srcLength, 
-                            UChar* dest, int32_t destCapacity, 
+    int32_t process(const char16_t* src, int32_t srcLength,
+                            char16_t* dest, int32_t destCapacity,
                             UBool allowUnassigned,
                             UParseError* parseError,
                             UErrorCode& status );
index 52dcb1a4ee45b2fcb256b0904d31324877fe6aa4..dc53f2dd6c5f3155367f39c283c0c166535aacf9 100644 (file)
@@ -148,7 +148,7 @@ static void strToInt(
     }
     int64_t value = 0;
     for (int32_t i = start; i < len; ++i) {
-        UChar ch = str[i];
+        char16_t ch = str[i];
         if (ch < 0x30 || ch > 0x39) {
             status = U_ILLEGAL_ARGUMENT_ERROR;
             return;
@@ -161,12 +161,12 @@ static void strToInt(
 
 static void intToStr(
         const void *intPtr, UnicodeString &appendTo) {
-    UChar buffer[20];
+    char16_t buffer[20];
     // int64_t such that all int32_t values can be negated
     int64_t xSigned = *static_cast<const int32_t *>(intPtr);
     uint32_t x;
     if (xSigned < 0) {
-        appendTo.append((UChar)0x2D);
+        appendTo.append((char16_t)0x2D);
         x = static_cast<uint32_t>(-xSigned);
     } else {
         x = static_cast<uint32_t>(xSigned);
index 84a8e77cda199847833f089d9ef4b1bd6a4795bf..5919b114d632e4640e502f41ca9c6a8029420d4f 100644 (file)
@@ -185,7 +185,7 @@ class NumberFormatterApiTest : public IntlTestWithFieldPosition {
         const char *locale;
         const char *unitDisplayCase;
         double value;
-        const UChar *expected;
+        const char16_t *expected;
     };
 
     void runUnitInflectionsTestCases(UnlocalizedNumberFormatter unf,
index dc2af235e46dbc34e9082c91e60beda583bd1526..f46821b558c647246ea02cbdef5ee8e76058bb0a 100644 (file)
@@ -2310,7 +2310,7 @@ void NumberFormatterApiTest::runUnitInflectionsTestCases(UnlocalizedNumberFormat
             continue;
         };
         UnicodeString skelString = UnicodeString("unit/") + t.unitIdentifier + u" " + skeleton;
-        const UChar *skel;
+        const char16_t *skel;
         if (t.unitDisplayCase == nullptr || t.unitDisplayCase[0] == 0) {
             unf = unf.unit(mu).unitDisplayCase("");
             skel = skelString.getTerminatedBuffer();
@@ -2337,7 +2337,7 @@ void NumberFormatterApiTest::runUnitInflectionsTestCases(UnlocalizedNumberFormat
         };
 
         UnicodeString skelString = UnicodeString("unit/") + t.unitIdentifier + u" " + skeleton;
-        const UChar *skel;
+        const char16_t *skel;
         auto displayOptionsBuilder = DisplayOptions::builder();
         if (t.unitDisplayCase == nullptr || t.unitDisplayCase[0] == 0) {
             auto displayoptions = displayOptionsBuilder.build();
@@ -2365,7 +2365,7 @@ void NumberFormatterApiTest::unitInflections() {
     IcuTestErrorCode status(*this, "unitInflections");
 
     UnlocalizedNumberFormatter unf;
-    const UChar *skeleton;
+    const char16_t *skeleton;
     {
         // Simple inflected form test - test case based on the example in CLDR's
         // grammaticalFeatures.xml
index 5ca838bd6a3c8b83b47d91fe46396806305e5d94..20fa00411033b8e28a02c2c74385761e8970e034 100644 (file)
@@ -171,7 +171,7 @@ outerEnd:
     int32_t lineNumber = 1;
     int32_t lineLength;
     for (const auto& actualLine : resultLines) {
-        const UChar* lineBuf = ucbuf_readline(f.getAlias(), &lineLength, status);
+        const char16_t* lineBuf = ucbuf_readline(f.getAlias(), &lineLength, status);
         if (lineBuf == nullptr) {
             errln("More lines generated than are in the data file!");
             break;
index e205fadb39df7f0601995d995cb93ee399f37947..a2c7f11cf99fd6efd0b5150256e2737db40d8060 100644 (file)
@@ -83,7 +83,7 @@ static void adjustDecimalFormat(const NumberFormatTestTuple& tuple, DecimalForma
     if (tuple.currencyFlag) {
         UErrorCode status = U_ZERO_ERROR;
         UnicodeString currency(tuple.currency);
-        const UChar* terminatedCurrency = currency.getTerminatedBuffer();
+        const char16_t* terminatedCurrency = currency.getTerminatedBuffer();
         fmt.setCurrency(terminatedCurrency, status);
         if (U_FAILURE(status)) {
             appendErrorMessage.append("Error setting currency.");
index a53e2c09af62a102ac2b76c180f1cc800a4d6bb1..70d95289b3f780cff94bdd5dd2d7a90246c341a3 100644 (file)
@@ -22,7 +22,7 @@
 #include "unicode/dtfmtsym.h"
 #include "uassert.h"
 
-static const UChar kJPY[] = {0x4A, 0x50, 0x59};
+static const char16_t kJPY[] = {0x4A, 0x50, 0x59};
 
 static void fixNonBreakingSpace(UnicodeString &str) {
     for (int32_t i = 0; i < str.length(); ++i) {
index 35a4e222b701bd4332015f4ee78559efac0ac94a..8254b707343a4aef383ce822c1dfb6c1dc633833 100644 (file)
@@ -73,8 +73,8 @@ using namespace icu::number;
 
 //#define NUMFMTST_DEBUG 1
 
-static const UChar EUR[] = {69,85,82,0}; // "EUR"
-static const UChar ISO_CURRENCY_USD[] = {0x55, 0x53, 0x44, 0}; // "USD"
+static const char16_t EUR[] = {69,85,82,0}; // "EUR"
+static const char16_t ISO_CURRENCY_USD[] = {0x55, 0x53, 0x44, 0}; // "USD"
 
 
 // *****************************************************************************
@@ -315,7 +315,7 @@ public:
         return appendTo;
     }
     virtual UnicodeString& format(int32_t ,UnicodeString& appendTo,FieldPosition& ) const override {
-        return appendTo.append((UChar)0x0033);
+        return appendTo.append((char16_t)0x0033);
     }
     virtual UnicodeString& format(int64_t number,UnicodeString& appendTo,FieldPosition& pos) const override {
         return NumberFormat::format(number, appendTo, pos);
@@ -840,7 +840,7 @@ NumberFormatTest::TestCurrencySign(void)
     UErrorCode status = U_ZERO_ERROR;
     DecimalFormatSymbols* sym = new DecimalFormatSymbols(Locale::getUS(), status);
     UnicodeString pat;
-    UChar currency = 0x00A4;
+    char16_t currency = 0x00A4;
     if (U_FAILURE(status)) {
         errcheckln(status, "Fail to create DecimalFormatSymbols - %s", u_errorName(status));
         delete sym;
@@ -883,7 +883,7 @@ NumberFormatTest::TestCurrencySign(void)
 
 // -------------------------------------
 
-static UChar toHexString(int32_t i) { return (UChar)(i + (i < 10 ? 0x30 : (0x41 - 10))); }
+static char16_t toHexString(int32_t i) { return (char16_t)(i + (i < 10 ? 0x30 : (0x41 - 10))); }
 
 UnicodeString&
 NumberFormatTest::escape(UnicodeString& s)
@@ -891,10 +891,10 @@ NumberFormatTest::escape(UnicodeString& s)
     UnicodeString buf;
     for (int32_t i=0; i<s.length(); ++i)
     {
-        UChar c = s[(int32_t)i];
-        if (c <= (UChar)0x7F) buf += c;
+        char16_t c = s[(int32_t)i];
+        if (c <= (char16_t)0x7F) buf += c;
         else {
-            buf += (UChar)0x5c; buf += (UChar)0x55;
+            buf += (char16_t)0x5c; buf += (char16_t)0x55;
             buf += toHexString((c & 0xF000) >> 12);
             buf += toHexString((c & 0x0F00) >> 8);
             buf += toHexString((c & 0x00F0) >> 4);
@@ -1767,10 +1767,10 @@ void NumberFormatTest::TestPad(void) {
   /*  fmt.setPadCharacter((UnicodeString)"^^^");
     expectPad(fmt, "*^^^#", DecimalFormat::kPadBeforePrefix, 3, (UnicodeString)"^^^");
     padString.remove();
-    padString.append((UChar)0x0061);
-    padString.append((UChar)0x0302);
+    padString.append((char16_t)0x0061);
+    padString.append((char16_t)0x0302);
     fmt.setPadCharacter(padString);
-    UChar patternChars[]={0x002a, 0x0061, 0x0302, 0x0061, 0x0302, 0x0023, 0x0000};
+    char16_t patternChars[]={0x002a, 0x0061, 0x0302, 0x0061, 0x0302, 0x0023, 0x0000};
     UnicodeString pattern(patternChars);
     expectPad(fmt, pattern , DecimalFormat::kPadBeforePrefix, 4, padString);
  */
@@ -1788,7 +1788,7 @@ void NumberFormatTest::TestPatterns2(void) {
     DecimalFormat fmt("#", US, status);
     CHECK(status, "DecimalFormat constructor");
 
-    UChar hat = 0x005E; /*^*/
+    char16_t hat = 0x005E; /*^*/
 
     expectPad(fmt, "*^#", DecimalFormat::kPadBeforePrefix, 1, hat);
     expectPad(fmt, "$*^#", DecimalFormat::kPadAfterPrefix, 2, hat);
@@ -1797,11 +1797,11 @@ void NumberFormatTest::TestPatterns2(void) {
     expectPad(fmt, "$*^$#", ILLEGAL);
     expectPad(fmt, "#$*^$", ILLEGAL);
     expectPad(fmt, "'pre'#,##0*x'post'", DecimalFormat::kPadBeforeSuffix,
-              12, (UChar)0x0078 /*x*/);
+              12, (char16_t)0x0078 /*x*/);
     expectPad(fmt, "''#0*x", DecimalFormat::kPadBeforeSuffix,
-              3, (UChar)0x0078 /*x*/);
+              3, (char16_t)0x0078 /*x*/);
     expectPad(fmt, "'I''ll'*a###.##", DecimalFormat::kPadAfterPrefix,
-              10, (UChar)0x0061 /*a*/);
+              10, (char16_t)0x0061 /*a*/);
 
     fmt.applyPattern("AA#,##0.00ZZ", status);
     CHECK(status, "applyPattern");
@@ -1891,7 +1891,7 @@ void NumberFormatTest::TestSurrogateSupport(void) {
     expect2(new DecimalFormat("##0.000", custom, status),
            1.25, expStr, status);
 
-    custom.setSymbol(DecimalFormatSymbols::kZeroDigitSymbol, (UChar)0x30);
+    custom.setSymbol(DecimalFormatSymbols::kZeroDigitSymbol, (char16_t)0x30);
     custom.setSymbol(DecimalFormatSymbols::kCurrencySymbol, "units of money");
     custom.setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, "money separator");
     patternStr = UNICODE_STRING_SIMPLE("0.00 \\u00A4' in your bank account'");
@@ -1955,11 +1955,11 @@ void NumberFormatTest::TestCurrencyPatterns(void) {
 void NumberFormatTest::TestRegCurrency(void) {
 #if !UCONFIG_NO_SERVICE
     UErrorCode status = U_ZERO_ERROR;
-    UChar USD[4];
+    char16_t USD[4];
     ucurr_forLocale("en_US", USD, 4, &status);
-    UChar YEN[4];
+    char16_t YEN[4];
     ucurr_forLocale("ja_JP", YEN, 4, &status);
-    UChar TMP[4];
+    char16_t TMP[4];
 
     if(U_FAILURE(status)) {
         errcheckln(status, "Unable to get currency for locale, error %s", u_errorName(status));
@@ -2001,10 +2001,10 @@ void NumberFormatTest::TestCurrencyNames(void) {
     // Do a basic check of getName()
     // USD { "US$", "US Dollar"            } // 04/04/1792-
     UErrorCode ec = U_ZERO_ERROR;
-    static const UChar USD[] = {0x55, 0x53, 0x44, 0}; /*USD*/
-    static const UChar USX[] = {0x55, 0x53, 0x58, 0}; /*USX*/
-    static const UChar CAD[] = {0x43, 0x41, 0x44, 0}; /*CAD*/
-    static const UChar ITL[] = {0x49, 0x54, 0x4C, 0}; /*ITL*/
+    static const char16_t USD[] = {0x55, 0x53, 0x44, 0}; /*USD*/
+    static const char16_t USX[] = {0x55, 0x53, 0x58, 0}; /*USX*/
+    static const char16_t CAD[] = {0x43, 0x41, 0x44, 0}; /*CAD*/
+    static const char16_t ITL[] = {0x49, 0x54, 0x4C, 0}; /*ITL*/
     UBool isChoiceFormat;
     int32_t len;
     const UBool possibleDataError = true;
@@ -2147,21 +2147,21 @@ void NumberFormatTest::TestCurrencyVariants(){
         status.setScope(cas.isoCode);
         UBool choiceFormatIgnored;
         int32_t lengthIgnored;
-        const UChar* actualShort = ucurr_getName(
+        const char16_t* actualShort = ucurr_getName(
             cas.isoCode,
             cas.locale,
             UCURR_SYMBOL_NAME,
             &choiceFormatIgnored,
             &lengthIgnored,
             status);
-        const UChar* actualFormal = ucurr_getName(
+        const char16_t* actualFormal = ucurr_getName(
             cas.isoCode,
             cas.locale,
             UCURR_FORMAL_SYMBOL_NAME,
             &choiceFormatIgnored,
             &lengthIgnored,
             status);
-        const UChar* actualVarant = ucurr_getName(
+        const char16_t* actualVarant = ucurr_getName(
             cas.isoCode,
             cas.locale,
             UCURR_VARIANT_SYMBOL_NAME,
@@ -2169,7 +2169,7 @@ void NumberFormatTest::TestCurrencyVariants(){
             &lengthIgnored,
             status);
         status.errIfFailureAndReset();
-        const UChar* actualNarrow = ucurr_getName(
+        const char16_t* actualNarrow = ucurr_getName(
             cas.isoCode,
             cas.locale,
             UCURR_NARROW_SYMBOL_NAME,
@@ -2190,24 +2190,24 @@ void NumberFormatTest::TestCurrencyVariants(){
 
 void NumberFormatTest::TestCurrencyUnit(void){
     UErrorCode ec = U_ZERO_ERROR;
-    static const UChar USD[]  = u"USD";
+    static const char16_t USD[]  = u"USD";
     static const char USD8[]  =  "USD";
-    static const UChar BAD[]  = u"???";
-    static const UChar BAD2[] = u"??A";
-    static const UChar XXX[]  = u"XXX";
+    static const char16_t BAD[]  = u"???";
+    static const char16_t BAD2[] = u"??A";
+    static const char16_t XXX[]  = u"XXX";
     static const char XXX8[]  =  "XXX";
-    static const UChar XYZ[]  = u"XYZ";
+    static const char16_t XYZ[]  = u"XYZ";
     static const char XYZ8[]  =  "XYZ";
-    static const UChar INV[]  = u"{$%";
+    static const char16_t INV[]  = u"{$%";
     static const char INV8[]  =  "{$%";
-    static const UChar ZZZ[]  = u"zz";
+    static const char16_t ZZZ[]  = u"zz";
     static const char ZZZ8[]  = "zz";
-    static const UChar JPY[]  = u"JPY";
+    static const char16_t JPY[]  = u"JPY";
     static const char JPY8[]  =  "JPY";
-    static const UChar jpy[]  = u"jpy";
+    static const char16_t jpy[]  = u"jpy";
     static const char jpy8[]  =  "jpy";
 
-    UChar* EUR = (UChar*) malloc(6);
+    char16_t* EUR = (char16_t*) malloc(6);
     EUR[0] = u'E';
     EUR[1] = u'U';
     EUR[2] = u'R';
@@ -2350,7 +2350,7 @@ void NumberFormatTest::TestCurrencyUnit(void){
 
 void NumberFormatTest::TestCurrencyAmount(void){
     UErrorCode ec = U_ZERO_ERROR;
-    static const UChar USD[] = {85, 83, 68, 0}; /*USD*/
+    static const char16_t USD[] = {85, 83, 68, 0}; /*USD*/
     CurrencyAmount ca(9, USD, ec);
     assertSuccess("CurrencyAmount", ec);
 
@@ -2387,9 +2387,9 @@ void NumberFormatTest::TestSymbolsWithBadLocale(void) {
         Locale locBad(localeName);
         assertTrue(WHERE, !locBad.isBogus());
         UErrorCode status = U_ZERO_ERROR;
-        UnicodeString intlCurrencySymbol((UChar)0xa4);
+        UnicodeString intlCurrencySymbol((char16_t)0xa4);
 
-        intlCurrencySymbol.append((UChar)0xa4);
+        intlCurrencySymbol.append((char16_t)0xa4);
 
         logln("Current locale is %s", Locale::getDefault().getName());
         Locale::setDefault(locBad, status);
@@ -2433,7 +2433,7 @@ void NumberFormatTest::TestAdoptDecimalFormatSymbols(void) {
         return;
     }
     UnicodeString pat(" #,##0.00");
-    pat.insert(0, (UChar)0x00A4);
+    pat.insert(0, (char16_t)0x00A4);
     DecimalFormat fmt(pat, sym, ec);
     if (U_FAILURE(ec)) {
         errln("Fail: DecimalFormat constructor");
@@ -2584,7 +2584,7 @@ static int32_t keywordIndex(const UnicodeString& tok) {
  */
 static void parseCurrencyAmount(const UnicodeString& str,
                                 const NumberFormat& fmt,
-                                UChar delim,
+                                char16_t delim,
                                 Formattable& result,
                                 UErrorCode& ec) {
     UnicodeString num, cur;
@@ -2720,14 +2720,14 @@ void NumberFormatTest::TestCases() {
             // fpc: <loc or '-'> <curr.amt> <exp. string> <exp. curr.amt>
             if (!tokens.next(currAmt, ec)) goto error;
             if (!tokens.next(str, ec)) goto error;
-            parseCurrencyAmount(currAmt, *ref, (UChar)0x2F/*'/'*/, n, ec);
+            parseCurrencyAmount(currAmt, *ref, (char16_t)0x2F/*'/'*/, n, ec);
             if (assertSuccess("parseCurrencyAmount", ec)) {
                 assertEquals(where + "getCurrencyFormat(" + mloc + ").format(" + currAmt + ")",
                              str, mfmt->format(n, out.remove(), ec));
                 assertSuccess("format", ec);
             }
             if (!tokens.next(currAmt, ec)) goto error;
-            parseCurrencyAmount(currAmt, *ref, (UChar)0x2F/*'/'*/, n, ec);
+            parseCurrencyAmount(currAmt, *ref, (char16_t)0x2F/*'/'*/, n, ec);
             if (assertSuccess("parseCurrencyAmount", ec)) {
                 Formattable m;
 
@@ -2990,8 +2990,8 @@ void NumberFormatTest::expectCurrency(NumberFormat& nf, const Locale& locale,
                                       double value, const UnicodeString& string) {
     UErrorCode ec = U_ZERO_ERROR;
     DecimalFormat& fmt = * (DecimalFormat*) &nf;
-    const UChar DEFAULT_CURR[] = {45/*-*/,0};
-    UChar curr[4];
+    const char16_t DEFAULT_CURR[] = {45/*-*/,0};
+    char16_t curr[4];
     u_strcpy(curr, DEFAULT_CURR);
     if (*locale.getLanguage() != 0) {
         ucurr_forLocale(locale.getName(), curr, 4, &ec);
@@ -3042,7 +3042,7 @@ void NumberFormatTest::expectPad(DecimalFormat& fmt, const UnicodeString& pat,
     expectPad(fmt, pat, pos, 0, (UnicodeString)"");
 }
 void NumberFormatTest::expectPad(DecimalFormat& fmt, const UnicodeString& pat,
-                                 int32_t pos, int32_t width, UChar pad) {
+                                 int32_t pos, int32_t width, char16_t pad) {
     expectPad(fmt, pat, pos, width, UnicodeString(pad));
 }
 void NumberFormatTest::expectPad(DecimalFormat& fmt, const UnicodeString& pat,
@@ -3076,8 +3076,8 @@ void NumberFormatTest::expectPad(DecimalFormat& fmt, const UnicodeString& pat,
 // This test is flaky b/c the symbols for CNY and JPY are equivalent in this locale  - FIXME
 void NumberFormatTest::TestCompatibleCurrencies() {
 /*
-    static const UChar JPY[] = {0x4A, 0x50, 0x59, 0};
-    static const UChar CNY[] = {0x43, 0x4E, 0x59, 0};
+    static const char16_t JPY[] = {0x4A, 0x50, 0x59, 0};
+    static const char16_t CNY[] = {0x43, 0x4E, 0x59, 0};
     UErrorCode status = U_ZERO_ERROR;
     LocalPointer<NumberFormat> fmt(
         NumberFormat::createCurrencyInstance(Locale::getUS(), status));
@@ -3112,7 +3112,7 @@ void NumberFormatTest::TestCompatibleCurrencies() {
 */
 }
 
-void NumberFormatTest::expectParseCurrency(const NumberFormat &fmt, const UChar* currency, double amount, const char *text) {
+void NumberFormatTest::expectParseCurrency(const NumberFormat &fmt, const char16_t* currency, double amount, const char *text) {
     ParsePosition ppos;
     UnicodeString utext = ctou(text);
     LocalPointer<CurrencyAmount> currencyAmount(fmt.parseCurrency(utext, ppos));
@@ -3240,7 +3240,7 @@ void NumberFormatTest::TestCurrencyFormat()
     MeasureFormat *cloneObj;
     UnicodeString str;
     Formattable toFormat, result;
-    static const UChar ISO_CODE[4] = {0x0047, 0x0042, 0x0050, 0};
+    static const char16_t ISO_CODE[4] = {0x0047, 0x0042, 0x0050, 0};
 
     Locale  saveDefaultLocale = Locale::getDefault();
     Locale::setDefault( Locale::getUK(), status );
@@ -3632,9 +3632,9 @@ NumberFormatTest::TestMultiCurrencySign() {
         {"zh_CN", "\\u00A4#,##0.00;(\\u00A4#,##0.00)", "1", "\\u00A51.00", "CNY\\u00A01.00", "\\u4EBA\\u6C11\\u5E01\\u00A01.00"}
     };
 
-    const UChar doubleCurrencySign[] = {0xA4, 0xA4, 0};
+    const char16_t doubleCurrencySign[] = {0xA4, 0xA4, 0};
     UnicodeString doubleCurrencyStr(doubleCurrencySign);
-    const UChar tripleCurrencySign[] = {0xA4, 0xA4, 0xA4, 0};
+    const char16_t tripleCurrencySign[] = {0xA4, 0xA4, 0xA4, 0};
     UnicodeString tripleCurrencyStr(tripleCurrencySign);
 
     for (uint32_t i=0; i<UPRV_LENGTHOF(DATA); ++i) {
@@ -3788,7 +3788,7 @@ NumberFormatTest::TestDecimalFormatCurrencyParse() {
         return;
     }
     UnicodeString pat;
-    UChar currency = 0x00A4;
+    char16_t currency = 0x00A4;
     // "\xA4#,##0.00;-\xA4#,##0.00"
     pat.append(currency).append(currency).append(currency).append("#,##0.00;-").append(currency).append(currency).append(currency).append("#,##0.00");
     DecimalFormat* fmt = new DecimalFormat(pat, sym, status);
@@ -3876,7 +3876,7 @@ NumberFormatTest::TestCurrencyIsoPluralFormat() {
             dataerrln((UnicodeString)"can not create instance, locale:" + localeString + ", style: " + k + " - " + u_errorName(status));
             continue;
         }
-        UChar currencyCode[4];
+        char16_t currencyCode[4];
         u_charsToUChars(currencyISOCode, currencyCode, 4);
         numFmt->setCurrency(currencyCode, status);
         if (U_FAILURE(status)) {
@@ -3991,7 +3991,7 @@ for (;;) {
             dataerrln((UnicodeString)"can not create instance, locale:" + localeString + ", style: " + k + " - " + u_errorName(status));
             continue;
         }
-        UChar currencyCode[4];
+        char16_t currencyCode[4];
         u_charsToUChars(currencyISOCode, currencyCode, 4);
         numFmt->setCurrency(currencyCode, status);
         if (U_FAILURE(status)) {
@@ -7140,7 +7140,7 @@ NumberFormatTest::Test9087(void)
     U_STRING_DECL(nanstr,"NAN",3);
     U_STRING_INIT(nanstr,"NAN",3);
 
-    UChar outputbuf[50] = {0};
+    char16_t outputbuf[50] = {0};
     UErrorCode status = U_ZERO_ERROR;
     UNumberFormat* fmt = unum_open(UNUM_PATTERN_DECIMAL,pattern,1,nullptr,nullptr,&status);
     if ( U_FAILURE(status) ) {
@@ -7338,10 +7338,10 @@ UBool NumberFormatTest::testFormattableAsUFormattable(const char *file, int line
       UnicodeString str;
       f.getString(str);
       int32_t len;
-      const UChar* uch = ufmt_getUChars(u, &len, &valueStatus);
+      const char16_t* uch = ufmt_getUChars(u, &len, &valueStatus);
       if(U_SUCCESS(valueStatus)) {
         UnicodeString str2(uch, len);
-        assertTrue("UChar* NUL-terminated", uch[len]==0);
+        assertTrue("char16_t* NUL-terminated", uch[len]==0);
         exactMatch = (str == str2);
       }
       triedExact = true;
@@ -7700,7 +7700,7 @@ void NumberFormatTest::TestCustomCurrencySignAndSeparator() {
     custom.setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, ":");
 
     UnicodeString pat(" #,##0.00");
-    pat.insert(0, (UChar)0x00A4);
+    pat.insert(0, (char16_t)0x00A4);
 
     DecimalFormat fmt(pat, custom, status);
     CHECK(status, "DecimalFormat constructor");
@@ -8246,7 +8246,7 @@ void NumberFormatTest::TestCurrencyUsage() {
 
     // Test the currency change
     // 1st time for getter/setter, 2nd time for factory method
-    const UChar CUR_PKR[] = {0x50, 0x4B, 0x52, 0};
+    const char16_t CUR_PKR[] = {0x50, 0x4B, 0x52, 0};
     for(int i=0; i<2; i++){
         status = U_ZERO_ERROR;
         if(i == 0){
@@ -8445,7 +8445,7 @@ void NumberFormatTest::TestFractionalDigitsForCurrency() {
         dataerrln("Error creating NumberFormat - %s", u_errorName(status));
         return;
     }
-    UChar JPY[] = {0x4A, 0x50, 0x59, 0x0};
+    char16_t JPY[] = {0x4A, 0x50, 0x59, 0x0};
     fmt->setCurrency(JPY, status);
     if (!assertSuccess("", status)) {
         return;
@@ -8602,7 +8602,7 @@ void NumberFormatTest::Test13737_ParseScientificStrict() {
 
 void NumberFormatTest::Test11376_getAndSetPositivePrefix() {
     {
-        const UChar USD[] = {0x55, 0x53, 0x44, 0x0};
+        const char16_t USD[] = {0x55, 0x53, 0x44, 0x0};
         UErrorCode status = U_ZERO_ERROR;
         LocalPointer<NumberFormat> fmt(
                 NumberFormat::createCurrencyInstance("en", status));
@@ -8622,7 +8622,7 @@ void NumberFormatTest::Test11376_getAndSetPositivePrefix() {
         assertSuccess("", status);
     }
     {
-        const UChar USD[] = {0x55, 0x53, 0x44, 0x0};
+        const char16_t USD[] = {0x55, 0x53, 0x44, 0x0};
         UErrorCode status = U_ZERO_ERROR;
         LocalPointer<NumberFormat> fmt(
                 NumberFormat::createInstance("en", UNUM_CURRENCY_PLURAL, status));
@@ -8731,7 +8731,7 @@ void NumberFormatTest::Test11649_toPatternWithMultiCurrency() {
     if (!assertSuccess("", status)) {
         return;
     }
-    static UChar USD[] = {0x55, 0x53, 0x44, 0x0};
+    static char16_t USD[] = {0x55, 0x53, 0x44, 0x0};
     fmt.setCurrency(USD);
     UnicodeString appendTo;
 
@@ -8778,7 +8778,7 @@ void NumberFormatTest::Test13391_chakmaParsing() {
         dataerrln("%s %d Chakma df is null",  __FILE__, __LINE__);
         return;
     }
-    const UChar* expected = u"\U00011137\U00011138,\U00011139\U0001113A\U0001113B";
+    const char16_t* expected = u"\U00011137\U00011138,\U00011139\U0001113A\U0001113B";
     UnicodeString actual;
     df->format(12345, actual, status);
     assertSuccess("Should not fail when formatting in ccp", status);
@@ -8789,7 +8789,7 @@ void NumberFormatTest::Test13391_chakmaParsing() {
     assertSuccess("Should not fail when parsing in ccp", status);
     assertEquals("Should parse to 12345 in ccp", 12345, result);
 
-    const UChar* expectedScientific = u"\U00011137.\U00011139E\U00011138";
+    const char16_t* expectedScientific = u"\U00011137.\U00011139E\U00011138";
     UnicodeString actualScientific;
     df.adoptInstead(static_cast<DecimalFormat*>(
         NumberFormat::createScientificInstance(Locale("ccp"), status)));
@@ -9381,7 +9381,7 @@ void NumberFormatTest::Test11649_DecFmtCurrencies() {
     pattern = pattern.unescape();
     DecimalFormat fmt(pattern, status);
     if (!assertSuccess("", status, true, __FILE__, __LINE__)) { return; }
-    static const UChar USD[] = u"USD";
+    static const char16_t USD[] = u"USD";
     fmt.setCurrency(USD);
     UnicodeString appendTo;
 
index 5b20204e17436a94c637e13182661b5cee3bb6f1..4b897ab40fe6d6430012f6a35f717124135209ec 100644 (file)
@@ -313,7 +313,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
  private:
     UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f);
 
-    void expectParseCurrency(const NumberFormat &fmt, const UChar* currency, double amount, const char *text);
+    void expectParseCurrency(const NumberFormat &fmt, const char16_t* currency, double amount, const char *text);
 
     static UBool equalValue(const Formattable& a, const Formattable& b);
 
@@ -373,10 +373,10 @@ class NumberFormatTest: public CalendarTimeZoneTest {
                         double value, const UnicodeString& string);
 
     void expectPad(DecimalFormat& fmt, const UnicodeString& pat,
-                   int32_t pos, int32_t width, UChar pad);
+                   int32_t pos, int32_t width, char16_t pad);
 
     void expectPad(DecimalFormat& fmt, const char *pat,
-                   int32_t pos, int32_t width, UChar pad) {
+                   int32_t pos, int32_t width, char16_t pad) {
         expectPad(fmt, UnicodeString(pat, ""), pos, width, pad);
     }
 
@@ -399,7 +399,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
 
     void expectPad(DecimalFormat& fmt, const char *pat,
                    int32_t pos) {
-        expectPad(fmt, pat, pos, 0, (UChar)0);
+        expectPad(fmt, pat, pos, 0, (char16_t)0);
     }
 
     void expect_rbnf(NumberFormat& fmt, const UnicodeString& str, const Formattable& n);
index 0adc7ffcce40bd55ecdc5ef3c40711727fd6ff98..a9c71cf01207429187bf298a3085fb471ffbc9be 100644 (file)
@@ -334,7 +334,7 @@ void NumberFormatRegressionTest::Test4087245 (void)
     FieldPosition pos(FieldPosition::DONT_CARE);
     logln(UnicodeString("format(") + n + ") = " + 
         df->format(n, buf1, pos));
-    symbols->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, UnicodeString((UChar)0x70)); // change value of field
+    symbols->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, UnicodeString((char16_t)0x70)); // change value of field
     logln(UnicodeString("format(") + n + ") = " +
         df->format(n, buf2, pos));
     if(buf1 != buf2)
@@ -548,7 +548,7 @@ void NumberFormatRegressionTest::Test4086575(void)
     logln("...applyLocalizedPattern # ###,00;(# ###,00) ");
     // nbsp = \u00a0
     //nf->applyLocalizedPattern("#\u00a0###,00;(#\u00a0###,00)");
-    UChar patChars[] = {
+    char16_t patChars[] = {
              0x23, 0x202f, 0x23, 0x23, 0x23, 0x2c, 0x30, 0x30, 0x3b, 
         0x28, 0x23, 0x202f, 0x23, 0x23, 0x23, 0x2c, 0x30, 0x30, 0x29
     };
@@ -560,7 +560,7 @@ void NumberFormatRegressionTest::Test4086575(void)
     UnicodeString buffer;
     buffer = nf->format((int32_t)1234, buffer, pos);
     //if (buffer != UnicodeString("1\u00a0234,00"))
-    UChar c[] = {
+    char16_t c[] = {
         0x31, 0x202f, 0x32, 0x33, 0x34, 0x2c, 0x30, 0x30
     };
     UnicodeString cc(c, 8, 8);
@@ -569,7 +569,7 @@ void NumberFormatRegressionTest::Test4086575(void)
     
     buffer.remove();
     buffer = nf->format((int32_t)-1234, buffer, pos);
-    UChar c1[] = {
+    char16_t c1[] = {
         0x28, 0x31, 0x202f, 0x32, 0x33, 0x34, 0x2c, 0x30, 0x30, 0x29
     };
     UnicodeString cc1(c1, 10, 10);
@@ -901,13 +901,13 @@ void NumberFormatRegressionTest::Test4070798 (void)
     String expectedCurrency = "5\u202f789,98\u00a0F";
     String expectedPercent = "-578\u202f998%";
     */
-    UChar chars1 [] = {
+    char16_t chars1 [] = {
         0x2d, 0x35, 0x202f, 0x37, 0x38, 0x39, 0x2c, 0x39, 0x38, 0x38
     };
-    UChar chars2 [] = {
+    char16_t chars2 [] = {
         0x35, 0x202f, 0x37, 0x38, 0x39, 0x2c, 0x39, 0x39, 0x00a0, 0x46
     };
-    UChar chars3 [] = {
+    char16_t chars3 [] = {
         0x2d, 0x35, 0x37, 0x38, 0x202f, 0x39, 0x39, 0x39, 0x00a0, 0x25
     };
     UnicodeString expectedDefault(chars1, 10, 10);
@@ -978,13 +978,13 @@ void NumberFormatRegressionTest::Test4071005 (void)
     String expectedCurrency = "5\u00a0789,98\u00a0$";
     String expectedPercent = "-578\u00a0998%";
     */
-    UChar chars1 [] = {
+    char16_t chars1 [] = {
         0x2d, 0x35, 0x00a0, 0x37, 0x38, 0x39, 0x2c, 0x39, 0x38, 0x38
     };
-    UChar chars2 [] = {
+    char16_t chars2 [] = {
         0x35, 0x00a0, 0x37, 0x38, 0x39, 0x2c, 0x39, 0x39, 0x00a0, 0x24
     };
-    UChar chars3 [] = {
+    char16_t chars3 [] = {
         0x2d, 0x35, 0x37, 0x38, 0x00a0, 0x39, 0x39, 0x39, 0x00a0, 0x25
     };
     UnicodeString expectedDefault(chars1, 10, 10);
@@ -1370,13 +1370,13 @@ void NumberFormatRegressionTest::Test4061302(void)
     logln((UnicodeString)"Before set ==> Currency : " + currency +(UnicodeString)" Intl Currency : " + intlCurrency + (UnicodeString)" Monetary Decimal Separator : " + monDecSeparatorStr);
     fmt->setSymbol(DecimalFormatSymbols::kCurrencySymbol, UnicodeString("XYZ"));
     fmt->setSymbol(DecimalFormatSymbols::kIntlCurrencySymbol, UnicodeString("ABC"));
-    fmt->setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, UnicodeString((UChar)0x002A/*'*'*/));
+    fmt->setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, UnicodeString((char16_t)0x002A/*'*'*/));
     currency = fmt->getSymbol(DecimalFormatSymbols::kCurrencySymbol);
     intlCurrency = fmt->getSymbol(DecimalFormatSymbols::kIntlCurrencySymbol);
     monDecSeparator = fmt->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol);
     if (currency != UnicodeString("XYZ") ||
         intlCurrency != UnicodeString("ABC") ||
-        monDecSeparator != UnicodeString((UChar)0x002A/*'*'*/)) {
+        monDecSeparator != UnicodeString((char16_t)0x002A/*'*'*/)) {
         errln("setCurrencySymbols failed.");
     }
     monDecSeparatorStr.remove();
@@ -1594,7 +1594,7 @@ void NumberFormatRegressionTest::Test4106667(void)
       return;
     }
     failure(status, "new DecimalFormat");
-    UChar foo [] = { 0x002B };
+    char16_t foo [] = { 0x002B };
     UnicodeString bar(foo, 1, 1);
     volatile double d = 0.0;   // volatile to prevent code optimization
     UnicodeString temp;
@@ -1677,7 +1677,7 @@ void NumberFormatRegressionTest::Test4122840(void)
         UnicodeString pattern = numPat.getString(status);
         failure(status, "rb->getString()");
 
-        UChar fo[] = { 0x00A4 };
+        char16_t fo[] = { 0x00A4 };
         UnicodeString foo(fo, 1, 1);
 
         //if (pattern.indexOf("\u00A4") == -1 ) {
@@ -1708,7 +1708,7 @@ void NumberFormatRegressionTest::Test4122840(void)
         // pattern.  We have to skip locales where the currency symbol
         // contains decimal separators, because that confuses things
         //
-        UChar ba[] = { 0x002E/*'.'*/ };
+        char16_t ba[] = { 0x002E/*'.'*/ };
         UnicodeString bar(ba, 1, 1);
 
         if (symbols->getSymbol(DecimalFormatSymbols::kCurrencySymbol).indexOf(bar) == -1) {
@@ -1736,7 +1736,7 @@ void NumberFormatRegressionTest::Test4122840(void)
             failure(status, "new DecimalFormat");
             
             // Get the currency (if there is one) so we can set the rounding and fraction
-            const UChar *currency = fmt1->getCurrency();
+            const char16_t *currency = fmt1->getCurrency();
             if (*currency != 0) {
                 double rounding = ucurr_getRoundingIncrement(currency, &status);
                 int32_t frac = ucurr_getDefaultFractionDigits(currency, &status);
@@ -1948,7 +1948,7 @@ void NumberFormatRegressionTest::Test4145457() {
     }
 
     DecimalFormatSymbols *sym = (DecimalFormatSymbols*) nf->getDecimalFormatSymbols();
-    sym->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, (UChar)/*'\''*/0x0027);
+    sym->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, (char16_t)/*'\''*/0x0027);
     nf->setDecimalFormatSymbols(*sym);
     double pi = 3.14159;
     
@@ -2335,7 +2335,7 @@ void NumberFormatRegressionTest::Test4212072(void) {
     UnicodeString s;
     FieldPosition pos;
 
-    sym.setSymbol(DecimalFormatSymbols::kMinusSignSymbol, (UChar)0x5e);
+    sym.setSymbol(DecimalFormatSymbols::kMinusSignSymbol, (char16_t)0x5e);
     fmt.setDecimalFormatSymbols(sym);
     s.remove();
     if (fmt.format((int32_t)-1, s, pos) != UNICODE_STRING("^1", 2)) {
@@ -2343,15 +2343,15 @@ void NumberFormatRegressionTest::Test4212072(void) {
               ", exp ^1");
     }
     s.remove();
-    if (fmt.getNegativePrefix(s) != UnicodeString((UChar)0x5e)) {
+    if (fmt.getNegativePrefix(s) != UnicodeString((char16_t)0x5e)) {
         errln(UnicodeString("FAIL: (minus=^).getNegativePrefix -> ") +
               s + ", exp ^");
     }
-    sym.setSymbol(DecimalFormatSymbols::kMinusSignSymbol, (UChar)0x2d);
+    sym.setSymbol(DecimalFormatSymbols::kMinusSignSymbol, (char16_t)0x2d);
 
     fmt.applyPattern(UnicodeString("#%"), status);
     failure(status, "applyPattern percent");
-    sym.setSymbol(DecimalFormatSymbols::kPercentSymbol, (UChar)0x5e);
+    sym.setSymbol(DecimalFormatSymbols::kPercentSymbol, (char16_t)0x5e);
     fmt.setDecimalFormatSymbols(sym);
     s.remove();
     if (fmt.format(0.25, s, pos) != UNICODE_STRING("25^", 3)) {
@@ -2359,15 +2359,15 @@ void NumberFormatRegressionTest::Test4212072(void) {
               ", exp 25^");
     }
     s.remove();
-    if (fmt.getPositiveSuffix(s) != UnicodeString((UChar)0x5e)) {
+    if (fmt.getPositiveSuffix(s) != UnicodeString((char16_t)0x5e)) {
         errln(UnicodeString("FAIL: (percent=^).getPositiveSuffix -> ") +
               s + ", exp ^");
     }
-    sym.setSymbol(DecimalFormatSymbols::kPercentSymbol, (UChar)0x25);
+    sym.setSymbol(DecimalFormatSymbols::kPercentSymbol, (char16_t)0x25);
 
     fmt.applyPattern(str("#\\u2030"), status);
     failure(status, "applyPattern permill");
-    sym.setSymbol(DecimalFormatSymbols::kPerMillSymbol, (UChar)0x5e);
+    sym.setSymbol(DecimalFormatSymbols::kPerMillSymbol, (char16_t)0x5e);
     fmt.setDecimalFormatSymbols(sym);
     s.remove();
     if (fmt.format(0.25, s, pos) != UNICODE_STRING("250^", 4)) {
@@ -2375,11 +2375,11 @@ void NumberFormatRegressionTest::Test4212072(void) {
               ", exp 250^");
     }
     s.remove();
-    if (fmt.getPositiveSuffix(s) != UnicodeString((UChar)0x5e)) {
+    if (fmt.getPositiveSuffix(s) != UnicodeString((char16_t)0x5e)) {
         errln(UnicodeString("FAIL: (permill=^).getPositiveSuffix -> ") +
               s + ", exp ^");
     }
-    sym.setSymbol(DecimalFormatSymbols::kPerMillSymbol, (UChar)0x2030);
+    sym.setSymbol(DecimalFormatSymbols::kPerMillSymbol, (char16_t)0x2030);
 
     fmt.applyPattern(str("\\u00A4#.00"), status);
     failure(status, "applyPattern currency");
@@ -2943,11 +2943,11 @@ void NumberFormatRegressionTest::Test9780(void) {
 
 
 void NumberFormatRegressionTest::Test9677(void) {
-  static const UChar pattern[] = { 0x23,0x23,0x23,0x23,0x2E,0x23,0x23,0x23,0x23,0 }; // "####.####"
-  static const UChar positivePrefix[] = { 0x40,0 }; // "@"
-  static const UChar negativePrefix[] = { 0x6E,0 }; // "n"
-  static const UChar text[] = { 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0 }; // 123456789
-  static const UChar text2[] = { 0x6E, 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0 }; // n123456789
+  static const char16_t pattern[] = { 0x23,0x23,0x23,0x23,0x2E,0x23,0x23,0x23,0x23,0 }; // "####.####"
+  static const char16_t positivePrefix[] = { 0x40,0 }; // "@"
+  static const char16_t negativePrefix[] = { 0x6E,0 }; // "n"
+  static const char16_t text[] = { 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0 }; // 123456789
+  static const char16_t text2[] = { 0x6E, 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0 }; // n123456789
   
   UErrorCode status = U_ZERO_ERROR;
   LocalUNumberFormatPointer f(unum_open(UNUM_DEFAULT, nullptr, 0, "en_US", nullptr, &status));
index 48525cf96e574b1482e25722409457af44a18984..32b3ff16619bdbab7b35d0576fd4978413767add 100644 (file)
@@ -558,7 +558,7 @@ PluralFormatTest::pluralFormatExtendedTest(void) {
   UErrorCode status = U_ZERO_ERROR;
   UnicodeString fmtString(fmt, -1, US_INV);
   PluralFormat pf(Locale::getEnglish(), fmtString, status);
-  MessageFormat mf(UNICODE_STRING_SIMPLE("{0,plural,").append(fmtString).append((UChar)0x7d /* '}' */),
+  MessageFormat mf(UNICODE_STRING_SIMPLE("{0,plural,").append(fmtString).append((char16_t)0x7d /* '}' */),
                    Locale::getEnglish(), status);
   Formattable args;
   FieldPosition ignore;
index af372494cdb4c874f0e6062f096b679d00acd713..5a1ed42be137f420d7b0ac00daa17450a5c45716 100644 (file)
@@ -651,7 +651,7 @@ void RBBIAPITest::TestQuoteGrouping() {
 //      Test word break rule status constants.
 //
 void RBBIAPITest::TestRuleStatus() {
-     UChar str[30];
+     char16_t str[30];
      //no longer test Han or hiragana breaking here: ruleStatusVec would return nothing
      // changed UBRK_WORD_KANA to UBRK_WORD_IDEO
      u_unescape("plain word 123.45 \\u30a1\\u30a2 ",
@@ -1125,8 +1125,8 @@ void RBBIAPITest::TestRefreshInputText() {
      *    runs BreakIterator::next() repeatedly, moving the text in the middle of the sequence.
      *    The right set of boundaries should still be found.
      */
-    UChar testStr[]  = {0x20, 0x41, 0x20, 0x42, 0x20, 0x43, 0x20, 0x44, 0x0};  /* = " A B C D"  */
-    UChar movedStr[] = {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,  0};
+    char16_t testStr[]  = {0x20, 0x41, 0x20, 0x42, 0x20, 0x43, 0x20, 0x44, 0x0};  /* = " A B C D"  */
+    char16_t movedStr[] = {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,  0};
     UErrorCode status = U_ZERO_ERROR;
     UText ut1 = UTEXT_INITIALIZER;
     UText ut2 = UTEXT_INITIALIZER;
@@ -1168,7 +1168,7 @@ void RBBIAPITest::TestRefreshInputText() {
 
 #if !UCONFIG_NO_BREAK_ITERATION && !UCONFIG_NO_FILTERED_BREAK_ITERATION
 static void prtbrks(BreakIterator* brk, const UnicodeString &ustr, IntlTest &it) {
-  static const UChar PILCROW=0x00B6, CHSTR=0x3010, CHEND=0x3011; // lenticular brackets
+  static const char16_t PILCROW=0x00B6, CHSTR=0x3010, CHEND=0x3011; // lenticular brackets
   it.logln(UnicodeString("String:'")+ustr+UnicodeString("'"));
 
   int32_t *pos = new int32_t[ustr.length()];
@@ -1184,16 +1184,16 @@ static void prtbrks(BreakIterator* brk, const UnicodeString &ustr, IntlTest &it)
     }
   }
   UnicodeString out;
-  out.append((UChar)CHSTR);
+  out.append((char16_t)CHSTR);
   int32_t prev = 0;
   for(int32_t i=0;i<posCount;i++) {
     int32_t n=pos[i];
     out.append(ustr.tempSubString(prev,n-prev));
-    out.append((UChar)PILCROW);
+    out.append((char16_t)PILCROW);
     prev=n;
   }
   out.append(ustr.tempSubString(prev,ustr.length()-prev));
-  out.append((UChar)CHEND);
+  out.append((char16_t)CHEND);
   it.logln(out);
 
   out.remove();
index 78e40f2841896cb6baf9f2d002f179e493ce80b6..cd8436ac30f8490f8047fdb51cbfee1e0dbd9e6e 100644 (file)
@@ -195,11 +195,11 @@ void BreakRules::addRule(const UnicodeString &name, const UnicodeString &definit
     // Replace the divide sign (\u00f7) with a regular expression named capture.
     // When running the rules, a match that includes this group means we found a break position.
 
-    int32_t dividePos = thisRule->fExpandedRule.indexOf((UChar)0x00f7);
+    int32_t dividePos = thisRule->fExpandedRule.indexOf((char16_t)0x00f7);
     if (dividePos >= 0) {
         thisRule->fExpandedRule.replace(dividePos, 1, UnicodeString("(?<BreakPosition>)"));
     }
-    if (thisRule->fExpandedRule.indexOf((UChar)0x00f7) != -1) {
+    if (thisRule->fExpandedRule.indexOf((char16_t)0x00f7) != -1) {
         status = U_ILLEGAL_ARGUMENT_ERROR;   // TODO: produce a good error message.
     }
 
@@ -207,7 +207,7 @@ void BreakRules::addRule(const UnicodeString &name, const UnicodeString &definit
     // Regular expression set expressions don't accept this. Substitute with [^\u0000-\U0010ffff], which
     // also matches nothing.
 
-    static const UChar emptySet[] = {(UChar)0x5b, (UChar)0x5d, 0};
+    static const char16_t emptySet[] = {(char16_t)0x5b, (char16_t)0x5d, 0};
     int32_t where = 0;
     while ((where = thisRule->fExpandedRule.indexOf(emptySet, 2, 0)) >= 0) {
         thisRule->fExpandedRule.replace(where, 2, UnicodeString("[^\\u0000-\\U0010ffff]"));
@@ -291,7 +291,7 @@ void BreakRules::compileRules(UCHARBUF *rules, UErrorCode &status) {
             return;
         }
         int32_t lineLength = 0;
-        const UChar *lineBuf = ucbuf_readline(rules, &lineLength, &status);
+        const char16_t *lineBuf = ucbuf_readline(rules, &lineLength, &status);
         if (lineBuf == nullptr) {
             break;
         }
@@ -446,7 +446,7 @@ void MonkeyTestData::set(BreakRules *rules, IntlTest::icu_rand &rand, UErrorCode
 
     // Apply reference rules to find the expected breaks.
 
-    fExpectedBreaks.setCharAt(0, (UChar)1);  // Force an expected break before the start of the text.
+    fExpectedBreaks.setCharAt(0, (char16_t)1);  // Force an expected break before the start of the text.
                                              // ICU always reports a break there.
                                              // The reference rules do not have a means to do so.
     int32_t strIdx = 0;
@@ -501,9 +501,9 @@ void MonkeyTestData::set(BreakRules *rules, IntlTest::icu_rand &rand, UErrorCode
         // Record which rule matched over the length of the match.
         for (int i = matchStart; i < matchEnd; i++) {
             if (fRuleForPosition.charAt(i) == 0) {
-                fRuleForPosition.setCharAt(i, (UChar)ruleNum);
+                fRuleForPosition.setCharAt(i, (char16_t)ruleNum);
             } else {
-                f2ndRuleForPos.setCharAt(i, (UChar)ruleNum);
+                f2ndRuleForPos.setCharAt(i, (char16_t)ruleNum);
             }
         }
 
@@ -520,7 +520,7 @@ void MonkeyTestData::set(BreakRules *rules, IntlTest::icu_rand &rand, UErrorCode
                 status =  U_INVALID_FORMAT_ERROR;
                 break;
             }
-            fExpectedBreaks.setCharAt(breakPos, (UChar)1);
+            fExpectedBreaks.setCharAt(breakPos, (char16_t)1);
             // printf("recording break at %d\n", breakPos);
             // For the next iteration, pick up applying rules immediately after the break,
             // which may differ from end of the match. The matching rule may have included
@@ -556,7 +556,7 @@ void MonkeyTestData::clearActualBreaks() {
     // Actual Breaks length is one longer than the data string length, allowing
     //    for breaks before the first and after the last character in the data.
     for (int32_t i=0; i<=fString.length(); i++) {
-        fActualBreaks.append((UChar)0);
+        fActualBreaks.append((char16_t)0);
     }
 }
 
index 6daf1e2f921f957dd089f459af104aa68833e8eb..264b418421a663e881375fbb52510ec8bf1d93d9 100644 (file)
@@ -232,7 +232,7 @@ void RBBITest::TestBug3818() {
     UErrorCode  status = U_ZERO_ERROR;
 
     // Four Thai words...
-    static const UChar thaiWordData[] = {  0x0E43,0x0E2B,0x0E0D,0x0E48, 0x0E43,0x0E2B,0x0E0D,0x0E48,
+    static const char16_t thaiWordData[] = {  0x0E43,0x0E2B,0x0E0D,0x0E48, 0x0E43,0x0E2B,0x0E0D,0x0E48,
                                            0x0E43,0x0E2B,0x0E0D,0x0E48, 0x0E43,0x0E2B,0x0E0D,0x0E48, 0 };
     UnicodeString  thaiStr(thaiWordData);
 
@@ -752,7 +752,7 @@ void RBBITest::TestExtended() {
     testFileName.append("rbbitst.txt", -1, status);
 
     int    len;
-    UChar *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
+    char16_t *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
     if (U_FAILURE(status)) {
         errln("%s:%d Error %s opening file rbbitst.txt", __FILE__, __LINE__, u_errorName(status));
         return;
@@ -788,7 +788,7 @@ void RBBITest::TestExtended() {
 
     for (charIdx = 0; charIdx < len; ) {
         status = U_ZERO_ERROR;
-        UChar  c = testString.charAt(charIdx);
+        char16_t  c = testString.charAt(charIdx);
         charIdx++;
         if (c == u'\r' && charIdx<len && testString.charAt(charIdx) == u'\n') {
             // treat CRLF as a unit
@@ -1250,7 +1250,7 @@ UBool RBBITest::testCaseIsKnownIssue(const UnicodeString &testCase, const char *
     static struct TestCase {
         const char *fTicketNum;
         const char *fFileName;
-        const UChar *fString;
+        const char16_t *fString;
     } badTestCases[] = {
         {"10666", "GraphemeBreakTest.txt", u"\u0020\u0020\u0033"},    // Fake example, for illustration.
         // The following tests were originally for
@@ -1326,7 +1326,7 @@ void RBBITest::runUnicodeTestData(const char *fileName, RuleBasedBreakIterator *
     logln("Opening data file %s\n", fileName);
 
     int    len;
-    UChar *testFile = ReadAndConvertFile(testFileName, len, "UTF-8", status);
+    char16_t *testFile = ReadAndConvertFile(testFileName, len, "UTF-8", status);
     if (status != U_FILE_ACCESS_ERROR) {
         TEST_ASSERT_SUCCESS(status);
         TEST_ASSERT(testFile != nullptr);
@@ -3607,7 +3607,7 @@ void RBBITest::TestWordBoundary(void)
                 __FILE__, __LINE__, u_errorName(status));
         return;
     }
-    UChar         str[50];
+    char16_t      str[50];
     static const char *strlist[] =
     {
     "\\u200e\\U000e0072\\u0a4b\\U000e003f\\ufd2b\\u2027\\u002e\\u002e",
@@ -3688,7 +3688,7 @@ void RBBITest::TestLineBreaks(void)
     UErrorCode    status = U_ZERO_ERROR;
     BreakIterator *bi = BreakIterator::createLineInstance(locale, status);
     const int32_t  STRSIZE = 50;
-    UChar         str[STRSIZE];
+    char16_t      str[STRSIZE];
     static const char *strlist[] =
     {
      "\\u300f\\ufdfc\\ub798\\u2011\\u2011\\u0020\\u0b43\\u002d\\ubeec\\ufffc",
@@ -3779,7 +3779,7 @@ void RBBITest::TestSentBreaks(void)
     Locale        locale("en");
     UErrorCode    status = U_ZERO_ERROR;
     BreakIterator *bi = BreakIterator::createSentenceInstance(locale, status);
-    UChar         str[200];
+    char16_t      str[200];
     static const char *strlist[] =
     {
      "Now\ris\nthe\r\ntime\n\rfor\r\r",
@@ -4390,7 +4390,7 @@ void RBBITest::TestBug12797() {
 
 void RBBITest::TestBug12918() {
     // This test triggers an assertion failure in dictbe.cpp
-    const UChar *crasherString = u"\u3325\u4a16";
+    const char16_t *crasherString = u"\u3325\u4a16";
     UErrorCode status = U_ZERO_ERROR;
     UBreakIterator* iter = ubrk_open(UBRK_WORD, nullptr, crasherString, -1, &status);
     if (U_FAILURE(status)) {
@@ -4445,7 +4445,7 @@ void RBBITest::TestEmoji() {
     logln("Opening data file %s\n", testFileName.data());
 
     int    len;
-    UChar *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
+    char16_t *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
     if (U_FAILURE(status) || testFile == nullptr) {
         errln("%s:%s %s while opening emoji-test.txt", __FILE__, __LINE__, u_errorName(status));
         return;
@@ -4820,7 +4820,7 @@ void RBBITest::TestDebugRules() {
     path.appendPathPart("rules", status);
     path.appendPathPart("line.txt", status);
     int    len;
-    std::unique_ptr<UChar []> testFile(ReadAndConvertFile(path.data(), len, "UTF-8", status));
+    std::unique_ptr<char16_t []> testFile(ReadAndConvertFile(path.data(), len, "UTF-8", status));
     if (!assertSuccess(WHERE, status)) {
         return;
     }
@@ -4844,13 +4844,13 @@ void RBBITest::testTrieStateTable(int32_t numChar, bool expectedTrieWidthIn8Bits
     int32_t expectedStateRowBits = expectedStateRowIn8Bits ? RBBI_8BITS_ROWS : 0;
     // Text are duplicate characters from U+4E00 to U+4FFF
     UnicodeString text;
-    for (UChar c = 0x4e00; c < 0x5000; c++) {
+    for (char16_t c = 0x4e00; c < 0x5000; c++) {
         text.append(c).append(c);
     }
     // Generate rule which will caused length+4 character classes and
     // length+3 states
     UnicodeString rules(u"!!quoted_literals_only;");
-    for (UChar c = 0x4e00; c < 0x4e00 + numChar; c++) {
+    for (char16_t c = 0x4e00; c < 0x4e00 + numChar; c++) {
         rules.append(u'\'').append(c).append(c).append(u"';");
     }
     rules.append(u".;");
@@ -4966,7 +4966,7 @@ void RBBITest::TestTable_8_16_Bits() {
     // and as test data to check matching behavior. A break rule consisting of the first 120
     // characters of testStr will match the first 120 chars of the full-length testStr.
     UnicodeString testStr;
-    for (UChar c=0x3000; c<0x3200; ++c) {
+    for (char16_t c=0x3000; c<0x3200; ++c) {
         testStr.append(c);
     }
 
@@ -5355,7 +5355,7 @@ void RBBITest::runLSTMTestFromFile(const char* filename, UScriptCode script) {
     testFileName.append(filename, -1, status);
 
     int len;
-    UChar *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
+    char16_t *testFile = ReadAndConvertFile(testFileName.data(), len, "UTF-8", status);
     if (U_FAILURE(status)) {
         errln("%s:%d Error %s opening test file %s", __FILE__, __LINE__, u_errorName(status), filename);
         return;
index b094e4f553d329f22a17612ef903f981a8878db1..743a815e6447e77e69e612baad8f02afbd667303 100644 (file)
@@ -90,14 +90,14 @@ void CollationRegressionTest::Test4051866(/* char* par */)
 
     rules += "&n < o ";
     rules += "& oe ,o";
-    rules += (UChar)0x3080;
+    rules += (char16_t)0x3080;
     rules += "& oe ,";
-    rules += (UChar)0x1530;
+    rules += (char16_t)0x1530;
     rules += " ,O";
     rules += "& OE ,O";
-    rules += (UChar)0x3080;
+    rules += (char16_t)0x3080;
     rules += "& OE ,";
-    rules += (UChar)0x1520;
+    rules += (char16_t)0x1520;
     rules += "< p ,P";
 
     // Build a collator containing expanding characters
@@ -140,7 +140,7 @@ void CollationRegressionTest::Test4053636(/* char* par */)
 //
 void CollationRegressionTest::Test4054238(/* char* par */)
 {
-    const UChar chars3[] = {0x61, 0x00FC, 0x62, 0x65, 0x63, 0x6b, 0x20, 0x47, 0x72, 0x00F6, 0x00DF, 0x65, 0x20, 0x4c, 0x00FC, 0x62, 0x63, 0x6b, 0};
+    const char16_t chars3[] = {0x61, 0x00FC, 0x62, 0x65, 0x63, 0x6b, 0x20, 0x47, 0x72, 0x00F6, 0x00DF, 0x65, 0x20, 0x4c, 0x00FC, 0x62, 0x63, 0x6b, 0};
     const UnicodeString test3(chars3);
     RuleBasedCollator *c = en_us->clone();
 
@@ -174,7 +174,7 @@ void CollationRegressionTest::Test4054734(/* char* par */)
         };
     */
 
-    static const UChar decomp[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t decomp[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x0001, 0},      {0x3c, 0}, {0x0002, 0},
         {0x0001, 0},      {0x3d, 0}, {0x0001, 0},
@@ -206,7 +206,7 @@ void CollationRegressionTest::Test4054736(/* char* par */)
     c->setStrength(Collator::SECONDARY);
     c->setAttribute(UCOL_NORMALIZATION_MODE, UCOL_ON, status);
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0xFB4F, 0}, {0x3d, 0}, {0x05D0, 0x05DC}  // Alef-Lamed vs. Alef, Lamed
     };
@@ -300,9 +300,9 @@ void CollationRegressionTest::Test4060154(/* char* par */)
 
     rules += "&f < g, G < h, H < i, I < j, J";
     rules +=  " & H < ";
-    rules += (UChar)0x0131;
+    rules += (char16_t)0x0131;
     rules += ", ";
-    rules += (UChar)0x0130;
+    rules += (char16_t)0x0130;
     rules += ", i, I";
 
     RuleBasedCollator *c = nullptr;
@@ -329,7 +329,7 @@ void CollationRegressionTest::Test4060154(/* char* par */)
     };
 */
 
-    static const UChar tertiary[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tertiary[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x41, 0},    {0x3c, 0}, {0x42, 0},
         {0x48, 0},    {0x3c, 0}, {0x0131, 0},
@@ -348,7 +348,7 @@ void CollationRegressionTest::Test4060154(/* char* par */)
         "\u0131",   "=",    "\u0130",
     };
 */
-    static const UChar secondary[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t secondary[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x48, 0},    {0x3c, 0}, {0x49, 0},
         {0x0131, 0}, {0x3d, 0}, {0x0130, 0}
@@ -386,7 +386,7 @@ void CollationRegressionTest::Test4062418(/* char* par */)
             "p\u00eache",    "<",    "p\u00e9ch\u00e9",    // Comparing accents from end, p\u00e9ch\u00e9 is greater
     };
 */
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x70, 0x00EA, 0x63, 0x68, 0x65, 0}, {0x3c, 0}, {0x70, 0x00E9, 0x63, 0x68, 0x00E9, 0}
     };
@@ -416,8 +416,8 @@ void CollationRegressionTest::Test4065540(/* char* par */)
 //
 void CollationRegressionTest::Test4066189(/* char* par */)
 {
-    static const UChar chars1[] = {0x1EB1, 0};
-    static const UChar chars2[] = {0x61, 0x0306, 0x0300, 0};
+    static const char16_t chars1[] = {0x1EB1, 0};
+    static const char16_t chars2[] = {0x61, 0x0306, 0x0300, 0};
     const UnicodeString test1(chars1);
     const UnicodeString test2(chars2);
     UErrorCode status = U_ZERO_ERROR;
@@ -474,7 +474,7 @@ void CollationRegressionTest::Test4066696(/* char* par */)
 
 */
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x00E0, 0}, {0x3e, 0}, {0x01FA, 0}
     };
@@ -492,8 +492,8 @@ void CollationRegressionTest::Test4076676(/* char* par */)
 {
     // These combining characters are all in the same class, so they should not
     // be reordered, and they should compare as unequal.
-    static const UChar s1[] = {0x41, 0x0301, 0x0302, 0x0300, 0};
-    static const UChar s2[] = {0x41, 0x0302, 0x0300, 0x0301, 0};
+    static const char16_t s1[] = {0x41, 0x0301, 0x0302, 0x0300, 0};
+    static const char16_t s2[] = {0x41, 0x0302, 0x0300, 0x0301, 0};
 
     RuleBasedCollator *c = en_us->clone();
     c->setStrength(Collator::TERTIARY);
@@ -569,8 +569,8 @@ void CollationRegressionTest::Test4081866(/* char* par */)
 {
     // These combining characters are all in different classes,
     // so they should be reordered and the strings should compare as equal.
-    static const UChar s1[] = {0x41, 0x0300, 0x0316, 0x0327, 0x0315, 0};
-    static const UChar s2[] = {0x41, 0x0327, 0x0316, 0x0315, 0x0300, 0};
+    static const char16_t s1[] = {0x41, 0x0300, 0x0316, 0x0327, 0x0315, 0};
+    static const char16_t s2[] = {0x41, 0x0327, 0x0316, 0x0315, 0x0300, 0};
 
     UErrorCode status = U_ZERO_ERROR;
     RuleBasedCollator *c = en_us->clone();
@@ -610,7 +610,7 @@ void CollationRegressionTest::Test4087241(/* char* par */)
 
     c->setStrength(Collator::SECONDARY);
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x7a, 0},          {0x3c, 0}, {0x00E6, 0},            // z        < ae
         {0x61, 0x0308, 0},  {0x3c, 0}, {0x61, 0x030A, 0},      // a-umlaut < a-ring
@@ -631,7 +631,7 @@ void CollationRegressionTest::Test4087243(/* char* par */)
     RuleBasedCollator *c = en_us->clone();
     c->setStrength(Collator::TERTIARY);
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x31, 0x32, 0x33, 0}, {0x3d, 0}, {0x31, 0x32, 0x33, 0x0001, 0}    // 1 2 3  =  1 2 3 ctrl-A
     };
@@ -664,7 +664,7 @@ void CollationRegressionTest::Test4092260(/* char* par */)
     // These now have tertiary differences in UCA
     c->setAttribute(UCOL_STRENGTH, UCOL_SECONDARY, status);
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x00B5, 0}, {0x3d, 0}, {0x03BC, 0}
     };
@@ -692,7 +692,7 @@ void CollationRegressionTest::Test4095316(/* char* par */)
     //c->setStrength(Collator::TERTIARY);
     c->setAttribute(UCOL_STRENGTH, UCOL_SECONDARY, status);
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x03D4, 0}, {0x3d, 0}, {0x03AB, 0}
     };
@@ -741,7 +741,7 @@ void CollationRegressionTest::Test4103436(/* char* par */)
     RuleBasedCollator *c = en_us->clone();
     c->setStrength(Collator::TERTIARY);
 
-    static const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x66, 0x69, 0x6c, 0x65, 0}, {0x3c, 0}, {0x66, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0},
         {0x66, 0x69, 0x6c, 0x65, 0}, {0x3c, 0}, {0x66, 0x69, 0x6c, 0x65, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0}
@@ -767,7 +767,7 @@ void CollationRegressionTest::Test4114076(/* char* par */)
     // into Jamo, but Jamo characters should not be decomposed into
     // conjoining Jamo
     //
-    static const UChar test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0xd4db, 0}, {0x3d, 0}, {0x1111, 0x1171, 0x11b6, 0}
     };
@@ -784,7 +784,7 @@ void CollationRegressionTest::Test4114076(/* char* par */)
 //obsolete-    // With Full decomposition, it should go all the way down to
 //obsolete-    // conjoining Jamo characters.
 //obsolete-    //
-//obsolete-    static const UChar test2[][CollationRegressionTest::MAX_TOKEN_LEN] =
+//obsolete-    static const char16_t test2[][CollationRegressionTest::MAX_TOKEN_LEN] =
 //obsolete-    {
 //obsolete-        {0xd4db, 0}, {0x3d, 0}, {0x1111, 0x116e, 0x1175, 0x11af, 0x11c2, 0}
 //obsolete-    };
@@ -814,7 +814,7 @@ void CollationRegressionTest::Test4124632(/* char* par */)
         return;
     }
 
-    static const UChar test[] = {0x41, 0x0308, 0x62, 0x63, 0};
+    static const char16_t test[] = {0x41, 0x0308, 0x62, 0x63, 0};
     CollationKey key;
 
     coll->getCollationKey(test, key, status);
@@ -847,7 +847,7 @@ void CollationRegressionTest::Test4132736(/* char* par */)
         return;
     }
 
-    static const UChar test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x65, 0x0300, 0x65, 0x0301, 0}, {0x3c, 0}, {0x65, 0x0301, 0x65, 0x0300, 0},
         {0x65, 0x0300, 0x0301, 0},       {0x3c, 0}, {0x65, 0x0301, 0x0300, 0}
@@ -864,7 +864,7 @@ void CollationRegressionTest::Test4132736(/* char* par */)
 //
 void CollationRegressionTest::Test4133509(/* char* par */)
 {
-    static const UChar test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0}, {0x3c, 0}, {0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0},
         {0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0},      {0x3c, 0}, {0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0},
@@ -887,7 +887,7 @@ void CollationRegressionTest::Test4114077(/* char* par */)
     RuleBasedCollator *c = en_us->clone();
     c->setStrength(Collator::TERTIARY);
 
-    static const UChar test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t test1[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x00C0, 0},                     {0x3d, 0}, {0x41, 0x0300, 0},            // Should be equivalent
         {0x70, 0x00ea, 0x63, 0x68, 0x65, 0}, {0x3e, 0}, {0x70, 0x00e9, 0x63, 0x68, 0x00e9, 0},
@@ -900,7 +900,7 @@ void CollationRegressionTest::Test4114077(/* char* par */)
     c->setAttribute(UCOL_NORMALIZATION_MODE, UCOL_OFF, status);
     compareArray(*c, test1, UPRV_LENGTHOF(test1));
 
-    static const UChar test2[][CollationRegressionTest::MAX_TOKEN_LEN] =
+    static const char16_t test2[][CollationRegressionTest::MAX_TOKEN_LEN] =
     {
         {0x41, 0x0300, 0x0316, 0}, {0x3d, 0}, {0x41, 0x0316, 0x0300, 0}      // Reordering --> equal
     };
@@ -1086,7 +1086,7 @@ void CollationRegressionTest::Test4179216() {
 // Ticket 7189
 //
 // nextSortKeyPart incorrect for EO_S1 collation
-static int32_t calcKeyIncremental(UCollator *coll, const UChar* text, int32_t len, uint8_t *keyBuf, int32_t /*keyBufLen*/, UErrorCode& status) {
+static int32_t calcKeyIncremental(UCollator *coll, const char16_t* text, int32_t len, uint8_t *keyBuf, int32_t /*keyBufLen*/, UErrorCode& status) {
     UCharIterator uiter;
     uint32_t state[2] = { 0, 0 };
     int32_t keyLen;
@@ -1112,7 +1112,7 @@ void CollationRegressionTest::TestT7189() {
     UCollator *coll;
     uint32_t i;
 
-    static const UChar text1[][CollationRegressionTest::MAX_TOKEN_LEN] = {
+    static const char16_t text1[][CollationRegressionTest::MAX_TOKEN_LEN] = {
     // "Achter De Hoven"
         { 0x41, 0x63, 0x68, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x20, 0x48, 0x6F, 0x76, 0x65, 0x6E, 0x00 },
         // "ABC"
@@ -1121,7 +1121,7 @@ void CollationRegressionTest::TestT7189() {
         { 0x48, 0x45, 0x4C, 0x4C, 0x4F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x21, 0x00 }
     };
 
-    static const UChar text2[][CollationRegressionTest::MAX_TOKEN_LEN] = {
+    static const char16_t text2[][CollationRegressionTest::MAX_TOKEN_LEN] = {
     // "Achter de Hoven"
         { 0x41, 0x63, 0x68, 0x74, 0x65, 0x72, 0x20, 0x64, 0x65, 0x20, 0x48, 0x6F, 0x76, 0x65, 0x6E, 0x00 },
         // "abc"
@@ -1191,18 +1191,18 @@ void CollationRegressionTest::TestCaseFirstCompression() {
 void CollationRegressionTest::caseFirstCompressionSub(Collator *col, UnicodeString opt) {
     const int32_t maxLength = 50;
 
-    UChar str1[maxLength];
-    UChar str2[maxLength];
+    char16_t str1[maxLength];
+    char16_t str2[maxLength];
 
     CollationKey key1, key2;
 
     for (int32_t len = 1; len <= maxLength; len++) {
         int32_t i = 0;
         for (; i < len - 1; i++) {
-            str1[i] = str2[i] = (UChar)0x61; // 'a'
+            str1[i] = str2[i] = (char16_t)0x61; // 'a'
         }
-        str1[i] = (UChar)0x41; // 'A'
-        str2[i] = (UChar)0x61; // 'a'
+        str1[i] = (char16_t)0x41; // 'A'
+        str2[i] = (char16_t)0x61; // 'a'
 
         UErrorCode status = U_ZERO_ERROR;
         col->getCollationKey(str1, len, key1, status);
@@ -1226,7 +1226,7 @@ void CollationRegressionTest::TestTrailingComment() {
     // Check that the rule parser handles a comment without terminating end-of-line.
     IcuTestErrorCode errorCode(*this, "TestTrailingComment");
     RuleBasedCollator coll(UNICODE_STRING_SIMPLE("&c<b#comment1\n<a#comment2"), errorCode);
-    UnicodeString a((UChar)0x61), b((UChar)0x62), c((UChar)0x63);
+    UnicodeString a((char16_t)0x61), b((char16_t)0x62), c((char16_t)0x63);
     assertTrue("c<b", coll.compare(c, b) < 0);
     assertTrue("b<a", coll.compare(b, a) < 0);
 }
@@ -1250,7 +1250,7 @@ void CollationRegressionTest::TestBeforeWithTooStrongAfter() {
 }
 
 void CollationRegressionTest::compareArray(Collator &c,
-                                           const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN],
+                                           const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN],
                                            int32_t testCount)
 {
     int32_t i;
index d9bcb4ff8600587fcae1a825e844f0695535b8ed..6a6de48a852bf94ae5da48b47b811c7a9d262899 100644 (file)
@@ -242,7 +242,7 @@ private:
     // Internal utilities
     //
     void compareArray(Collator &c,
-                    const UChar tests[][CollationRegressionTest::MAX_TOKEN_LEN],
+                    const char16_t tests[][CollationRegressionTest::MAX_TOKEN_LEN],
                     int32_t testCount);
 
     void assertEqual(CollationElementIterator &i1, CollationElementIterator &i2);
index 9491b676e0d6e60ef7b3dc1c4ee2857b6ce2eff2..d124a59352446d9d6139d343f190c6591a4174a7 100644 (file)
@@ -169,7 +169,7 @@ const char* RegexTest::extractToAssertBuf(const UnicodeString& message) {
       if(ASSERT_BUF[0]==0) {
         ASSERT_BUF[0]=0;
         for(int32_t i=0;i<buf.length();i++) {
-          UChar ch = buf[i];
+          char16_t ch = buf[i];
           snprintf(ASSERT_BUF+strlen(ASSERT_BUF), sizeof(ASSERT_BUF) - strlen(ASSERT_BUF), "\\u%02x",ch);
         }
       }
@@ -1203,7 +1203,7 @@ void RegexTest::API_Match() {
 
 
     //
-    // Compilation error on reset with UChar *
+    // Compilation error on reset with char16_t *
     //   These were a hazard that people were stumbling over with runtime errors.
     //   Changed them to compiler errors by adding private methods that more closely
     //   matched the incorrect use of the functions.
@@ -1211,7 +1211,7 @@ void RegexTest::API_Match() {
 #if 0
     {
         UErrorCode status = U_ZERO_ERROR;
-        UChar ucharString[20];
+        char16_t ucharString[20];
         RegexMatcher m(".", 0, status);
         m.reset(ucharString);  // should not compile.
 
@@ -3175,7 +3175,7 @@ void RegexTest::Extended() {
     }
 
     int32_t    len;
-    UChar *testData = ReadAndConvertFile(srcPath, len, "utf-8", status);
+    char16_t *testData = ReadAndConvertFile(srcPath, len, "utf-8", status);
     if (U_FAILURE(status)) {
         return; /* something went wrong, error already output */
     }
@@ -3378,26 +3378,26 @@ void RegexTest::regex_find(const UnicodeString &pattern,
     //  Compile the caller's pattern
     //
     uint32_t bflags = 0;
-    if (flags.indexOf((UChar)0x69) >= 0)  { // 'i' flag
+    if (flags.indexOf((char16_t)0x69) >= 0)  { // 'i' flag
         bflags |= UREGEX_CASE_INSENSITIVE;
     }
-    if (flags.indexOf((UChar)0x78) >= 0)  { // 'x' flag
+    if (flags.indexOf((char16_t)0x78) >= 0)  { // 'x' flag
         bflags |= UREGEX_COMMENTS;
     }
-    if (flags.indexOf((UChar)0x73) >= 0)  { // 's' flag
+    if (flags.indexOf((char16_t)0x73) >= 0)  { // 's' flag
         bflags |= UREGEX_DOTALL;
     }
-    if (flags.indexOf((UChar)0x6d) >= 0)  { // 'm' flag
+    if (flags.indexOf((char16_t)0x6d) >= 0)  { // 'm' flag
         bflags |= UREGEX_MULTILINE;
     }
 
-    if (flags.indexOf((UChar)0x65) >= 0) { // 'e' flag
+    if (flags.indexOf((char16_t)0x65) >= 0) { // 'e' flag
         bflags |= UREGEX_ERROR_ON_UNKNOWN_ESCAPES;
     }
-    if (flags.indexOf((UChar)0x44) >= 0) { // 'D' flag
+    if (flags.indexOf((char16_t)0x44) >= 0) { // 'D' flag
         bflags |= UREGEX_UNIX_LINES;
     }
-    if (flags.indexOf((UChar)0x51) >= 0) { // 'Q' flag
+    if (flags.indexOf((char16_t)0x51) >= 0) { // 'Q' flag
         bflags |= UREGEX_LITERAL;
     }
 
@@ -3407,13 +3407,13 @@ void RegexTest::regex_find(const UnicodeString &pattern,
         #if UCONFIG_NO_BREAK_ITERATION==1
         // 'v' test flag means that the test pattern should not compile if ICU was configured
         //     to not include break iteration.  RBBI is needed for Unicode word boundaries.
-        if (flags.indexOf((UChar)0x76) >= 0 /*'v'*/ && status == U_UNSUPPORTED_ERROR) {
+        if (flags.indexOf((char16_t)0x76) >= 0 /*'v'*/ && status == U_UNSUPPORTED_ERROR) {
             goto cleanupAndReturn;
         }
         #endif
-        if (flags.indexOf((UChar)0x45) >= 0) {  //  flags contain 'E'
+        if (flags.indexOf((char16_t)0x45) >= 0) {  //  flags contain 'E'
             // Expected pattern compilation error.
-            if (flags.indexOf((UChar)0x64) >= 0) {   // flags contain 'd'
+            if (flags.indexOf((char16_t)0x64) >= 0) {   // flags contain 'd'
                 logln("Pattern Compile returns \"%s\"", u_errorName(status));
             }
             goto cleanupAndReturn;
@@ -3440,13 +3440,13 @@ void RegexTest::regex_find(const UnicodeString &pattern,
 #if UCONFIG_NO_BREAK_ITERATION==1
             // 'v' test flag means that the test pattern should not compile if ICU was configured
             //     to not include break iteration.  RBBI is needed for Unicode word boundaries.
-            if (flags.indexOf((UChar)0x76) >= 0 /*'v'*/ && status == U_UNSUPPORTED_ERROR) {
+            if (flags.indexOf((char16_t)0x76) >= 0 /*'v'*/ && status == U_UNSUPPORTED_ERROR) {
                 goto cleanupAndReturn;
             }
 #endif
-            if (flags.indexOf((UChar)0x45) >= 0) {  //  flags contain 'E'
+            if (flags.indexOf((char16_t)0x45) >= 0) {  //  flags contain 'E'
                 // Expected pattern compilation error.
-                if (flags.indexOf((UChar)0x64) >= 0) {   // flags contain 'd'
+                if (flags.indexOf((char16_t)0x64) >= 0) {   // flags contain 'd'
                     logln("Pattern Compile returns \"%s\" (UTF8)", u_errorName(status));
                 }
                 goto cleanupAndReturn;
@@ -3464,11 +3464,11 @@ void RegexTest::regex_find(const UnicodeString &pattern,
         status = U_ZERO_ERROR;
     }
 
-    if (flags.indexOf((UChar)0x64) >= 0) {  // 'd' flag
+    if (flags.indexOf((char16_t)0x64) >= 0) {  // 'd' flag
         callerPattern->dumpPattern();
     }
 
-    if (flags.indexOf((UChar)0x45) >= 0) {  // 'E' flag
+    if (flags.indexOf((char16_t)0x45) >= 0) {  // 'E' flag
         errln("%s, Line %d: Expected, but did not get, a pattern compilation error.", srcPath, line);
         goto cleanupAndReturn;
     }
@@ -3479,7 +3479,7 @@ void RegexTest::regex_find(const UnicodeString &pattern,
     //
     numFinds = 1;
     for (i=2; i<=9; i++) {
-        if (flags.indexOf((UChar)(0x30 + i)) >= 0) {   // digit flag
+        if (flags.indexOf((char16_t)(0x30 + i)) >= 0) {   // digit flag
             if (numFinds != 1) {
                 errln("Line %d: more than one digit flag.  Scanning %d.", line, i);
                 goto cleanupAndReturn;
@@ -3489,10 +3489,10 @@ void RegexTest::regex_find(const UnicodeString &pattern,
     }
 
     // 'M' flag.  Use matches() instead of find()
-    if (flags.indexOf((UChar)0x4d) >= 0) {
+    if (flags.indexOf((char16_t)0x4d) >= 0) {
         useMatchesFunc = true;
     }
-    if (flags.indexOf((UChar)0x4c) >= 0) {
+    if (flags.indexOf((char16_t)0x4c) >= 0) {
         useLookingAtFunc = true;
     }
 
@@ -3548,7 +3548,7 @@ void RegexTest::regex_find(const UnicodeString &pattern,
     //
     matcher = callerPattern->matcher(deTaggedInput, status);
     REGEX_CHECK_STATUS_L(line);
-    if (flags.indexOf((UChar)0x74) >= 0) {   //  't' trace flag
+    if (flags.indexOf((char16_t)0x74) >= 0) {   //  't' trace flag
         matcher->setTrace(true);
     }
 
@@ -3575,7 +3575,7 @@ void RegexTest::regex_find(const UnicodeString &pattern,
     //  Generate native indices for UTF8 versions of region and capture group info
     //
     if (UTF8Matcher != nullptr) {
-        if (flags.indexOf((UChar)0x74) >= 0) {   //  't' trace flag
+        if (flags.indexOf((char16_t)0x74) >= 0) {   //  't' trace flag
             UTF8Matcher->setTrace(true);
         }
         if (regionStart>=0)    (void) utextOffsetToNative(&inputText, regionStart, regionStartUTF8);
@@ -3618,13 +3618,13 @@ void RegexTest::regex_find(const UnicodeString &pattern,
            REGEX_CHECK_STATUS_L(line);
        }
     }
-    if (flags.indexOf((UChar)0x61) >= 0) {   //  'a' anchoring bounds flag
+    if (flags.indexOf((char16_t)0x61) >= 0) {   //  'a' anchoring bounds flag
         matcher->useAnchoringBounds(false);
         if (UTF8Matcher != nullptr) {
             UTF8Matcher->useAnchoringBounds(false);
         }
     }
-    if (flags.indexOf((UChar)0x62) >= 0) {   //  'b' transparent bounds flag
+    if (flags.indexOf((char16_t)0x62) >= 0) {   //  'b' transparent bounds flag
         matcher->useTransparentBounds(true);
         if (UTF8Matcher != nullptr) {
             UTF8Matcher->useTransparentBounds(true);
@@ -3690,7 +3690,7 @@ void RegexTest::regex_find(const UnicodeString &pattern,
         failed = true;
     }
 
-    if (flags.indexOf((UChar)0x47 /*G*/) >= 0) {
+    if (flags.indexOf((char16_t)0x47 /*G*/) >= 0) {
         // Only check for match / no match.  Don't check capture groups.
         goto cleanupAndReturn;
     }
@@ -3738,41 +3738,41 @@ void RegexTest::regex_find(const UnicodeString &pattern,
         failed = true;
     }
 
-    if ((flags.indexOf((UChar)0x59) >= 0) &&   //  'Y' flag:  RequireEnd() == false
+    if ((flags.indexOf((char16_t)0x59) >= 0) &&   //  'Y' flag:  RequireEnd() == false
         matcher->requireEnd() == true) {
         errln("Error at line %d: requireEnd() returned true.  Expected false", line);
         failed = true;
-    } else if (UTF8Matcher != nullptr && (flags.indexOf((UChar)0x59) >= 0) &&   //  'Y' flag:  RequireEnd() == false
+    } else if (UTF8Matcher != nullptr && (flags.indexOf((char16_t)0x59) >= 0) &&   //  'Y' flag:  RequireEnd() == false
         UTF8Matcher->requireEnd() == true) {
         errln("Error at line %d: requireEnd() returned true.  Expected false (UTF8)", line);
         failed = true;
     }
 
-    if ((flags.indexOf((UChar)0x79) >= 0) &&   //  'y' flag:  RequireEnd() == true
+    if ((flags.indexOf((char16_t)0x79) >= 0) &&   //  'y' flag:  RequireEnd() == true
         matcher->requireEnd() == false) {
         errln("Error at line %d: requireEnd() returned false.  Expected true", line);
         failed = true;
-    } else if (UTF8Matcher != nullptr && (flags.indexOf((UChar)0x79) >= 0) &&   //  'Y' flag:  RequireEnd() == false
+    } else if (UTF8Matcher != nullptr && (flags.indexOf((char16_t)0x79) >= 0) &&   //  'Y' flag:  RequireEnd() == false
         UTF8Matcher->requireEnd() == false) {
         errln("Error at line %d: requireEnd() returned false.  Expected true (UTF8)", line);
         failed = true;
     }
 
-    if ((flags.indexOf((UChar)0x5A) >= 0) &&   //  'Z' flag:  hitEnd() == false
+    if ((flags.indexOf((char16_t)0x5A) >= 0) &&   //  'Z' flag:  hitEnd() == false
         matcher->hitEnd() == true) {
         errln("Error at line %d: hitEnd() returned true.  Expected false", line);
         failed = true;
-    } else if (UTF8Matcher != nullptr && (flags.indexOf((UChar)0x5A) >= 0) &&   //  'Z' flag:  hitEnd() == false
+    } else if (UTF8Matcher != nullptr && (flags.indexOf((char16_t)0x5A) >= 0) &&   //  'Z' flag:  hitEnd() == false
                UTF8Matcher->hitEnd() == true) {
         errln("Error at line %d: hitEnd() returned true.  Expected false (UTF8)", line);
         failed = true;
     }
 
-    if ((flags.indexOf((UChar)0x7A) >= 0) &&   //  'z' flag:  hitEnd() == true
+    if ((flags.indexOf((char16_t)0x7A) >= 0) &&   //  'z' flag:  hitEnd() == true
         matcher->hitEnd() == false) {
         errln("Error at line %d: hitEnd() returned false.  Expected true", line);
         failed = true;
-    } else if (UTF8Matcher != nullptr && (flags.indexOf((UChar)0x7A) >= 0) &&   //  'z' flag:  hitEnd() == true
+    } else if (UTF8Matcher != nullptr && (flags.indexOf((char16_t)0x7A) >= 0) &&   //  'z' flag:  hitEnd() == true
                UTF8Matcher->hitEnd() == false) {
         errln("Error at line %d: hitEnd() returned false.  Expected true (UTF8)", line);
         failed = true;
@@ -3924,7 +3924,7 @@ void RegexTest::PerlTests() {
     }
 
     int32_t    len;
-    UChar *testData = ReadAndConvertFile(srcPath, len, "iso-8859-1", status);
+    char16_t *testData = ReadAndConvertFile(srcPath, len, "iso-8859-1", status);
     if (U_FAILURE(status)) {
         return; /* something went wrong, error already output */
     }
@@ -4016,11 +4016,11 @@ void RegexTest::PerlTests() {
             return;
         }
         int32_t flags = 0;
-        const UChar UChar_c = 0x63;  // Char constants for the flag letters.
-        const UChar UChar_i = 0x69;  //   (Damn the lack of Unicode support in C)
-        const UChar UChar_m = 0x6d;
-        const UChar UChar_x = 0x78;
-        const UChar UChar_y = 0x79;
+        const char16_t UChar_c = 0x63;  // Char constants for the flag letters.
+        const char16_t UChar_i = 0x69;  //   (Damn the lack of Unicode support in C)
+        const char16_t UChar_m = 0x6d;
+        const char16_t UChar_x = 0x78;
+        const char16_t UChar_y = 0x79;
         if (flagStr.indexOf(UChar_i) != -1) {
             flags |= UREGEX_CASE_INSENSITIVE;
         }
@@ -4195,7 +4195,7 @@ void RegexTest::PerlTests() {
                 if (perlExpr.length() > 1) {
                     perlExpr.remove(0, 1);  // Remove the '\', but only if not last char.
                 }
-                UChar c = perlExpr.charAt(0);
+                char16_t c = perlExpr.charAt(0);
                 switch (c) {
                 case 'n':   c = '\n'; break;
                 // add any other escape sequences that show up in the test expected results.
@@ -4295,7 +4295,7 @@ void RegexTest::PerlTestsUTF8() {
     }
 
     int32_t    len;
-    UChar *testData = ReadAndConvertFile(srcPath, len, "iso-8859-1", status);
+    char16_t *testData = ReadAndConvertFile(srcPath, len, "iso-8859-1", status);
     if (U_FAILURE(status)) {
         return; /* something went wrong, error already output */
     }
@@ -4387,11 +4387,11 @@ void RegexTest::PerlTestsUTF8() {
             return;
         }
         int32_t flags = 0;
-        const UChar UChar_c = 0x63;  // Char constants for the flag letters.
-        const UChar UChar_i = 0x69;  //   (Damn the lack of Unicode support in C)
-        const UChar UChar_m = 0x6d;
-        const UChar UChar_x = 0x78;
-        const UChar UChar_y = 0x79;
+        const char16_t UChar_c = 0x63;  // Char constants for the flag letters.
+        const char16_t UChar_i = 0x69;  //   (Damn the lack of Unicode support in C)
+        const char16_t UChar_m = 0x6d;
+        const char16_t UChar_x = 0x78;
+        const char16_t UChar_y = 0x79;
         if (flagStr.indexOf(UChar_i) != -1) {
             flags |= UREGEX_CASE_INSENSITIVE;
         }
@@ -4585,7 +4585,7 @@ void RegexTest::PerlTestsUTF8() {
                 if (perlExpr.length() > 1) {
                     perlExpr.remove(0, 1);  // Remove the '\', but only if not last char.
                 }
-                UChar c = perlExpr.charAt(0);
+                char16_t c = perlExpr.charAt(0);
                 switch (c) {
                 case 'n':   c = '\n'; break;
                 // add any other escape sequences that show up in the test expected results.
@@ -4916,7 +4916,7 @@ void RegexTest::PreAllocatedUTextCAPI () {
     {
         UText  text1 = UTEXT_INITIALIZER;
         UText  text2 = UTEXT_INITIALIZER;
-        UChar  text2Chars[20];
+        char16_t  text2Chars[20];
         UText  *resultText;
 
         status = U_ZERO_ERROR;
@@ -4944,7 +4944,7 @@ void RegexTest::PreAllocatedUTextCAPI () {
         utext_setNativeIndex(&text1, 0);
         REGEX_ASSERT(testUTextEqual(resultText, &text1));
 
-        /* Then set a UChar * */
+        /* Then set a char16_t * */
         uregex_setText(re, text2Chars, 7, &status);
         resultText = uregex_getUText(re, &bufferText, &status);
         REGEX_CHECK_STATUS;
@@ -4962,7 +4962,7 @@ void RegexTest::PreAllocatedUTextCAPI () {
      *  group()
      */
     {
-        UChar    text1[80];
+        char16_t text1[80];
         UText   *actual;
         UBool    result;
         int64_t  length = 0;
@@ -5010,8 +5010,8 @@ void RegexTest::PreAllocatedUTextCAPI () {
      *  replaceFirst()
      */
     {
-        UChar    text1[80];
-        UChar    text2[80];
+        char16_t text1[80];
+        char16_t text2[80];
         UText    replText = UTEXT_INITIALIZER;
         UText   *result;
         status = U_ZERO_ERROR;
@@ -5061,8 +5061,8 @@ void RegexTest::PreAllocatedUTextCAPI () {
      *  replaceAll()
      */
     {
-        UChar    text1[80];
-        UChar    text2[80];
+        char16_t text1[80];
+        char16_t text2[80];
         UText    replText = UTEXT_INITIALIZER;
         UText   *result;
 
@@ -5240,7 +5240,7 @@ void RegexTest::NamedCapture() {
     uregex_setText(re, text.getBuffer(), text.length(), &status);
     REGEX_CHECK_STATUS;
 
-    UChar resultBuf[100];
+    char16_t resultBuf[100];
     int32_t resultLength;
     UnicodeString repl;
 
@@ -5520,7 +5520,7 @@ void RegexTest::Bug10459() {
     //   was causing a segfault. Only for Regular Expressions created from UText.
     //   It should set an U_REGEX_INVALID_STATE.
 
-    UChar buf[100];
+    char16_t buf[100];
     int32_t len = uregex_group(icu_re, 0, buf, UPRV_LENGTHOF(buf), &status);
     REGEX_ASSERT(status == U_REGEX_INVALID_STATE);
     REGEX_ASSERT(len == 0);
@@ -5586,7 +5586,7 @@ void RegexTest::TestCase11049(const char *pattern, const char *data, UBool expec
     LocalPointer<RegexPattern> compiledPat(RegexPattern::compile(patternString, 0, status));
 
     UnicodeString dataString = UnicodeString(data).unescape();
-    UChar *exactBuffer = new UChar[dataString.length()];
+    char16_t *exactBuffer = new char16_t[dataString.length()];
     dataString.extract(exactBuffer, dataString.length(), status);
     UText *ut = utext_openUChars(nullptr, exactBuffer, dataString.length(), &status);
 
@@ -5677,7 +5677,7 @@ void RegexTest::TestBug11480() {
     uregex_setText(re, text.getBuffer(), text.length(), &status);
     REGEX_CHECK_STATUS;
     REGEX_ASSERT(uregex_lookingAt(re, 0, &status));
-    UChar buf[10] = {(UChar)13, (UChar)13, (UChar)13, (UChar)13};
+    char16_t buf[10] = {(char16_t)13, (char16_t)13, (char16_t)13, (char16_t)13};
     int32_t length = uregex_group(re, 2, buf+1, UPRV_LENGTHOF(buf)-1, &status);
     REGEX_ASSERT(length == 0);
     REGEX_ASSERT(buf[0] == 13);
@@ -5751,15 +5751,15 @@ void RegexTest::TestBug12884() {
 //            The failure is seen when running this test with Clang's Address Sanitizer.
 
 void RegexTest::TestBug13631() {
-    const UChar *pats[] = { u"(?<!^)",
+    const char16_t *pats[] = { u"(?<!^)",
                             u"(?<=^)",
                             nullptr
                           };
-    for (const UChar **pat=pats; *pat; ++pat) {
+    for (const char16_t **pat=pats; *pat; ++pat) {
         UErrorCode status = U_ZERO_ERROR;
         UnicodeString upat(*pat);
         RegexMatcher matcher(upat, 0, status);
-        const UChar s =u'a';
+        const char16_t s =u'a';
         UText *ut = utext_openUChars(nullptr, &s, 1, &status);
         REGEX_CHECK_STATUS;
         matcher.reset(ut);
index dac370fca31a0f3dc3fa6b6b7523881dd22b4feb..dd9f1303ec1feac788b19992303a0ee88c1e4373 100644 (file)
@@ -42,9 +42,9 @@ class TestReplaceable : public Replaceable {
     UnicodeString chars;
     UnicodeString styles;
     
-    static const UChar NO_STYLE;
+    static const char16_t NO_STYLE;
 
-    static const UChar NO_STYLE_MARK;
+    static const char16_t NO_STYLE_MARK;
 
     /**
      * The address of this static class variable serves as this class's ID
@@ -64,7 +64,7 @@ public:
                 if (text.charAt(i) == NO_STYLE_MARK) {
                     s.append(NO_STYLE);
                 } else {
-                    s.append((UChar)(i + 0x0031));
+                    s.append((char16_t)(i + 0x0031));
                 }
             }
         }
@@ -112,7 +112,7 @@ protected:
         return chars.length();
     }
 
-    virtual UChar getCharAt(int32_t offset) const override {
+    virtual char16_t getCharAt(int32_t offset) const override {
         return chars.charAt(offset);
     }
 
@@ -121,7 +121,7 @@ protected:
     }
 
     void fixStyles(int32_t start, int32_t limit, int32_t newLen) {
-        UChar newStyle = NO_STYLE;
+        char16_t newStyle = NO_STYLE;
         if (start != limit && styles.charAt(start) != NO_STYLE) {
             newStyle = styles.charAt(start);
         } else if (start > 0 && getCharAt(start-1) != NO_STYLE_MARK) {
@@ -161,9 +161,9 @@ protected:
 
 const char TestReplaceable::fgClassID=0;
 
-const UChar TestReplaceable::NO_STYLE  = 0x005F;
+const char16_t TestReplaceable::NO_STYLE  = 0x005F;
 
-const UChar TestReplaceable::NO_STYLE_MARK = 0xFFFF;
+const char16_t TestReplaceable::NO_STYLE_MARK = 0xFFFF;
 
 void
 ReplaceableTest::runIndexedTest(int32_t index, UBool exec,
@@ -183,7 +183,7 @@ public:
         return 0;
     }
 
-    virtual UChar getCharAt(int32_t /*offset*/) const override {
+    virtual char16_t getCharAt(int32_t /*offset*/) const override {
         return 0xffff;
     }
 
@@ -213,7 +213,7 @@ private:
 const char NoopReplaceable::fgClassID=0;
 
 void ReplaceableTest::TestReplaceableClass(void) {
-    UChar rawTestArray[][6] = {
+    char16_t rawTestArray[][6] = {
         {0x0041, 0x0042, 0x0043, 0x0044, 0x0000, 0x0000}, // ABCD
         {0x0061, 0x0062, 0x0063, 0x0064, 0x00DF, 0x0000}, // abcd\u00DF
         {0x0061, 0x0042, 0x0043, 0x0044, 0x0000, 0x0000}, // aBCD
index 2891e7963cfd18cd1d3a47634e72000cca8d98eb..62f98bd7ed2b35d3572ed2f7fe99cd8880842afd 100644 (file)
@@ -22,7 +22,7 @@
 
 //***************************************************************************************
 
-static const UChar kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 };
+static const char16_t kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 };
 static const int32_t kErrorLength = 5;
 
 //***************************************************************************************
@@ -523,7 +523,7 @@ ResourceBundleTest::TestExemplar(){
         UResourceBundle *resb =ures_open(nullptr,locale,&status);
         if(U_SUCCESS(status) && status!=U_USING_FALLBACK_WARNING && status!=U_USING_DEFAULT_WARNING){
             int32_t len=0;
-            const UChar* strSet = ures_getStringByKey(resb,"ExemplarCharacters",&len,&status);
+            const char16_t* strSet = ures_getStringByKey(resb,"ExemplarCharacters",&len,&status);
             UnicodeSet set(strSet,status);
             if(U_FAILURE(status)){
                 errln("Could not construct UnicodeSet from pattern for ExemplarCharacters in locale : %s. Error: %s",locale,u_errorName(status));
index fe7f1e3719995e45a6f6148e8becbe1dec6cb153..7556692136b82c5860f368a5d752d9164c1ec641 100644 (file)
@@ -55,7 +55,7 @@ void NewResourceBundleTest::runIndexedTest( int32_t index, UBool exec, const cha
 
 //***************************************************************************************
 
-static const UChar kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 };
+static const char16_t kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 };
 static const int32_t kErrorLength = 5;
 static const int32_t kERROR_COUNT = -1234567;
 
@@ -1077,9 +1077,9 @@ NewResourceBundleTest::TestNewTypes() {
     int32_t i = 0;
     int32_t intResult = 0;
     uint32_t uintResult = 0;
-    UChar expected[] = { 'a','b','c','\0','d','e','f' };
+    char16_t expected[] = { 'a','b','c','\0','d','e','f' };
     const char* expect ="tab:\t cr:\r ff:\f newline:\n backslash:\\\\ quote=\\\' doubleQuote=\\\" singlequoutes=''";
-    UChar uExpect[200];
+    char16_t uExpect[200];
 
     testdatapath=loadTestData(status);
 
index b215302673526e98c34b510e3293369e4765c253..8b001dc18fbe54df38520960e815d707f14200c6 100644 (file)
@@ -28,7 +28,7 @@ SimpleFwdCharIterator::SimpleFwdCharIterator(const UnicodeString& s) {
 
     fHashCode = kInvalidHashCode;
     fLen = s.length();
-    fStart = new UChar[fLen];
+    fStart = new char16_t[fLen];
     if(fStart == nullptr) {
         fBogus = true;
     } else {
@@ -41,14 +41,14 @@ SimpleFwdCharIterator::SimpleFwdCharIterator(const UnicodeString& s) {
 }
 #endif
 
-SimpleFwdCharIterator::SimpleFwdCharIterator(UChar *s, int32_t len, UBool adopt) {
+SimpleFwdCharIterator::SimpleFwdCharIterator(char16_t *s, int32_t len, UBool adopt) {
 
     fHashCode = kInvalidHashCode;
 
     fLen = len==-1 ? u_strlen(s) : len;
 
     if(adopt == false) {
-        fStart = new UChar[fLen];
+        fStart = new char16_t[fLen];
         if(fStart == nullptr) {
             fBogus = true;
         } else {
@@ -105,7 +105,7 @@ UClassID SimpleFwdCharIterator::getDynamicClassID(void) const {
     return nullptr;
 }
 
-UChar SimpleFwdCharIterator::nextPostInc(void) {
+char16_t SimpleFwdCharIterator::nextPostInc(void) {
     if(fCurrent == fEnd) {
         return ForwardCharacterIterator::DONE;
     } else {
index 9d9831e2592203d4b95dcf21c19120a11a786501..25830208b747af22dd80390df9b35f8514e6650e 100644 (file)
@@ -15,7 +15,7 @@
 class SimpleFwdCharIterator : public ForwardCharacterIterator {
 public:
     // not used -- SimpleFwdCharIterator(const UnicodeString& s);
-    SimpleFwdCharIterator(UChar *s, int32_t len, UBool adopt = false);
+    SimpleFwdCharIterator(char16_t *s, int32_t len, UBool adopt = false);
 
     virtual ~SimpleFwdCharIterator();
 
@@ -43,7 +43,7 @@ public:
    * (toward endIndex()).  If there are
    * no more code units to return, returns DONE.
    */
-  virtual UChar         nextPostInc(void) override;
+  virtual char16_t      nextPostInc(void) override;
         
   /**
    * Gets the current code point for returning and advances to the next code point
@@ -70,7 +70,7 @@ private:
     static const int32_t            kInvalidHashCode;
     static const int32_t            kEmptyHashCode;
 
-    UChar *fStart, *fEnd, *fCurrent;
+    char16_t *fStart, *fEnd, *fCurrent;
     int32_t fLen;
     UBool fBogus;
     int32_t fHashCode;
index b1cc884cb1cf482435d11028e7307f145758edc6..67fb29f84a226b6e1e590611981933ef0df14cf8 100644 (file)
@@ -68,7 +68,7 @@ StringSearchTest::StringSearchTest()
     
     UnicodeString rules;
     rules.setTo(((RuleBasedCollator *)m_de_)->getRules());
-    UChar extrarules[128];
+    char16_t extrarules[128];
     u_unescape(EXTRACOLLATIONRULE, extrarules, 128);
     rules.append(extrarules, u_strlen(extrarules));
     delete m_de_;
@@ -224,7 +224,7 @@ char * StringSearchTest::toCharString(const UnicodeString &text)
            int    length = text.length();
 
     for (; count < length; count ++) {
-        UChar ch = text[count];
+        char16_t ch = text[count];
         if (ch >= 0x20 && ch <= 0x7e) {
             result[index ++] = (char)ch;
         }
@@ -467,7 +467,7 @@ UBool StringSearchTest::assertEqual(const SearchData *search)
     Collator      *collator = getCollator(search->collator);
     BreakIterator *breaker  = getBreakIterator(search->breaker);
     StringSearch  *strsrch, *strsrch2;
-    UChar          temp[128];
+    char16_t       temp[128];
     
 #if UCONFIG_NO_BREAK_ITERATION
     if(search->breaker) {
@@ -524,7 +524,7 @@ UBool StringSearchTest::assertCanonicalEqual(const SearchData *search)
     Collator      *collator = getCollator(search->collator);
     BreakIterator *breaker  = getBreakIterator(search->breaker);
     StringSearch  *strsrch; 
-    UChar          temp[128];
+    char16_t       temp[128];
     UBool          result = true;
     
 #if UCONFIG_NO_BREAK_ITERATION
@@ -577,7 +577,7 @@ UBool StringSearchTest::assertEqualWithAttribute(const SearchData *search,
     Collator      *collator = getCollator(search->collator);
     BreakIterator *breaker  = getBreakIterator(search->breaker);
     StringSearch  *strsrch; 
-    UChar          temp[128];
+    char16_t       temp[128];
     
 
 #if UCONFIG_NO_BREAK_ITERATION
@@ -870,7 +870,7 @@ void StringSearchTest::TestStrength()
 
 void StringSearchTest::TestBreakIterator()
 {
-    UChar temp[128];
+    char16_t temp[128];
     u_unescape(BREAKITERATOREXACT[0].text, temp, 128);
     UnicodeString text;
     text.setTo(temp, u_strlen(temp));
@@ -1003,7 +1003,7 @@ void StringSearchTest::TestOverlap()
     count = 0;
     while (count < 1) {
         const SearchData *search = &(OVERLAP[count]);     
-              UChar       temp[128];
+              char16_t    temp[128];
         u_unescape(search->text, temp, 128);
         UnicodeString text;
         text.setTo(temp, u_strlen(temp));
@@ -1047,7 +1047,7 @@ void StringSearchTest::TestOverlap()
 void StringSearchTest::TestCollator()
 {
     // test collator that thinks "o" and "p" are the same thing
-    UChar         temp[128];
+    char16_t      temp[128];
     u_unescape(COLLATOR[0].text, temp, 128);
     UnicodeString text;
     text.setTo(temp, u_strlen(temp));
@@ -1111,7 +1111,7 @@ void StringSearchTest::TestCollator()
 void StringSearchTest::TestPattern()
 {
           
-    UChar temp[512];
+    char16_t temp[512];
     int templength;
     u_unescape(PATTERN[0].text, temp, 512);
     UnicodeString text;
@@ -1207,7 +1207,7 @@ void StringSearchTest::TestPattern()
  
 void StringSearchTest::TestText()
 {
-    UChar temp[128];
+    char16_t temp[128];
     u_unescape(TEXT[0].text, temp, 128);
     UnicodeString text;
     text.setTo(temp, u_strlen(temp));
@@ -1296,7 +1296,7 @@ void StringSearchTest::TestGetSetOffset()
     while (BASIC[index].text != nullptr) {
         UErrorCode  status      = U_ZERO_ERROR;
         SearchData  search      = BASIC[index ++];
-        UChar       temp[128];
+        char16_t    temp[128];
     
         u_unescape(search.text, temp, 128);
         text.setTo(temp, u_strlen(temp));
@@ -1417,7 +1417,7 @@ void StringSearchTest::TestGetSetAttribute()
  
 void StringSearchTest::TestGetMatch()
 {
-    UChar      temp[128];
+    char16_t   temp[128];
     SearchData search = MATCH[0];
     u_unescape(search.text, temp, 128);
     UnicodeString text;
@@ -1481,7 +1481,7 @@ void StringSearchTest::TestSetMatch()
     int count = 0;
     while (MATCH[count].text != nullptr) {
         SearchData     search = MATCH[count];
-        UChar          temp[128];
+        char16_t       temp[128];
         UErrorCode status = U_ZERO_ERROR;
         u_unescape(search.text, temp, 128);
         UnicodeString text;
@@ -1595,7 +1595,7 @@ void StringSearchTest::TestSupplementary()
  
 void StringSearchTest::TestContraction()
 {
-    UChar      temp[128];
+    char16_t   temp[128];
     UErrorCode status = U_ZERO_ERROR;
     
     u_unescape(CONTRACTIONRULE, temp, 128);
@@ -1633,7 +1633,7 @@ void StringSearchTest::TestContraction()
     
 void StringSearchTest::TestIgnorable()
 {
-    UChar temp[128];
+    char16_t temp[128];
     u_unescape(IGNORABLERULE, temp, 128);
     UnicodeString rules;
     rules.setTo(temp, u_strlen(temp));
@@ -1674,7 +1674,7 @@ void StringSearchTest::TestIgnorable()
 
 void StringSearchTest::TestDiacriticMatch()
 {
-       UChar temp[128];
+       char16_t temp[128];
     UErrorCode status = U_ZERO_ERROR;
     int        count  = 0;
     RuleBasedCollator* coll = nullptr;
@@ -1754,7 +1754,7 @@ void StringSearchTest::TestBreakIteratorCanonical()
 
     while (count < 4) {
         // special purposes for tests numbers 0-3
-              UChar           temp[128];
+              char16_t        temp[128];
         const SearchData     *search   = &(BREAKITERATORCANONICAL[count]);     
     
         u_unescape(search->text, temp, 128);
@@ -1859,7 +1859,7 @@ void StringSearchTest::TestOverlapCanonical()
 
     count = 0;
     while (count < 1) {
-              UChar       temp[128];
+              char16_t    temp[128];
         const SearchData *search = &(OVERLAPCANONICAL[count]);     
               UErrorCode  status = U_ZERO_ERROR;
     
@@ -1902,7 +1902,7 @@ void StringSearchTest::TestOverlapCanonical()
 void StringSearchTest::TestCollatorCanonical()
 {
     /* test collator that thinks "o" and "p" are the same thing */
-    UChar temp[128];
+    char16_t temp[128];
     u_unescape(COLLATORCANONICAL[0].text, temp, 128);
     UnicodeString text;
     text.setTo(temp, u_strlen(temp));
@@ -1964,7 +1964,7 @@ void StringSearchTest::TestCollatorCanonical()
 void StringSearchTest::TestPatternCanonical()
 {
     
-    UChar temp[128];
+    char16_t temp[128];
     
     u_unescape(PATTERNCANONICAL[0].text, temp, 128);
     UnicodeString text;
@@ -2031,7 +2031,7 @@ ENDTESTPATTERN:
     
 void StringSearchTest::TestTextCanonical()
 {
-    UChar temp[128];
+    char16_t temp[128];
     u_unescape(TEXTCANONICAL[0].text, temp, 128);
     UnicodeString text;
     text.setTo(temp, u_strlen(temp));
@@ -2123,7 +2123,7 @@ void StringSearchTest::TestGetSetOffsetCanonical()
         errln("Error expecting set offset error");
     }
     int   index   = 0;
-    UChar temp[128];
+    char16_t temp[128];
     while (BASICCANONICAL[index].text != nullptr) {
         SearchData  search      = BASICCANONICAL[index ++];
         if (BASICCANONICAL[index].text == nullptr) {
@@ -2199,7 +2199,7 @@ void StringSearchTest::TestSupplementaryCanonical()
     
 void StringSearchTest::TestContractionCanonical()
 {
-    UChar          temp[128];
+    char16_t       temp[128];
     
     u_unescape(CONTRACTIONRULE, temp, 128);
     UnicodeString rules;
index 58aa83246a76dd32de9488c938c11f82a7932b78..a583ab48d6e44f5816559f2e7402b80be4f230dd 100644 (file)
@@ -1077,7 +1077,7 @@ void StringSetMonkey::append(UnicodeString &testCase, UnicodeString &alternate)
     int32_t itemCount = uset_getItemCount(set), len = 0;
     int32_t index = m_rand() % itemCount;
     UChar32 rangeStart = 0, rangeEnd = 0;
-    UChar buffer[16];
+    char16_t buffer[16];
     UErrorCode err = U_ZERO_ERROR;
 
     len = uset_getItem(set, index, &rangeStart, &rangeEnd, buffer, 16, &err);
index 930e27268dc8d1edf98d64c915ee9b4ffe62db32..af220d316cbf233c06b3f7a70998f936f3e4e66d 100644 (file)
@@ -125,21 +125,21 @@ StringCaseTest::runIndexedTest(int32_t index, UBool exec, const char *&name, cha
 void
 StringCaseTest::TestCaseConversion()
 {
-    static const UChar uppercaseGreek[] =
+    static const char16_t uppercaseGreek[] =
         { 0x399, 0x395, 0x3a3, 0x3a5, 0x3a3, 0x20, 0x03a7, 0x3a1, 0x399, 0x3a3, 0x3a4,
         0x39f, 0x3a3, 0 };
         // "IESUS CHRISTOS"
 
-    static const UChar lowercaseGreek[] = 
+    static const char16_t lowercaseGreek[] =
         { 0x3b9, 0x3b5, 0x3c3, 0x3c5, 0x3c2, 0x20, 0x03c7, 0x3c1, 0x3b9, 0x3c3, 0x3c4,
         0x3bf, 0x3c2, 0 };
         // "iesus christos"
 
-    static const UChar lowercaseTurkish[] = 
+    static const char16_t lowercaseTurkish[] =
         { 0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x2c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 
         0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x0131, 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x21, 0 };
 
-    static const UChar uppercaseTurkish[] = 
+    static const char16_t uppercaseTurkish[] =
         { 0x54, 0x4f, 0x50, 0x4b, 0x41, 0x50, 0x49, 0x20, 0x50, 0x41, 0x4c, 0x41, 0x43, 0x45, 0x2c, 0x20,
         0x0130, 0x53, 0x54, 0x41, 0x4e, 0x42, 0x55, 0x4c, 0 };
     
@@ -200,7 +200,7 @@ StringCaseTest::TestCaseConversion()
 
     // more string case mapping tests with the new implementation
     {
-        static const UChar
+        static const char16_t
 
         beforeLower[]= { 0x61, 0x42, 0x49,  0x3a3, 0xdf, 0x3a3, 0x2f, 0xd93f, 0xdfff },
         lowerRoot[]=   { 0x61, 0x62, 0x69,  0x3c3, 0xdf, 0x3c2, 0x2f, 0xd93f, 0xdfff },
@@ -468,7 +468,7 @@ StringCaseTest::TestCasingImpl(const UnicodeString &input,
     // UTF-8
     char utf8In[100], utf8Out[100];
     int32_t utf8InLength, utf8OutLength, resultLength;
-    UChar *buffer;
+    char16_t *buffer;
 
     IcuTestErrorCode errorCode(*this, "TestCasingImpl");
     LocalUCaseMapPointer csm(ucasemap_open(localeID, options, errorCode));
@@ -567,7 +567,7 @@ StringCaseTest::TestCasing() {
                     } else if(type==-2) {
                         // Open a trivial break iterator that only delivers { 0, length }
                         // or even just { 0 } as boundaries.
-                        static const UChar rules[] = { 0x2e, 0x2a, 0x3b };  // ".*;"
+                        static const char16_t rules[] = { 0x2e, 0x2a, 0x3b };  // ".*;"
                         UParseError parseError;
                         iter.adoptInstead(ubrk_openRules(rules, UPRV_LENGTHOF(rules), nullptr, 0, &parseError, &status));
                     }
@@ -576,13 +576,13 @@ StringCaseTest::TestCasing() {
                 options = 0;
                 if(whichCase==TEST_TITLE || whichCase==TEST_FOLD) {
                     optionsString = myCase->getString("Options", status);
-                    if(optionsString.indexOf((UChar)0x54)>=0) {  // T
+                    if(optionsString.indexOf((char16_t)0x54)>=0) {  // T
                         options|=U_FOLD_CASE_EXCLUDE_SPECIAL_I;
                     }
-                    if(optionsString.indexOf((UChar)0x4c)>=0) {  // L
+                    if(optionsString.indexOf((char16_t)0x4c)>=0) {  // L
                         options|=U_TITLECASE_NO_LOWERCASE;
                     }
-                    if(optionsString.indexOf((UChar)0x41)>=0) {  // A
+                    if(optionsString.indexOf((char16_t)0x41)>=0) {  // A
                         options|=U_TITLECASE_NO_BREAK_ADJUSTMENT;
                     }
                 }
@@ -823,7 +823,7 @@ StringCaseTest::assertGreekUpper(const char16_t *s, const char16_t *expected) {
     };
     for (int32_t i = 0; i < UPRV_LENGTHOF(capacities); ++i) {
         int32_t cap = capacities[i];
-        UChar *dest16 = result16.getBuffer(expected16.length() + 1);
+        char16_t *dest16 = result16.getBuffer(expected16.length() + 1);
         u_memset(dest16, 0x55AA, result16.getCapacity());
         UErrorCode errorCode = U_ZERO_ERROR;
         length = u_strToUpper(dest16, cap, s16.getBuffer(), s16.length(), "el", &errorCode);
@@ -951,7 +951,7 @@ StringCaseTest::TestLongUpper() {
     int32_t length = 0x40000004;  // more than 1G UChars
     UnicodeString s(length, (UChar32)0x390, length);
     UnicodeString result;
-    UChar *dest = result.getBuffer(length + 1);
+    char16_t *dest = result.getBuffer(length + 1);
     if (s.isBogus() || dest == nullptr) {
         logln("Out of memory, unable to run this test on this machine.");
         return;
@@ -1354,7 +1354,7 @@ void StringCaseTest::TestMergeEdits() {
 
 void StringCaseTest::TestCaseMapWithEdits() {
     IcuTestErrorCode errorCode(*this, "TestCaseMapWithEdits");
-    UChar dest[20];
+    char16_t dest[20];
     Edits edits;
 
     int32_t length = CaseMap::toLower("tr", U_OMIT_UNCHANGED_TEXT,
@@ -1526,7 +1526,7 @@ void StringCaseTest::TestCaseMapToString() {
     // It is a bit of a misnomer until we have CaseMap API that writes to
     // a UnicodeString, at which point we should change this code here.
     IcuTestErrorCode errorCode(*this, "TestCaseMapToString");
-    UChar dest[20];
+    char16_t dest[20];
 
     // Omit unchanged text.
     int32_t length = CaseMap::toLower("tr", U_OMIT_UNCHANGED_TEXT,
@@ -1628,7 +1628,7 @@ void StringCaseTest::TestLongUnicodeString() {
     // Code coverage for UnicodeString case mapping code handling
     // long strings or many changes in a string.
     UnicodeString s(true,
-        (const UChar *)
+        (const char16_t *)
         u"aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeF"
         u"aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeF"
         u"aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeF"
@@ -1636,7 +1636,7 @@ void StringCaseTest::TestLongUnicodeString() {
         u"aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeF"
         u"aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeF", 6 * 51);
     UnicodeString expected(true,
-        (const UChar *)
+        (const char16_t *)
         u"AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEF"
         u"AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEF"
         u"AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEF"
index 47acf7911480a8ca28ba0737d173cca216ce4d12..1f292a899c6d1056ae6c9997d770989a6c544ca4 100644 (file)
@@ -78,8 +78,8 @@ void StringTest::TestSizeofTypes(void) {
     if(2!=sizeof(uint16_t)) {
         errln("2!=sizeof(uint16_t)");
     }
-    if(2!=sizeof(UChar)) {
-        errln("2!=sizeof(UChar)");
+    if(2!=sizeof(char16_t)) {
+        errln("2!=sizeof(char16_t)");
     }
     if(1!=sizeof(int8_t)) {
         errln("1!=sizeof(int8_t)");
index 0d7f6bb525c168510e57f1ff60c0a8da2f251fbc..04b2ee1c67833f9497eaae2ef1c01860401b76af 100644 (file)
@@ -155,7 +155,7 @@ void CollationServiceTest::TestRegister()
         UnicodeString displayName;
         Collator::getDisplayName(fu_FU, displayName);
         /* The locale display pattern for the locale ja, ko, and zh are different. */
-        const UChar zh_fuFU_Array[] = { 0x0066, 0x0075, 0xff08, 0x0046, 0x0055, 0xff09, 0 };
+        const char16_t zh_fuFU_Array[] = { 0x0066, 0x0075, 0xff08, 0x0046, 0x0055, 0xff09, 0 };
         const UnicodeString zh_fuFU(zh_fuFU_Array);
         const Locale& defaultLocale = Locale::getDefault();
         if (displayName != "fu (FU)" &&
@@ -519,7 +519,7 @@ int32_t CollationServiceTest::checkStringEnumeration(const char* msg,
     assertTrue("count verified", i==n);
     iter.reset(ec);
     for (;; ++idxAfterReset) {
-        const UChar *s = iter.unext(nullptr, ec);
+        const char16_t *s = iter.unext(nullptr, ec);
         if (!assertSuccess("unext", ec) || s == nullptr)
             break;
         if (idxAfterReset != 0)
index 7e3f2c84b64e358c07b44a9bc720d8798dcd1cdb..56854db106abe024e112be4b0993957d2fc5df2a 100644 (file)
@@ -265,7 +265,7 @@ static void
 testAllCodepoints(TestIDNA& test){
     /*
     {
-        UChar str[19] = {            
+        char16_t str[19] = {
                             0xC138, 0xACC4, 0xC758, 0xBAA8, 0xB4E0, 0xC0AC, 0xB78C, 0xB4E4, 0xC774,
                             0x070F,//prohibited
                             0xD55C, 0xAD6D, 0xC5B4, 0xB97C, 0xC774, 0xD574, 0xD55C, 0xB2E4, 0xBA74
@@ -385,8 +385,8 @@ compareMapping(uint32_t codepoint, uint32_t* mapping,int32_t mapLength,
                     pTestIDNA->errln("Did not get the expected result. Expected: 0x%04X Got: 0x%04X \n", mapping[i], mappingData[index+i]);
                 }
             }else{
-                UChar lead  = U16_LEAD(mapping[i]);
-                UChar trail = U16_TRAIL(mapping[i]);
+                char16_t lead  = U16_LEAD(mapping[i]);
+                char16_t trail = U16_TRAIL(mapping[i]);
                 if(mappingData[index+i] != lead ||
                     mappingData[index+i+1] != trail){
                     pTestIDNA->errln( "Did not get the expected result. Expected: 0x%04X 0x%04X  Got: 0x%04X 0x%04X", lead, trail, mappingData[index+i], mappingData[index+i+1]);
@@ -411,7 +411,7 @@ compareFlagsForRange(uint32_t start, uint32_t end,
     int32_t value=0;
 /*
     // supplementary code point 
-    UChar __lead16=U16_LEAD(0x2323E);
+    char16_t __lead16=U16_LEAD(0x2323E);
     int32_t __offset;
 
     // get data for lead surrogate 
index 758e43217cd8a9eabffa1b6858c90152dd9f8839..30a462c46c10011e80c945daf9cac27e37d6c24d 100644 (file)
@@ -36,7 +36,7 @@
 #include "unicode/putil.h"
 #include "idnaconf.h"
 
-static const UChar unicodeIn[][41] ={
+static const char16_t unicodeIn[][41] ={
     { 
         0x0644, 0x064A, 0x0647, 0x0645, 0x0627, 0x0628, 0x062A, 0x0643, 0x0644,
         0x0645, 0x0648, 0x0634, 0x0639, 0x0631, 0x0628, 0x064A, 0x061F, 0x0000
@@ -240,7 +240,7 @@ typedef struct ErrorCases ErrorCases;
 
 static const struct ErrorCases{
 
-    UChar unicode[100];
+    char16_t unicode[100];
     const char *ascii;
     UErrorCode expected;
     UBool useSTD3ASCIIRules;
@@ -416,21 +416,21 @@ static const struct ErrorCases{
 
 #define MAX_DEST_SIZE 300
 
-void TestIDNA::debug(const UChar* src, int32_t srcLength, int32_t options){
+void TestIDNA::debug(const char16_t* src, int32_t srcLength, int32_t options){
     UParseError parseError;
     UErrorCode transStatus = U_ZERO_ERROR;
     UErrorCode prepStatus  = U_ZERO_ERROR;
     NamePrepTransform* trans = NamePrepTransform::createInstance(parseError,transStatus);
     int32_t prepOptions = (((options & UIDNA_ALLOW_UNASSIGNED) != 0) ? USPREP_ALLOW_UNASSIGNED: 0);
     LocalUStringPrepProfilePointer prep(usprep_openByType(USPREP_RFC3491_NAMEPREP,&prepStatus));
-    UChar *transOut=nullptr, *prepOut=nullptr;
+    char16_t *transOut=nullptr, *prepOut=nullptr;
     int32_t transOutLength=0, prepOutLength=0;
     
     
     transOutLength  = trans->process(src,srcLength,transOut, 0, prepOptions>0, &parseError, transStatus);
     if( transStatus == U_BUFFER_OVERFLOW_ERROR){
         transStatus = U_ZERO_ERROR;
-        transOut    = (UChar*) malloc(U_SIZEOF_UCHAR * transOutLength);
+        transOut    = (char16_t*) malloc(U_SIZEOF_UCHAR * transOutLength);
         transOutLength = trans->process(src,srcLength,transOut, transOutLength, prepOptions>0, &parseError, transStatus);
     }
 
@@ -438,7 +438,7 @@ void TestIDNA::debug(const UChar* src, int32_t srcLength, int32_t options){
 
     if( prepStatus == U_BUFFER_OVERFLOW_ERROR){
         prepStatus = U_ZERO_ERROR;
-        prepOut    = (UChar*) malloc(U_SIZEOF_UCHAR * prepOutLength);
+        prepOut    = (char16_t*) malloc(U_SIZEOF_UCHAR * prepOutLength);
         prepOutLength  = usprep_prepare(prep.getAlias(), src, srcLength, prepOut, prepOutLength, prepOptions, &parseError, &prepStatus);
     }
 
@@ -451,23 +451,23 @@ void TestIDNA::debug(const UChar* src, int32_t srcLength, int32_t options){
     delete trans;
 }
 
-void TestIDNA::testAPI(const UChar* src, const UChar* expected, const char* testName, 
+void TestIDNA::testAPI(const char16_t* src, const char16_t* expected, const char* testName,
             UBool useSTD3ASCIIRules,UErrorCode expectedStatus,
             UBool doCompare, UBool testUnassigned, TestFunc func, UBool testSTD3ASCIIRules){
 
     UErrorCode status = U_ZERO_ERROR;
-    UChar destStack[MAX_DEST_SIZE];
+    char16_t destStack[MAX_DEST_SIZE];
     int32_t destLen = 0;
-    UChar* dest = nullptr;
+    char16_t* dest = nullptr;
     int32_t expectedLen = (expected != nullptr) ? u_strlen(expected) : 0;
     int32_t options = (useSTD3ASCIIRules == true) ? UIDNA_USE_STD3_RULES : UIDNA_DEFAULT;
     UParseError parseError;
     int32_t tSrcLen = 0; 
-    UChar* tSrc = nullptr; 
+    char16_t* tSrc = nullptr;
 
     if(src != nullptr){
         tSrcLen = u_strlen(src);
-        tSrc  =(UChar*) malloc( U_SIZEOF_UCHAR * tSrcLen );
+        tSrc  =(char16_t*) malloc( U_SIZEOF_UCHAR * tSrcLen );
         memcpy(tSrc,src,tSrcLen * U_SIZEOF_UCHAR);
     }
 
@@ -651,8 +651,8 @@ void TestIDNA::testAPI(const UChar* src, const UChar* expected, const char* test
     free(tSrc);
 }
 
-void TestIDNA::testCompare(const UChar* s1, int32_t s1Len,
-                        const UChar* s2, int32_t s2Len,
+void TestIDNA::testCompare(const char16_t* s1, int32_t s1Len,
+                        const char16_t* s2, int32_t s2Len,
                         const char* testName, CompareFunc func,
                         UBool isEqual){
 
@@ -700,7 +700,7 @@ void TestIDNA::testCompare(const UChar* s1, int32_t s1Len,
 void TestIDNA::testToASCII(const char* testName, TestFunc func){
 
     int32_t i;
-    UChar buf[MAX_DEST_SIZE];
+    char16_t buf[MAX_DEST_SIZE];
 
     for(i=0;i< UPRV_LENGTHOF(unicodeIn); i++){
         u_charsToUChars(asciiIn[i],buf, (int32_t)(strlen(asciiIn[i])+1));
@@ -712,7 +712,7 @@ void TestIDNA::testToASCII(const char* testName, TestFunc func){
 void TestIDNA::testToUnicode(const char* testName, TestFunc func){
 
     int32_t i;
-    UChar buf[MAX_DEST_SIZE];
+    char16_t buf[MAX_DEST_SIZE];
     
     for(i=0;i< UPRV_LENGTHOF(asciiIn); i++){
         u_charsToUChars(asciiIn[i],buf, (int32_t)(strlen(asciiIn[i])+1));
@@ -723,8 +723,8 @@ void TestIDNA::testToUnicode(const char* testName, TestFunc func){
 
 void TestIDNA::testIDNToUnicode(const char* testName, TestFunc func){
     int32_t i;
-    UChar buf[MAX_DEST_SIZE];
-    UChar expected[MAX_DEST_SIZE];
+    char16_t buf[MAX_DEST_SIZE];
+    char16_t expected[MAX_DEST_SIZE];
     UErrorCode status = U_ZERO_ERROR;
     int32_t bufLen = 0;
     UParseError parseError;
@@ -749,8 +749,8 @@ void TestIDNA::testIDNToUnicode(const char* testName, TestFunc func){
 
 void TestIDNA::testIDNToASCII(const char* testName, TestFunc func){
     int32_t i;
-    UChar buf[MAX_DEST_SIZE];
-    UChar expected[MAX_DEST_SIZE];
+    char16_t buf[MAX_DEST_SIZE];
+    char16_t expected[MAX_DEST_SIZE];
     UErrorCode status = U_ZERO_ERROR;
     int32_t bufLen = 0;
     UParseError parseError; 
@@ -777,27 +777,27 @@ void TestIDNA::testCompare(const char* testName, CompareFunc func){
     int32_t i;
 
 
-    UChar www[] = {0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
-    UChar com[] = {0x002E, 0x0043, 0x004F, 0x004D, 0x0000};
-    UChar buf[MAX_DEST_SIZE]={0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
+    char16_t www[] = {0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
+    char16_t com[] = {0x002E, 0x0043, 0x004F, 0x004D, 0x0000};
+    char16_t buf[MAX_DEST_SIZE]={0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
 
     UnicodeString source(www), uni0(www),uni1(www), ascii0(www), ascii1(www);
 
     uni0.append(unicodeIn[0]);
     uni0.append(com);
-    uni0.append((UChar)0x0000);
+    uni0.append((char16_t)0x0000);
 
     uni1.append(unicodeIn[1]);
     uni1.append(com);
-    uni1.append((UChar)0x0000);
+    uni1.append((char16_t)0x0000);
 
     ascii0.append(asciiIn[0]);
     ascii0.append(com);
-    ascii0.append((UChar)0x0000);
+    ascii0.append((char16_t)0x0000);
 
     ascii1.append(asciiIn[1]);
     ascii1.append(com);
-    ascii1.append((UChar)0x0000);
+    ascii1.append((char16_t)0x0000);
 
     for(i=0;i< UPRV_LENGTHOF(unicodeIn); i++){
 
@@ -809,9 +809,9 @@ void TestIDNA::testCompare(const char* testName, CompareFunc func){
         source.truncate(4);
         source.append(unicodeIn[i]);
         source.append(com);
-        source.append((UChar)0x0000);
+        source.append((char16_t)0x0000);
         // a) compare it with itself
-        const UChar* src = source.getBuffer();
+        const char16_t* src = source.getBuffer();
         int32_t srcLen = u_strlen(src); //subtract null
 
         testCompare(src,srcLen,src,srcLen,testName, func, true);
@@ -838,8 +838,8 @@ void TestIDNA::testCompare(const char* testName, CompareFunc func){
 #if 0
 
 static int32_t
-getNextSeperator(UChar *src,int32_t srcLength,
-                 UChar **limit){
+getNextSeperator(char16_t *src,int32_t srcLength,
+                 char16_t **limit){
     if(srcLength == -1){
         int32_t i;
         for(i=0 ; ;i++){
@@ -875,10 +875,10 @@ getNextSeperator(UChar *src,int32_t srcLength,
 
 void printPunycodeOutput(){
 
-    UChar dest[MAX_DEST_SIZE];
+    char16_t dest[MAX_DEST_SIZE];
     int32_t destCapacity=MAX_DEST_SIZE;
-    UChar* start;
-    UChar* limit;
+    char16_t* start;
+    char16_t* limit;
     int32_t labelLen=0;
     UBool caseFlags[MAX_DEST_SIZE];
     
@@ -905,12 +905,12 @@ void printPunycodeOutput(){
 
 void TestIDNA::testErrorCases(const char* IDNToASCIIName, TestFunc IDNToASCII,
                               const char* IDNToUnicodeName, TestFunc IDNToUnicode){
-    UChar buf[MAX_DEST_SIZE];
+    char16_t buf[MAX_DEST_SIZE];
     int32_t bufLen=0;
 
     for(int32_t i=0;i< UPRV_LENGTHOF(errorCases);i++){
         ErrorCases errorCase = errorCases[i];
-        UChar* src =nullptr;
+        char16_t* src =nullptr;
         if(errorCase.ascii != nullptr){
             bufLen =  (int32_t)strlen(errorCase.ascii);
             u_charsToUChars(errorCase.ascii,buf, bufLen+1);
@@ -945,9 +945,9 @@ void TestIDNA::testConformance(const char* toASCIIName, TestFunc toASCII,
                                const char* IDNToASCIIName, TestFunc IDNToASCII,
                                const char* IDNToUnicodeName, TestFunc IDNToUnicode,
                                const char* toUnicodeName, TestFunc toUnicode){
-    UChar src[MAX_DEST_SIZE];
+    char16_t src[MAX_DEST_SIZE];
     int32_t srcLen=0;
-    UChar expected[MAX_DEST_SIZE];
+    char16_t expected[MAX_DEST_SIZE];
     int32_t expectedLen = 0;
     for(int32_t i=0;i< UPRV_LENGTHOF(conformanceTestCases);i++){
         const char* utf8Chars1 = conformanceTestCases[i].in;
@@ -998,11 +998,11 @@ void TestIDNA::testConformance(const char* toASCIIName, TestFunc toASCII,
 */
 // test and ascertain
 // func(func(func(src))) == func(src)
-void TestIDNA::testChaining(const UChar* src,int32_t numIterations,const char* testName,
+void TestIDNA::testChaining(const char16_t* src,int32_t numIterations,const char* testName,
                   UBool useSTD3ASCIIRules, UBool caseInsensitive, TestFunc func){
-    UChar even[MAX_DEST_SIZE];
-    UChar odd[MAX_DEST_SIZE];
-    UChar expected[MAX_DEST_SIZE];
+    char16_t even[MAX_DEST_SIZE];
+    char16_t odd[MAX_DEST_SIZE];
+    char16_t expected[MAX_DEST_SIZE];
     int32_t i=0,evenLen=0,oddLen=0,expectedLen=0;
     UErrorCode status = U_ZERO_ERROR;
     int32_t srcLen = u_strlen(src);
@@ -1158,7 +1158,7 @@ void TestIDNA::testChaining(const UChar* src,int32_t numIterations,const char* t
 void TestIDNA::testChaining(const char* toASCIIName, TestFunc toASCII,
                   const char* toUnicodeName, TestFunc toUnicode){
     int32_t i;
-    UChar buf[MAX_DEST_SIZE];
+    char16_t buf[MAX_DEST_SIZE];
     
     for(i=0;i< UPRV_LENGTHOF(asciiIn); i++){
         u_charsToUChars(asciiIn[i],buf, (int32_t)(strlen(asciiIn[i])+1));
@@ -1176,27 +1176,27 @@ void TestIDNA::testRootLabelSeparator(const char* testName, CompareFunc func,
     int32_t i;
 
 
-    UChar www[] = {0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
-    UChar com[] = {0x002E, 0x0043, 0x004F, 0x004D, 0x002E, /* root label separator */0x0000};
-    UChar buf[MAX_DEST_SIZE]={0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
+    char16_t www[] = {0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
+    char16_t com[] = {0x002E, 0x0043, 0x004F, 0x004D, 0x002E, /* root label separator */0x0000};
+    char16_t buf[MAX_DEST_SIZE]={0x0057, 0x0057, 0x0057, 0x002E, 0x0000};
 
     UnicodeString source(www), uni0(www),uni1(www), ascii0(www), ascii1(www);
 
     uni0.append(unicodeIn[0]);
     uni0.append(com);
-    uni0.append((UChar)0x0000);
+    uni0.append((char16_t)0x0000);
 
     uni1.append(unicodeIn[1]);
     uni1.append(com);
-    uni1.append((UChar)0x0000);
+    uni1.append((char16_t)0x0000);
 
     ascii0.append(asciiIn[0]);
     ascii0.append(com);
-    ascii0.append((UChar)0x0000);
+    ascii0.append((char16_t)0x0000);
 
     ascii1.append(asciiIn[1]);
     ascii1.append(com);
-    ascii1.append((UChar)0x0000);
+    ascii1.append((char16_t)0x0000);
 
     for(i=0;i< UPRV_LENGTHOF(unicodeIn); i++){
 
@@ -1208,9 +1208,9 @@ void TestIDNA::testRootLabelSeparator(const char* testName, CompareFunc func,
         source.truncate(4);
         source.append(unicodeIn[i]);
         source.append(com);
-        source.append((UChar)0x0000);
+        source.append((char16_t)0x0000);
         
-        const UChar* src = source.getBuffer();
+        const char16_t* src = source.getBuffer();
         int32_t srcLen = u_strlen(src); //subtract null
         
         // b) compare it with asciiIn equivalent
@@ -1381,8 +1381,8 @@ UnicodeString TestIDNA::testCompareReferenceImpl(UnicodeString& src,
                                         TestFunc uIDNA, const char* uIDNAName,
                                         int32_t options){
   
-    const UChar* srcUChars = src.getBuffer();
-    UChar exp[MAX_DEST_SIZE]={0};
+    const char16_t* srcUChars = src.getBuffer();
+    char16_t exp[MAX_DEST_SIZE]={0};
     int32_t expCap = MAX_DEST_SIZE, expLen=0;
     UErrorCode expStatus = U_ZERO_ERROR;
     UParseError parseError;
@@ -1394,7 +1394,7 @@ UnicodeString TestIDNA::testCompareReferenceImpl(UnicodeString& src,
     expLen = refIDNA(srcUChars, src.length()-1, exp, expCap,
                       options, &parseError, &expStatus);
 
-    UChar got[MAX_DEST_SIZE]={0};
+    char16_t got[MAX_DEST_SIZE]={0};
     int32_t gotCap = MAX_DEST_SIZE, gotLen=0;
     UErrorCode gotStatus = U_ZERO_ERROR;
 
@@ -1433,9 +1433,9 @@ UnicodeString TestIDNA::testCompareReferenceImpl(UnicodeString& src,
     return UnicodeString("");
 }
 
-void TestIDNA::testCompareReferenceImpl(const UChar* src, int32_t srcLen){
+void TestIDNA::testCompareReferenceImpl(const char16_t* src, int32_t srcLen){
     UnicodeString label(src,srcLen);
-    label.append((UChar)0x0000);
+    label.append((char16_t)0x0000);
 
     //test idnaref_toASCII and idnare
     UnicodeString asciiLabel = testCompareReferenceImpl(label, 
@@ -1456,7 +1456,7 @@ void TestIDNA::testCompareReferenceImpl(const UChar* src, int32_t srcLen){
                               UIDNA_USE_STD3_RULES | UIDNA_ALLOW_UNASSIGNED);
 
     if(asciiLabel.length()!=0){
-        asciiLabel.append((UChar)0x0000);
+        asciiLabel.append((char16_t)0x0000);
 
         // test toUnciode
         testCompareReferenceImpl(asciiLabel, 
@@ -1497,8 +1497,8 @@ void TestIDNA::TestIDNAMonkeyTest(){
     for(i=0; i<loopCount; i++){
         source.truncate(0);
         getTestSource(source);
-        source.append((UChar)0x0000);
-        const UChar* src = source.getBuffer();
+        source.append((char16_t)0x0000);
+        const char16_t* src = source.getBuffer();
         testCompareReferenceImpl(src,source.length()-1);
         testCompareReferenceImpl(src,source.length()-1);
     }
@@ -1508,8 +1508,8 @@ void TestIDNA::TestIDNAMonkeyTest(){
         source.truncate(0);
         source.append( UnicodeString(failures[i], -1, US_INV) );
         source = source.unescape();
-        source.append((UChar)0x0000);
-        const UChar *src = source.getBuffer();
+        source.append((char16_t)0x0000);
+        const char16_t *src = source.getBuffer();
         testCompareReferenceImpl(src,source.length()-1);
         //debug(source.getBuffer(),source.length(),UIDNA_ALLOW_UNASSIGNED);
     }
@@ -1525,7 +1525,7 @@ void TestIDNA::TestIDNAMonkeyTest(){
         UnicodeString expected("\\u043f\\u043e\\u0447\\u0435\\u043c\\u0443\\u0436\\u0435\\u043e\\u043d\\u0438\\u043d\\u0435\\u0433\\u043e\\u0432\\u043e\\u0440\\u044f\\u0442\\u043f\\u043e\\u0440\\u0443\\u0441\\u0441\\u043a\\u0438\\u0000", -1, US_INV);
         expected = expected.unescape();
         UnicodeString ascii("xn--b1abfaaepdrnnbgefbadotcwatmq2g4l");
-        ascii.append((UChar)0x0000);
+        ascii.append((char16_t)0x0000);
         testAPI(source.getBuffer(),ascii.getBuffer(), "uidna_toASCII", false, U_ZERO_ERROR, true, true, uidna_toASCII);
         
         testAPI(source.getBuffer(),ascii.getBuffer(), "idnaref_toASCII", false, U_ZERO_ERROR, true, true, idnaref_toASCII);
@@ -1537,7 +1537,7 @@ void TestIDNA::TestIDNAMonkeyTest(){
 
 void TestIDNA::TestCompareReferenceImpl(){
 
-    UChar src [2] = {0,0};
+    char16_t src [2] = {0,0};
     int32_t srcLen = 0;
 
     // data even OK?
@@ -1563,7 +1563,7 @@ void TestIDNA::TestCompareReferenceImpl(){
             src[1] = U16_TRAIL(i);
             srcLen =2;
         } else {
-            src[0] = (UChar)i;
+            src[0] = (char16_t)i;
             src[1] = 0;
             srcLen = 1;
         }
index 202283714ce4a1026b69d736c6a7eb609625d8bd..023681f94fd4f155078fd708e84cbd9ae25588c9 100644 (file)
 
 U_CDECL_BEGIN
 typedef int32_t  
-(U_EXPORT2 *TestFunc) (   const UChar *src, int32_t srcLength,
-                UChar *dest, int32_t destCapacity,
+(U_EXPORT2 *TestFunc) (   const char16_t *src, int32_t srcLength,
+                char16_t *dest, int32_t destCapacity,
                 int32_t options, UParseError *parseError,
                 UErrorCode *status);
 typedef int32_t  
-(U_EXPORT2 *CompareFunc) (const UChar *s1, int32_t s1Len,
-                const UChar *s2, int32_t s2Len,
+(U_EXPORT2 *CompareFunc) (const char16_t *s1, int32_t s1Len,
+                const char16_t *s2, int32_t s2Len,
                 int32_t options,
                 UErrorCode *status);
 
@@ -79,28 +79,28 @@ private:
     void testCompare(const char* testName, CompareFunc func);
     void testChaining(const char* toASCIIName, TestFunc toASCII,
                     const char* toUnicodeName, TestFunc toUnicode);
-    void debug(const UChar* src, int32_t srcLength, int32_t options);
+    void debug(const char16_t* src, int32_t srcLength, int32_t options);
     // main testing functions
-    void testAPI(const UChar *src, const UChar *expected, const char *testName, 
+    void testAPI(const char16_t *src, const char16_t *expected, const char *testName,
              UBool useSTD3ASCIIRules, UErrorCode expectedStatus,
              UBool doCompare, UBool testUnassigned, TestFunc func, UBool testSTD3ASCIIRules=true);
 
-    void testCompare(const UChar* s1, int32_t s1Len,
-                        const UChar* s2, int32_t s2Len,
+    void testCompare(const char16_t* s1, int32_t s1Len,
+                        const char16_t* s2, int32_t s2Len,
                         const char* testName, CompareFunc func,
                         UBool isEqual);
 
     void testErrorCases(const char* IDNToASCIIName, TestFunc IDNToASCII,
                     const char* IDNToUnicodeName, TestFunc IDNToUnicode);
 
-    void testChaining(const UChar* src,int32_t numIterations,const char* testName,
+    void testChaining(const char16_t* src,int32_t numIterations,const char* testName,
                   UBool useSTD3ASCIIRules, UBool caseInsensitive, TestFunc func);
 
     void testRootLabelSeparator(const char* testName, CompareFunc func, 
                             const char* IDNToASCIIName, TestFunc IDNToASCII,
                             const char* IDNToUnicodeName, TestFunc IDNToUnicode);
 
-    void testCompareReferenceImpl(const UChar* src, int32_t srcLen);
+    void testCompareReferenceImpl(const char16_t* src, int32_t srcLen);
     
     UnicodeString testCompareReferenceImpl(UnicodeString& src, 
                                 TestFunc refIDNA, const char* refIDNAName,
index 5c5eeef0fb4bd7d384d48db6bf6379793a05b94f..ee4785d4fab8561cdb827cd3bfa8cc2d2c997342 100644 (file)
@@ -20,7 +20,7 @@
 #include "testutil.h"
 #include "intltest.h"
 
-static const UChar HEX[] = u"0123456789ABCDEF";
+static const char16_t HEX[] = u"0123456789ABCDEF";
 
 UnicodeString &TestUtility::appendHex(UnicodeString &buf, UChar32 ch) {
     if (ch >= 0x10000) {
@@ -46,7 +46,7 @@ UnicodeString TestUtility::hex(const UnicodeString& s) {
     return hex(s, u',');
 }
 
-UnicodeString TestUtility::hex(const UnicodeString& s, UChar sep) {
+UnicodeString TestUtility::hex(const UnicodeString& s, char16_t sep) {
     UnicodeString result;
     if (s.isEmpty()) return result;
     UChar32 c;
index 6d997a78f42bca4cd6cc1c3f6827e2a6f5789afc..72bfc600b5ef277e096884d71fa73436cafef9a0 100644 (file)
@@ -33,7 +33,7 @@ public:
 
     static UnicodeString hex(const UnicodeString& s);
 
-    static UnicodeString hex(const UnicodeString& s, UChar sep);
+    static UnicodeString hex(const UnicodeString& s, char16_t sep);
 
     static UnicodeString hex(const uint8_t* bytes, int32_t len);
 
index 3e462b067fe81be502858040fe49851754a9ecb2..1ebb85fe0e662ce085746c4669de1520bc3d5de5 100644 (file)
@@ -345,7 +345,7 @@ UCollator *thaiColl = nullptr;
 U_CDECL_BEGIN
 static int U_CALLCONV
 StrCmp(const void *p1, const void *p2) {
-  return ucol_strcoll(thaiColl, *(UChar **) p1, -1,  *(UChar **)p2, -1);
+  return ucol_strcoll(thaiColl, *(char16_t **) p1, -1,  *(char16_t **)p2, -1);
 }
 U_CDECL_END
 
@@ -362,9 +362,9 @@ void CollationThaiTest::TestInvalidThai(void) {
     "\\u0E01\\u0E44\\u0E44\\u0E01",
   };
 
-  UChar strings[LINES][20];
+  char16_t strings[LINES][20];
 
-  UChar *toSort[LINES];
+  char16_t *toSort[LINES];
 
   int32_t i = 0, j = 0, len = 0;
 
@@ -385,7 +385,7 @@ void CollationThaiTest::TestInvalidThai(void) {
     toSort[i] = strings[i];
   }
 
-  qsort (toSort, LINES, sizeof (UChar *), StrCmp);
+  qsort (toSort, LINES, sizeof (char16_t *), StrCmp);
 
   for (i=0; i < LINES; i++)
   {
index 28450816c3ca182db9643eef740c4765de3e157c..06e090d6a1336cb11198d4481fd767cfcca2116f 100644 (file)
@@ -995,14 +995,14 @@ void TestMessageFormat::testSetLocale()
     // Just use unlocalized currency symbol.
     //UnicodeString compareStrEng = "At <time> on Aug 8, 1997, you made a deposit of $456.83.";
     UnicodeString compareStrEng = "At <time> on Aug 8, 1997, you made a deposit of ";
-    compareStrEng += (UChar) 0x00a4;
+    compareStrEng += (char16_t) 0x00a4;
     compareStrEng += "456.83.";
     // {sfb} to get DM, would need Locale::GERMANY, not Locale::GERMAN
     // Just use unlocalized currency symbol.
     //UnicodeString compareStrGer = "At <time> on 08.08.1997, you made a deposit of 456,83 DM.";
     UnicodeString compareStrGer = "At <time> on 08.08.1997, you made a deposit of ";
     compareStrGer += "456,83";
-    compareStrGer += (UChar) 0x00a0;
+    compareStrGer += (char16_t) 0x00a0;
     compareStrGer += "XXX.";
 
     MessageFormat msg( formatStr, err);
index a98b833ef08c548fd63f69ae1570791c2ee08678..2aafd63046e24e6a352df49b5dcb4a6893e29692 100644 (file)
@@ -69,8 +69,8 @@ UBool TokenIterator::nextToken(UnicodeString& token, UErrorCode& ec) {
     if (pos == line.length()) {
         return false;
     }
-    UChar c = line.charAt(pos++);
-    UChar quote = 0;
+    char16_t c = line.charAt(pos++);
+    char16_t quote = 0;
     switch (c) {
     case 34/*'"'*/:
     case 39/*'\\'*/:
index e33bbd19ebd08b8ab28a5a3cf6b6247897ec929d..424e3431d81d07b2818deff4b71811fbcc7a38bc 100644 (file)
@@ -509,15 +509,15 @@ void TransliteratorAPITest::TestKeyboardTransliterator1(){
     s="";
     status=U_ZERO_ERROR;
     index.contextStart = index.contextLimit = index.start = index.limit = 0;
-    logln("Testing transliterate(Replaceable, int32_t, UChar, UErrorCode)");
+    logln("Testing transliterate(Replaceable, int32_t, char16_t, UErrorCode)");
     for(i=10; i<UPRV_LENGTHOF(Data); i=i+2){
         UnicodeString log;
         if (Data[i+0] != "") {
             log = s + " + " + Data[i+0] + " -> ";
-            UChar c=Data[i+0].charAt(0);
+            char16_t c=Data[i+0].charAt(0);
             t->transliterate(s, index, c, status);
             if(U_FAILURE(status)) {
-               errln("FAIL: " + t->getID()+ ".transliterate(Replaceable, int32_t[], UChar, UErrorCode)-->" + (UnicodeString)u_errorName(status));
+               errln("FAIL: " + t->getID()+ ".transliterate(Replaceable, int32_t[], char16_t, UErrorCode)-->" + (UnicodeString)u_errorName(status));
                continue;
             }
         } else {
@@ -889,13 +889,13 @@ void TransliteratorAPITest::displayOutput(const UnicodeString& got, const Unicod
     got.extractBetween(index.limit, index.contextLimit, d);
     got.extractBetween(index.contextLimit, got.length(), e);
     log.append(a).
-        append((UChar)0x7b/*{*/).
+        append((char16_t)0x7b/*{*/).
         append(b).
-        append((UChar)0x7c/*|*/).
+        append((char16_t)0x7c/*|*/).
         append(c).
-        append((UChar)0x7c).
+        append((char16_t)0x7c).
         append(d).
-        append((UChar)0x7d/*}*/).
+        append((char16_t)0x7d/*}*/).
         append(e);
     if (got == expected) 
         logln("OK:" + prettify(log));
index d376b026ee1415ebdbb72405978fdde3812a4c20..23eb813ae2addc949863e6ddb6d77c5ad93d54b0 100644 (file)
@@ -129,7 +129,7 @@ public:
     LegalJamo() {}
     virtual ~LegalJamo() {}
     virtual UBool is(const UnicodeString& sourceString) const override;
-            int   getType(UChar c) const;
+            int   getType(char16_t c) const;
 };
 
 UBool LegalJamo::is(const UnicodeString& sourceString) const {
@@ -156,7 +156,7 @@ UBool LegalJamo::is(const UnicodeString& sourceString) const {
     return true;
 }
 
-int LegalJamo::getType(UChar c) const {
+int LegalJamo::getType(char16_t c) const {
     if (0x1100 <= c && c <= 0x1112) 
         return 0;
     else if (0x1161 <= c && c  <= 0x1175) 
@@ -174,9 +174,9 @@ public:
 
     virtual UBool is(const UnicodeString& sourceString) const override;
 
-    static UBool isVowel(UChar c);
+    static UBool isVowel(char16_t c);
     
-    static UBool isRho(UChar c);
+    static UBool isRho(char16_t c);
 };
 
 UBool LegalGreek::is(const UnicodeString& sourceString) const { 
@@ -192,7 +192,7 @@ UBool LegalGreek::is(const UnicodeString& sourceString) const {
         //    return false;
         // }       
         for (int32_t i = 0; i < decomp.length(); ++i) {
-            UChar c = decomp.charAt(i);
+            char16_t c = decomp.charAt(i);
             // exclude all the accents
             if (c == 0x0313 || c == 0x0314 || c == 0x0300 || c == 0x0302
                 || c == 0x0342 || c == 0x0345
@@ -211,7 +211,7 @@ UBool LegalGreek::is(const UnicodeString& sourceString) const {
     int32_t breathingCount = 0;
     int32_t letterCount = 0;
     for (int32_t i = 0; i < decomp.length(); ++i) {
-        UChar c = decomp.charAt(i);
+        char16_t c = decomp.charAt(i);
         if (u_isalpha(c)) {
             ++letterCount;
             if (noLetterYet) {
@@ -232,7 +232,7 @@ UBool LegalGreek::is(const UnicodeString& sourceString) const {
     return breathingCount == 0;
 }
 
-UBool LegalGreek::isVowel(UChar c) {
+UBool LegalGreek::isVowel(char16_t c) {
     switch (c) {
     case 0x03B1:
     case 0x03B5:
@@ -253,7 +253,7 @@ UBool LegalGreek::isVowel(UChar c) {
     return false;
 }
 
-UBool LegalGreek::isRho(UChar c) {
+UBool LegalGreek::isRho(char16_t c) {
     switch (c) {
     case 0x03C1:
     case 0x03A1:
@@ -527,7 +527,7 @@ void RTTest::test(const UnicodeString& sourceRangeVal,
 UBool RTTest::checkIrrelevants(Transliterator *t, 
                                const UnicodeString& irrelevants) {
     for (int i = 0; i < irrelevants.length(); ++i) {
-        UChar c = irrelevants.charAt(i);
+        char16_t c = irrelevants.charAt(i);
         UnicodeString srcStr(c);
         UnicodeString targ = srcStr;
         t->transliterate(targ);
@@ -1212,8 +1212,8 @@ UBool LegalHebrew::is(const UnicodeString& sourceString)const{
     if (sourceString.length() == 0) return true;
     // don't worry about surrogates.
     for (int i = 0; i < sourceString.length(); ++i) {
-        UChar ch = sourceString.charAt(i);
-        UChar next = i+1 == sourceString.length() ? 0x0000 : sourceString.charAt(i);
+        char16_t ch = sourceString.charAt(i);
+        char16_t next = i+1 == sourceString.length() ? 0x0000 : sourceString.charAt(i);
         if (FINAL.contains(ch)) {
             if (LETTER.contains(next)) return false;
         } else if (NON_FINAL.contains(ch)) {
index 1c4d8b1f2c7f7939e8df09aec2a29cf2a335e380..4669cdb891d30acb8880ee115ef422f3e4d021b1 100644 (file)
@@ -91,10 +91,10 @@ The Management
 
 // Define character constants thusly to be EBCDIC-friendly
 enum {
-    LEFT_BRACE=((UChar)0x007B), /*{*/
-    PIPE      =((UChar)0x007C), /*|*/
-    ZERO      =((UChar)0x0030), /*0*/
-    UPPER_A   =((UChar)0x0041)  /*A*/
+    LEFT_BRACE=((char16_t)0x007B), /*{*/
+    PIPE      =((char16_t)0x007C), /*|*/
+    ZERO      =((char16_t)0x0030), /*0*/
+    UPPER_A   =((char16_t)0x0041)  /*A*/
 };
 
 TransliteratorTest::TransliteratorTest()
@@ -339,7 +339,7 @@ void TransliteratorTest::TestSimpleRules(void) {
     UParseError parseError;
     Transliterator *t = Transliterator::createFromRules(
         "<ID>",
-        UnicodeString("$dummy=").append((UChar)0xE100) +
+        UnicodeString("$dummy=").append((char16_t)0xE100) +
         UnicodeString(";"
                       "$vowel=[aeiouAEIOU];"
                       "$lu=[:Lu:];"
@@ -556,9 +556,9 @@ void TransliteratorTest::keyboardAux(const Transliterator& t,
         s.extractBetween(index.contextStart, index.start, b);
         s.extractBetween(index.start, s.length(), c);
         log.append(a).
-            append((UChar)LEFT_BRACE).
+            append((char16_t)LEFT_BRACE).
             append(b).
-            append((UChar)PIPE).
+            append((char16_t)PIPE).
             append(c);
         if (s == DATA[i+1] && U_SUCCESS(status)) {
             logln(log);
@@ -581,7 +581,7 @@ void TransliteratorTest::TestArabic(void) {
 //    };
 //    */
 //
-//    UChar ar_raw[] = {
+//    char16_t ar_raw[] = {
 //        0x062a, 0x062a, 0x0645, 0x062a, 0x0639, 0x0020, 0x0627,
 //        0x0644, 0x0644, 0x063a, 0x0629, 0x0020, 0x0627, 0x0644,
 //        0x0639, 0x0631, 0x0628, 0x0628, 0x064a, 0x0629, 0x0020,
@@ -662,7 +662,7 @@ class TestFilter : public UnicodeFilter {
         return new TestFilter(*this);
     }
     virtual UBool contains(UChar32 c) const override {
-        return c != (UChar)0x0063 /*c*/;
+        return c != (char16_t)0x0063 /*c*/;
     }
     // Stubs
     virtual UnicodeString& toPattern(UnicodeString& result,
@@ -744,8 +744,8 @@ void TransliteratorTest::TestPatternQuoting(void) {
     // Array of 3n items
     // Each item is <rules>, <input>, <expected output>
     const UnicodeString DATA[] = {
-        UnicodeString(UChar(0x4E01)) + ">'[male adult]'",
-        UnicodeString(UChar(0x4E01)),
+        UnicodeString(char16_t(0x4E01)) + ">'[male adult]'",
+        UnicodeString(char16_t(0x4E01)),
         "[male adult]"
     };
 
@@ -775,14 +775,14 @@ void TransliteratorTest::TestJ277(void) {
         return;
     }
 
-    UChar sigma = 0x3C3;
-    UChar upsilon = 0x3C5;
-    UChar nu = 0x3BD;
-//    UChar PHI = 0x3A6;
-    UChar alpha = 0x3B1;
-//    UChar omega = 0x3C9;
-//    UChar omicron = 0x3BF;
-//    UChar epsilon = 0x3B5;
+    char16_t sigma = 0x3C3;
+    char16_t upsilon = 0x3C5;
+    char16_t nu = 0x3BD;
+//    char16_t PHI = 0x3A6;
+    char16_t alpha = 0x3B1;
+//    char16_t omega = 0x3C9;
+//    char16_t omicron = 0x3BF;
+//    char16_t epsilon = 0x3B5;
 
     // sigma upsilon nu -> syn
     UnicodeString syn;
@@ -2945,16 +2945,16 @@ void TransliteratorTest::TestGurmukhiDevanagari(){
     expected= expected.unescape();
 
     while(vIter.next()){
-        src.setCharAt(0,(UChar) vIter.getCodepoint());
-        expected.setCharAt(0,(UChar) (vIter.getCodepoint()+0x0100));
+        src.setCharAt(0,(char16_t) vIter.getCodepoint());
+        expected.setCharAt(0,(char16_t) (vIter.getCodepoint()+0x0100));
         expect(*trans,src,expected);
     }
     
     expected.setCharAt(1,0x0A70);
     while(nvIter.next()){
         //src.setCharAt(0,(char) nvIter.codepoint);
-        src.setCharAt(0,(UChar)nvIter.getCodepoint());
-        expected.setCharAt(0,(UChar) (nvIter.getCodepoint()+0x0100));
+        src.setCharAt(0,(char16_t)nvIter.getCodepoint());
+        expected.setCharAt(0,(char16_t) (nvIter.getCodepoint()+0x0100));
         expect(*trans,src,expected);
     }
     delete trans;
@@ -3043,7 +3043,7 @@ void TransliteratorTest::TestParseError() {
     delete t;
     if (U_FAILURE(ec)) {
         UnicodeString err(pe.preContext);
-        err.append((UChar)124/*|*/).append(pe.postContext);
+        err.append((char16_t)124/*|*/).append(pe.postContext);
         if (err.indexOf("d << b") >= 0) {
             logln("Ok: " + err);
         } else {
@@ -3081,7 +3081,7 @@ void TransliteratorTest::TestOutputSet() {
     delete t;
     if (U_FAILURE(ec)) {
         UnicodeString err(pe.preContext);
-        err.append((UChar)124/*|*/).append(pe.postContext);
+        err.append((char16_t)124/*|*/).append(pe.postContext);
         logln("Ok: " + err);
         return;
     }
@@ -3100,7 +3100,7 @@ void TransliteratorTest::TestVariableRange() {
     delete t;
     if (U_FAILURE(ec)) {
         UnicodeString err(pe.preContext);
-        err.append((UChar)124/*|*/).append(pe.postContext);
+        err.append((char16_t)124/*|*/).append(pe.postContext);
         logln("Ok: " + err);
         return;
     }
@@ -3118,7 +3118,7 @@ void TransliteratorTest::TestInvalidPostContext() {
     delete t;
     if (U_FAILURE(ec)) {
         UnicodeString err(pe.preContext);
-        err.append((UChar)124/*|*/).append(pe.postContext);
+        err.append((char16_t)124/*|*/).append(pe.postContext);
         if (err.indexOf("a}b{c") >= 0) {
             logln("Ok: " + err);
         } else {
@@ -3196,10 +3196,10 @@ void TransliteratorTest::TestIDForms() {
     }
 }
 
-static const UChar SPACE[]   = {32,0};
-static const UChar NEWLINE[] = {10,0};
-static const UChar RETURN[]  = {13,0};
-static const UChar EMPTY[]   = {0};
+static const char16_t SPACE[]   = {32,0};
+static const char16_t NEWLINE[] = {10,0};
+static const char16_t RETURN[]  = {13,0};
+static const char16_t EMPTY[]   = {0};
 
 void TransliteratorTest::checkRules(const UnicodeString& label, Transliterator& t2,
                                     const UnicodeString& testRulesForward) {
@@ -3536,7 +3536,7 @@ void TransliteratorTest::TestSurrogateCasing (void) {
     // check that casing handles surrogates
     // titlecase is currently defective
     char buffer[20];
-    UChar buffer2[20];
+    char16_t buffer2[20];
     UChar32 dee;
     U16_GET(DESERET_dee,0, 0, DESERET_dee.length(), dee);
     UnicodeString DEE(u_totitle(dee));
@@ -4624,14 +4624,14 @@ void TransliteratorTest::TestRuleStripping() {
 #
 \uE001>\u0C01; # SIGN
     */
-    static const UChar rule[] = {
+    static const char16_t rule[] = {
         0x0023,0x0020,0x000D,0x000A,
         0xE001,0x003E,0x0C01,0x003B,0x0020,0x0023,0x0020,0x0053,0x0049,0x0047,0x004E,0
     };
-    static const UChar expectedRule[] = {
+    static const char16_t expectedRule[] = {
         0xE001,0x003E,0x0C01,0x003B,0
     };
-    UChar result[UPRV_LENGTHOF(rule)];
+    char16_t result[UPRV_LENGTHOF(rule)];
     UErrorCode status = U_ZERO_ERROR;
     int32_t len = utrans_stripRules(rule, UPRV_LENGTHOF(rule), result, &status);
     if (len != u_strlen(expectedRule)) {
@@ -4921,9 +4921,9 @@ UnicodeString& TransliteratorTest::formatInput(UnicodeString &appendTo,
         input.extractBetween(pos.start, pos.limit, c);
         input.extractBetween(pos.limit, pos.contextLimit, d);
         input.extractBetween(pos.contextLimit, input.length(), e);
-        appendTo.append(a).append((UChar)123/*{*/).append(b).
-            append((UChar)PIPE).append(c).append((UChar)PIPE).append(d).
-            append((UChar)125/*}*/).append(e);
+        appendTo.append(a).append((char16_t)123/*{*/).append(b).
+            append((char16_t)PIPE).append(c).append((char16_t)PIPE).append(d).
+            append((char16_t)125/*}*/).append(e);
     } else {
         appendTo.append((UnicodeString)"INVALID UTransPosition {cs=" +
                         pos.contextStart + ", s=" + pos.start + ", l=" +
index a5d3a358307a2e6dc950d4ce484058b639d298b9..8b24cc3e168459d62e88883ecee0d5bdab3c923b 100644 (file)
@@ -29,7 +29,7 @@ CollationTurkishTest::~CollationTurkishTest()
     delete myCollation;
 }
 
-const UChar CollationTurkishTest::testSourceCases[][CollationTurkishTest::MAX_TOKEN_LEN] = {
+const char16_t CollationTurkishTest::testSourceCases[][CollationTurkishTest::MAX_TOKEN_LEN] = {
     {0x73, 0x0327, 0},
     {0x76, 0x00E4, 0x74, 0},
     {0x6f, 0x6c, 0x64, 0},
@@ -43,7 +43,7 @@ const UChar CollationTurkishTest::testSourceCases[][CollationTurkishTest::MAX_TO
     {0x69, 0x64, 0x65, 0x61, 0}
 };
 
-const UChar CollationTurkishTest::testTargetCases[][CollationTurkishTest::MAX_TOKEN_LEN] = {
+const char16_t CollationTurkishTest::testTargetCases[][CollationTurkishTest::MAX_TOKEN_LEN] = {
     {0x75, 0x0308, 0},
     {0x76, 0x62, 0x74, 0},
     {0x00D6, 0x61, 0x79, 0},
index 9b6857aee513b293c481458f1184357712492127..75c1fb57346c2c5ad1f8f9b073aed6dd110eb5e5 100644 (file)
@@ -39,8 +39,8 @@ public:
 
 private:
     // static constants
-    static const UChar testSourceCases[][MAX_TOKEN_LEN];
-    static const UChar testTargetCases[][MAX_TOKEN_LEN];
+    static const char16_t testSourceCases[][MAX_TOKEN_LEN];
+    static const char16_t testTargetCases[][MAX_TOKEN_LEN];
     static const Collator::EComparisonResult results[];
 
     Collator *myCollation;
index b13f30ae6d240b0a9c49fbb95f28901d46619d75..3b294e9944ae7aeac16740f4ec01cd5f12b65185 100644 (file)
@@ -91,7 +91,7 @@ void IntlTestCollator::runIndexedTest( int32_t index, UBool exec, const char* &n
 }
 
 UCollationResult 
-IntlTestCollator::compareUsingPartials(UCollator *coll, const UChar source[], int32_t sLen, const UChar target[], int32_t tLen, int32_t pieceSize, UErrorCode &status) {
+IntlTestCollator::compareUsingPartials(UCollator *coll, const char16_t source[], int32_t sLen, const char16_t target[], int32_t tLen, int32_t pieceSize, UErrorCode &status) {
   int32_t partialSKResult = 0;
   uint8_t sBuf[512], tBuf[512];
   UCharIterator sIter, tIter;
@@ -146,8 +146,8 @@ IntlTestCollator::doTestVariant(Collator* col, const UnicodeString &source, cons
     UColAttributeValue norm = ucol_getAttribute(myCollation, UCOL_NORMALIZATION_MODE, &status);
 
     int32_t sLen = source.length(), tLen = target.length();
-    const UChar* src = source.getBuffer();
-    const UChar* trg = target.getBuffer();
+    const char16_t* src = source.getBuffer();
+    const char16_t* trg = target.getBuffer();
     UCollationResult compareResultIter = (UCollationResult)result;
 
     {
@@ -238,7 +238,7 @@ IntlTestCollator::doTestVariant(Collator* col, const UnicodeString &source, cons
 }
 
 void
-IntlTestCollator::doTest(Collator* col, const UChar *source, const UChar *target, Collator::EComparisonResult result) {
+IntlTestCollator::doTest(Collator* col, const char16_t *source, const char16_t *target, Collator::EComparisonResult result) {
   doTest(col, UnicodeString(source), UnicodeString(target), result);
 }
 
index 85b67de586212d5d90f6d713cedd206e4aca07c3..add918e7868035485c81b1f25da8279250e511c2 100644 (file)
@@ -32,7 +32,7 @@ protected:
     };
 
     // These two should probably go down in IntlTest
-    void doTest(Collator* col, const UChar *source, const UChar *target, Collator::EComparisonResult result);
+    void doTest(Collator* col, const char16_t *source, const char16_t *target, Collator::EComparisonResult result);
 
     void doTest(Collator* col, const UnicodeString &source, const UnicodeString &target, Collator::EComparisonResult result);
     void doTestVariant(Collator* col, const UnicodeString &source, const UnicodeString &target, Collator::EComparisonResult result);
@@ -51,7 +51,7 @@ protected:
      * returned by calls to next on the specified iterator
      */
     Order *getOrders(CollationElementIterator &iter, int32_t &orderLength);
-    UCollationResult compareUsingPartials(UCollator *coll, const UChar source[], int32_t sLen, const UChar target[], int32_t tLen, int32_t pieceSize, UErrorCode &status);
+    UCollationResult compareUsingPartials(UCollator *coll, const char16_t source[], int32_t sLen, const char16_t target[], int32_t tLen, int32_t pieceSize, UErrorCode &status);
 
 };
 
index 957a1ced25df9aa3ca35cf6990658b5d7c4d4e6c..fe1d129b9fab21391cd7eaf51fca52e2f0ed6aac 100644 (file)
@@ -238,7 +238,7 @@ void IntlTestDecimalFormatSymbols::testLastResortData() {
                  "", lastResort->getSymbol(DecimalFormatSymbols::kMonetaryGroupingSeparatorSymbol));
     lastResort->setSymbol(DecimalFormatSymbols::kMonetaryGroupingSeparatorSymbol, ",");
     assertEquals("last-resort NaN",
-                 UnicodeString((UChar)0xfffd), lastResort->getSymbol(DecimalFormatSymbols::kNaNSymbol));
+                 UnicodeString((char16_t)0xfffd), lastResort->getSymbol(DecimalFormatSymbols::kNaNSymbol));
     lastResort->setSymbol(DecimalFormatSymbols::kNaNSymbol, "NaN");
     // Check that now all of the symbols match root.
     for(int32_t i = 0; i < DecimalFormatSymbols::kFormatSymbolCount; ++i) {
@@ -253,9 +253,9 @@ void IntlTestDecimalFormatSymbols::testLastResortData() {
 void IntlTestDecimalFormatSymbols::testDigitSymbols() {
     // This test does more in ICU4J than in ICU4C right now.
     // In ICU4C, it is basically just a test for codePointZero and getConstDigitSymbol.
-    UChar defZero = u'0';
+    char16_t defZero = u'0';
     UChar32 osmanyaZero = U'\U000104A0';
-    static const UChar* osmanyaDigitStrings[] = {
+    static const char16_t* osmanyaDigitStrings[] = {
         u"\U000104A0", u"\U000104A1", u"\U000104A2", u"\U000104A3", u"\U000104A4",
         u"\U000104A5", u"\U000104A6", u"\U000104A7", u"\U000104A8", u"\U000104A9"
     };
index ba202930bf8a2529526d699635737c7a76c043a2..8ba558633cdf2978c8aedd8380571fcc64e24ec0 100644 (file)
@@ -167,10 +167,10 @@ private:
 
 
 void TestArabicShapeThreads::doTailTest(void) {
-    static const UChar src[] = { 0x0020, 0x0633, 0 };
-    static const UChar dst_old[] = { 0xFEB1, 0x200B,0 };
-    static const UChar dst_new[] = { 0xFEB1, 0xFE73,0 };
-    UChar dst[3] = { 0x0000, 0x0000,0 };
+    static const char16_t src[] = { 0x0020, 0x0633, 0 };
+    static const char16_t dst_old[] = { 0xFEB1, 0x200B,0 };
+    static const char16_t dst_new[] = { 0xFEB1, 0xFE73,0 };
+    char16_t dst[3] = { 0x0000, 0x0000,0 };
     int32_t length;
     UErrorCode status;
 
@@ -341,8 +341,8 @@ const ThreadSafeFormatSharedData *gSharedData = nullptr;
 
 ThreadSafeFormatSharedData::ThreadSafeFormatSharedData(UErrorCode &status) {
     fFormat.adoptInstead(NumberFormat::createCurrencyInstance(Locale::getUS(), status));
-    static const UChar *kYDD = u"YDD";
-    static const UChar *kBBD = u"BBD";
+    static const char16_t *kYDD = u"YDD";
+    static const char16_t *kBBD = u"BBD";
     fYDDThing.adoptObject(new CurrencyAmount(123.456, kYDD, status));
     fBBDThing.adoptObject(new CurrencyAmount(987.654, kBBD, status));
     if (U_FAILURE(status)) {
@@ -378,7 +378,7 @@ ThreadSafeFormat::ThreadSafeFormat(UErrorCode &status) {
   fFormat.adoptInstead(NumberFormat::createCurrencyInstance(Locale::getUS(), status));
 }
 
-static const UChar *kUSD = u"USD";
+static const char16_t *kUSD = u"USD";
 
 UBool ThreadSafeFormat::doStuff(int32_t offset, UnicodeString &appendErr, UErrorCode &status) const {
   UBool okay = true;
@@ -707,7 +707,7 @@ void MultithreadTest::TestThreadedIntl()
 #define kCollatorThreadPatience kCollatorThreadThreads*30
 
 struct Line {
-    UChar buff[25];
+    char16_t buff[25];
     int32_t buflen;
 } ;
 
@@ -853,7 +853,7 @@ void MultithreadTest::TestCollators()
     memset(lines.getAlias(), 0, sizeof(Line)*200000);
     int32_t lineNum = 0;
 
-    UChar bufferU[1024];
+    char16_t bufferU[1024];
     uint32_t first = 0;
 
     while (fgets(buffer, 1024, testFile) != nullptr) {
index 912861cb95c79cd147353314fad72cfd753e8feb..d84585284f4a39a6b89bdaa2060a4fd1df6bf3df 100644 (file)
@@ -487,7 +487,7 @@ void BasicNormalizerTest::TestVerisign(void) {
 // Internal utilities
 //
 
-UnicodeString BasicNormalizerTest::hex(UChar ch) {
+UnicodeString BasicNormalizerTest::hex(char16_t ch) {
     UnicodeString result;
     return appendHex(ch, 4, result);
 }
@@ -495,7 +495,7 @@ UnicodeString BasicNormalizerTest::hex(UChar ch) {
 UnicodeString BasicNormalizerTest::hex(const UnicodeString& s) {
     UnicodeString result;
     for (int i = 0; i < s.length(); ++i) {
-        if (i != 0) result += (UChar)0x2c/*,*/;
+        if (i != 0) result += (char16_t)0x2c/*,*/;
         appendHex(s[i], 4, result);
     }
     return result;
@@ -628,7 +628,7 @@ private:
 };
 
 void
-BasicNormalizerTest::TestPreviousNext(const UChar *src, int32_t srcLength,
+BasicNormalizerTest::TestPreviousNext(const char16_t *src, int32_t srcLength,
                                       const UChar32 *expect, int32_t expectLength,
                                       const int32_t *expectIndex, // its length=expectLength+1
                                       int32_t srcMiddle, int32_t expectMiddle,
@@ -718,7 +718,7 @@ BasicNormalizerTest::TestPreviousNext(const UChar *src, int32_t srcLength,
 void
 BasicNormalizerTest::TestPreviousNext() {
     // src and expect strings
-    static const UChar src[]={
+    static const char16_t src[]={
         U16_LEAD(0x2f999), U16_TRAIL(0x2f999),
         U16_LEAD(0x1d15f), U16_TRAIL(0x1d15f),
         0xc4,
@@ -741,7 +741,7 @@ BasicNormalizerTest::TestPreviousNext() {
     };
 
     // src and expect strings for regression test for j2911
-    static const UChar src_j2911[]={
+    static const char16_t src_j2911[]={
         U16_LEAD(0x2f999), U16_TRAIL(0x2f999),
         0xdd00, 0xd900, // unpaired surrogates - regression test for j2911
         0xc4,
@@ -1134,7 +1134,7 @@ BasicNormalizerTest::TestCompare() {
     }
 
     // test cases with i and I to make sure Turkic works
-    static const UChar iI[]={ 0x49, 0x69, 0x130, 0x131 };
+    static const char16_t iI[]={ 0x49, 0x69, 0x130, 0x131 };
     UnicodeSet iSet, set;
 
     UnicodeString s1, s2;
index e295355b82ba8f72a78991d81671ba9f571831b8..13f2cc5b912a487dde293f2a8d482c4089bfdc8c 100644 (file)
@@ -61,7 +61,7 @@ private:
     UnicodeString hangulCanon[2][3];
 
     void
-    TestPreviousNext(const UChar *src, int32_t srcLength,
+    TestPreviousNext(const char16_t *src, int32_t srcLength,
                      const UChar32 *expext, int32_t expectLength,
                      const int32_t *expectIndex, // its length=expectLength+1
                      int32_t srcMiddle, int32_t expectMiddle,
@@ -86,7 +86,7 @@ private:
              Normalizer* result,
              const UnicodeString& errPrefix);
 
-    static UnicodeString hex(UChar ch);
+    static UnicodeString hex(char16_t ch);
     static UnicodeString hex(const UnicodeString& str);
 
     void checkLowMappingToEmpty(const Normalizer2 &n2);
index e661c1ed861c0dfd96cbf9a78e58501eb1d45168..1bda5817584522d99c3740d59be938f2ed2d7570 100644 (file)
@@ -58,7 +58,7 @@ BasicNormalizerTest::TestNormalizerAPI() {
     // test compose() and decompose()
     UnicodeString tel, nfkc, nfkd;
     tel=UnicodeString(1, (UChar32)0x2121, 10);
-    tel.insert(1, (UChar)0x301);
+    tel.insert(1, (char16_t)0x301);
 
     UErrorCode errorCode=U_ZERO_ERROR;
     Normalizer::compose(tel, true, 0, nfkc, errorCode);
@@ -95,7 +95,7 @@ BasicNormalizerTest::TestNormalizerAPI() {
         }
     }
 
-    // test setText(UChar *), getUMode() and setMode()
+    // test setText(char16_t *), getUMode() and setMode()
     errorCode=U_ZERO_ERROR;
     copy.setText(s.getBuffer()+1, s.length()-1, errorCode);
     copy.setMode(UNORM_NFD);
@@ -103,19 +103,19 @@ BasicNormalizerTest::TestNormalizerAPI() {
         errln("error in Normalizer::setMode() or Normalizer::getUMode()");
     }
     if(copy.next()!=0x308 || copy.next()!=0x1100) {
-        dataerrln("error in Normalizer::setText(UChar *) or Normalizer::setMode()");
+        dataerrln("error in Normalizer::setText(char16_t *) or Normalizer::setMode()");
     }
 
-    // test setText(UChar *, length=-1)
+    // test setText(char16_t *, length=-1)
     errorCode=U_ZERO_ERROR;
 
     // NUL-terminate s
-    s.append((UChar)0);         // append NUL
+    s.append((char16_t)0);         // append NUL
     s.truncate(s.length()-1);   // undo length change
 
     copy.setText(s.getBuffer()+1, -1, errorCode);
     if(copy.endIndex()!=s.length()-1) {
-        errln("error in Normalizer::setText(UChar *, -1)");
+        errln("error in Normalizer::setText(char16_t *, -1)");
     }
 
     // test setOption() and getOption()
@@ -143,7 +143,7 @@ BasicNormalizerTest::TestNormalizerAPI() {
     }
 
     // test that the same string can be used as source and destination
-    s.setTo((UChar)0xe4);
+    s.setTo((char16_t)0xe4);
     Normalizer::normalize(s, UNORM_NFD, 0, s, status);
     if(s.charAt(1)!=0x308) {
         dataerrln("error in Normalizer::normalize(UNORM_NFD, self)");
index 8ce314b7e5f49d822fd9c3aad20a1f9d44b2fd85..742307cf7c157aa00f00d16b4b278a8288a900dc 100644 (file)
@@ -312,28 +312,28 @@ void TimeUnitTest::testGreekWithFallback() {
     UTimeUnitFormatStyle styles[] = {UTMUTFMT_FULL_STYLE, UTMUTFMT_ABBREVIATED_STYLE};
     const int numbers[] = {1, 7};
 
-    const UChar oneSecond[] = {0x0031, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x03b5, 0x03c1, 0x03cc, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03bf, 0};
-    const UChar oneSecondShort[] = {0x0031, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x002e, 0};
-    const UChar oneMinute[] = {0x0031, 0x0020, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03cc, 0};
-    const UChar oneMinuteShort[] = {0x0031, 0x0020, 0x03bb, 0x002e, 0};
-    const UChar oneHour[] = {0x0031, 0x0020, 0x03ce, 0x03c1, 0x03b1, 0};
-    const UChar oneHourShort[] = {0x0031, 0x0020, 0x03ce, 0x002e, 0};
-    const UChar oneDay[] = {0x0031, 0x0020, 0x03b7, 0x03bc, 0x03ad, 0x03c1, 0x03b1, 0};
-    const UChar oneMonth[] = {0x0031, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x03b1, 0x03c2, 0};
-    const UChar oneMonthShort[] = {0x0031, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x002e, 0};
-    const UChar oneYear[] = {0x0031, 0x0020, 0x03ad, 0x03c4, 0x03bf, 0x03c2, 0};
-    const UChar oneYearShort[] = {0x0031, 0x0020, 0x03ad, 0x03c4, 0x002e, 0};
-    const UChar sevenSeconds[] = {0x0037, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x03b5, 0x03c1, 0x03cc, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03b1, 0};
-    const UChar sevenSecondsShort[] = {0x0037, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x002e, 0};
-    const UChar sevenMinutes[] = {0x0037, 0x0020, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03ac, 0};
-    const UChar sevenMinutesShort[] = {0x0037, 0x0020, 0x03bb, 0x002e, 0};
-    const UChar sevenHours[] = {0x0037, 0x0020, 0x03ce, 0x03c1, 0x03b5, 0x03c2, 0};
-    const UChar sevenHoursShort[] = {0x0037, 0x0020, 0x03ce, 0x002e, 0};
-    const UChar sevenDays[] = {0x0037, 0x0020, 0x03b7, 0x03bc, 0x03ad, 0x03c1, 0x03b5, 0x03c2, 0};
-    const UChar sevenMonths[] = {0x0037, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x03b5, 0x3c2, 0};
-    const UChar sevenMonthsShort[] = {0x0037, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x002e, 0};
-    const UChar sevenYears[] = {0x0037, 0x0020, 0x03ad, 0x03c4, 0x03b7, 0};
-    const UChar sevenYearsShort[] = {0x0037, 0x0020, 0x03ad, 0x03c4, 0x002e, 0};
+    const char16_t oneSecond[] = {0x0031, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x03b5, 0x03c1, 0x03cc, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03bf, 0};
+    const char16_t oneSecondShort[] = {0x0031, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x002e, 0};
+    const char16_t oneMinute[] = {0x0031, 0x0020, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03cc, 0};
+    const char16_t oneMinuteShort[] = {0x0031, 0x0020, 0x03bb, 0x002e, 0};
+    const char16_t oneHour[] = {0x0031, 0x0020, 0x03ce, 0x03c1, 0x03b1, 0};
+    const char16_t oneHourShort[] = {0x0031, 0x0020, 0x03ce, 0x002e, 0};
+    const char16_t oneDay[] = {0x0031, 0x0020, 0x03b7, 0x03bc, 0x03ad, 0x03c1, 0x03b1, 0};
+    const char16_t oneMonth[] = {0x0031, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x03b1, 0x03c2, 0};
+    const char16_t oneMonthShort[] = {0x0031, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x002e, 0};
+    const char16_t oneYear[] = {0x0031, 0x0020, 0x03ad, 0x03c4, 0x03bf, 0x03c2, 0};
+    const char16_t oneYearShort[] = {0x0031, 0x0020, 0x03ad, 0x03c4, 0x002e, 0};
+    const char16_t sevenSeconds[] = {0x0037, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x03b5, 0x03c1, 0x03cc, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03b1, 0};
+    const char16_t sevenSecondsShort[] = {0x0037, 0x0020, 0x03b4, 0x03b5, 0x03c5, 0x03c4, 0x002e, 0};
+    const char16_t sevenMinutes[] = {0x0037, 0x0020, 0x03bb, 0x03b5, 0x03c0, 0x03c4, 0x03ac, 0};
+    const char16_t sevenMinutesShort[] = {0x0037, 0x0020, 0x03bb, 0x002e, 0};
+    const char16_t sevenHours[] = {0x0037, 0x0020, 0x03ce, 0x03c1, 0x03b5, 0x03c2, 0};
+    const char16_t sevenHoursShort[] = {0x0037, 0x0020, 0x03ce, 0x002e, 0};
+    const char16_t sevenDays[] = {0x0037, 0x0020, 0x03b7, 0x03bc, 0x03ad, 0x03c1, 0x03b5, 0x03c2, 0};
+    const char16_t sevenMonths[] = {0x0037, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x03b5, 0x3c2, 0};
+    const char16_t sevenMonthsShort[] = {0x0037, 0x0020, 0x03bc, 0x03ae, 0x03bd, 0x002e, 0};
+    const char16_t sevenYears[] = {0x0037, 0x0020, 0x03ad, 0x03c4, 0x03b7, 0};
+    const char16_t sevenYearsShort[] = {0x0037, 0x0020, 0x03ad, 0x03c4, 0x002e, 0};
 
     const UnicodeString oneSecondStr(oneSecond);
     const UnicodeString oneSecondShortStr(oneSecondShort);
index 9d161196f54b94966a24b3556b28433780bdbcb8..052f4915dea00528748bb9eaceb0ae6b23f226af 100644 (file)
@@ -55,11 +55,11 @@ static const char* PATTERNS[] = {
     "VVVV"
 };
 
-static const UChar ETC_UNKNOWN[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77, 0x6E, 0};
+static const char16_t ETC_UNKNOWN[] = {0x45, 0x74, 0x63, 0x2F, 0x55, 0x6E, 0x6B, 0x6E, 0x6F, 0x77, 0x6E, 0};
 
-static const UChar ETC_SLASH[] = { 0x45, 0x74, 0x63, 0x2F, 0 }; // "Etc/"
-static const UChar SYSTEMV_SLASH[] = { 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x56, 0x2F, 0 }; // "SystemV/
-static const UChar RIYADH8[] = { 0x52, 0x69, 0x79, 0x61, 0x64, 0x68, 0x38, 0 }; // "Riyadh8"
+static const char16_t ETC_SLASH[] = { 0x45, 0x74, 0x63, 0x2F, 0 }; // "Etc/"
+static const char16_t SYSTEMV_SLASH[] = { 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x56, 0x2F, 0 }; // "SystemV/
+static const char16_t RIYADH8[] = { 0x52, 0x69, 0x79, 0x61, 0x64, 0x68, 0x38, 0 }; // "Riyadh8"
 
 static UBool contains(const char** list, const char* str) {
     for (int32_t i = 0; list[i]; i++) {
@@ -276,7 +276,7 @@ TimeZoneFormatTest::TestTimeZoneRoundTrip(void) {
                         } else if (outtzid != canonical) {
                             // Canonical ID did not match - check the rules
                             if (!((BasicTimeZone*)&outtz)->hasEquivalentTransitions((BasicTimeZone&)*tz, low, high, true, status)) {
-                                if (canonical.indexOf((UChar)0x27 /*'/'*/) == -1) {
+                                if (canonical.indexOf((char16_t)0x27 /*'/'*/) == -1) {
                                     // Exceptional cases, such as CET, EET, MET and WET
                                     logln((UnicodeString)"Canonical round trip failed (as expected); tz=" + *tzid
                                             + ", locale=" + LOCALES[locidx].getName() + ", pattern=" + PATTERNS[patidx]
@@ -593,7 +593,7 @@ void TimeZoneFormatTest::RunTimeRoundTripTests(int32_t threadNumber) {
                 // Some zones do not have short ID assigned, such as Asia/Riyadh87.
                 // The time roundtrip will fail for such zones with pattern "V" (short zone ID).
                 // This is expected behavior.
-                const UChar* shortZoneID = ZoneMeta::getShortID(*tzid);
+                const char16_t* shortZoneID = ZoneMeta::getShortID(*tzid);
                 if (shortZoneID == nullptr) {
                     continue;
                 }
@@ -601,7 +601,7 @@ void TimeZoneFormatTest::RunTimeRoundTripTests(int32_t threadNumber) {
                 // Some zones are not associated with any region, such as Etc/GMT+8.
                 // The time roundtrip will fail for such zone with pattern "VVV" (exemplar location).
                 // This is expected behavior.
-                if (tzid->indexOf((UChar)0x2F) < 0 || tzid->indexOf(ETC_SLASH, -1, 0) >= 0
+                if (tzid->indexOf((char16_t)0x2F) < 0 || tzid->indexOf(ETC_SLASH, -1, 0) >= 0
                     || tzid->indexOf(SYSTEMV_SLASH, -1, 0) >= 0 || tzid->indexOf(RIYADH8, -1, 0) >= 0) {
                     continue;
                 }
index 1dd1d458d9c296bee1ca72ad615dd554191a0d3f..47f06322096b1bf21da6911974342c42152f3893 100644 (file)
@@ -1836,7 +1836,7 @@ TimeZoneRuleTest::TestVTimeZoneParse(void) {
 
     // Create VTimeZone for Asia/Tokyo
     UnicodeString asiaTokyoID("Asia/Tokyo");
-    static const UChar asiaTokyo[] = {
+    static const char16_t asiaTokyo[] = {
         /* "BEGIN:VTIMEZONE\x0D\x0A" */
         0x42,0x45,0x47,0x49,0x4E,0x3A,0x56,0x54,0x49,0x4D,0x45,0x5A,0x4F,0x4E,0x45,0x0D,0x0A,
         /* "TZID:Asia\x0D\x0A" */
@@ -1884,7 +1884,7 @@ TimeZoneRuleTest::TestVTimeZoneParse(void) {
     delete tokyo;
 
         // Create VTimeZone from VTIMEZONE data
-    static const UChar fooData[] = {
+    static const char16_t fooData[] = {
         /* "BEGIN:VCALENDAR\x0D\x0A" */
         0x42,0x45,0x47,0x49,0x4E,0x3A,0x56,0x43,0x41,0x4C,0x45,0x4E,0x44,0x41,0x52,0x0D,0x0A,
         /* "BEGIN:VTIMEZONE\x0D\x0A" */
@@ -1944,7 +1944,7 @@ TimeZoneRuleTest::TestVTimeZoneParse(void) {
 void
 TimeZoneRuleTest::TestT6216(void) {
     // Test case in #6216
-    static const UChar tokyoTZ[] = {
+    static const char16_t tokyoTZ[] = {
         /* "BEGIN:VCALENDAR\r\n" */
         0x42,0x45,0x47,0x49,0x4e,0x3a,0x56,0x43,0x41,0x4c,0x45,0x4e,0x44,0x41,0x52,0x0d,0x0a,
         /* "VERSION:2.0\r\n" */
@@ -1976,7 +1976,7 @@ TimeZoneRuleTest::TestT6216(void) {
         0
     };
     // Single final rule, overlapping with another
-    static const UChar finalOverlap[] = {
+    static const char16_t finalOverlap[] = {
         /* "BEGIN:VCALENDAR\r\n" */
         0x42,0x45,0x47,0x49,0x4e,0x3a,0x56,0x43,0x41,0x4c,0x45,0x4e,0x44,0x41,0x52,0x0d,0x0a,
         /* "BEGIN:VTIMEZONE\r\n" */
@@ -2018,7 +2018,7 @@ TimeZoneRuleTest::TestT6216(void) {
         0
     };
     // Single final rule, no overlapping with another
-    static const UChar finalNonOverlap[] = {
+    static const char16_t finalNonOverlap[] = {
         /* "BEGIN:VCALENDAR\r\n" */
         0x42,0x45,0x47,0x49,0x4e,0x3a,0x56,0x43,0x41,0x4c,0x45,0x4e,0x44,0x41,0x52,0x0d,0x0a,
         /* "BEGIN:VTIMEZONE\r\n" */
@@ -2183,7 +2183,7 @@ TimeZoneRuleTest::TestVTimeZoneWrapper(void) {
 #if 0
     // local variables
     UBool b;
-    UChar * data = nullptr;
+    char16_t * data = nullptr;
     int32_t length = 0;
     int32_t i;
     UDate result;
@@ -2191,7 +2191,7 @@ TimeZoneRuleTest::TestVTimeZoneWrapper(void) {
     UErrorCode status;
 
     const char *name = "Test Initial";
-    UChar uname[20];
+    char16_t uname[20];
 
     UClassID cid1;
     UClassID cid2;
@@ -2254,9 +2254,9 @@ TimeZoneRuleTest::TestVTimeZoneWrapper(void) {
     cid2 = ztrans_getDynamicClassID(zt2);
 
     // test vzone
-    v1 = vzone_openID((UChar*)"America/Chicago", sizeof("America/Chicago"));
+    v1 = vzone_openID((char16_t*)"America/Chicago", sizeof("America/Chicago"));
     v2 = vzone_clone(v1);
-    //v2 = vzone_openData(const UChar* vtzdata, int32_t vtzdataLength, UErrorCode& status);
+    //v2 = vzone_openData(const char16_t* vtzdata, int32_t vtzdataLength, UErrorCode& status);
 
     // test equality
     b = vzone_equals(v1, v2);
index dc0f65fe7b557fab3c1755c2db9d318b2f521882..b439c55d0a07ed400b0ef1f0228c99454ebc63a8 100644 (file)
@@ -1059,7 +1059,7 @@ void TimeZoneTest::TestShortZoneIDs()
  */
 UnicodeString& TimeZoneTest::formatOffset(int32_t offset, UnicodeString &rv) {
     rv.remove();
-    UChar sign = 0x002B;
+    char16_t sign = 0x002B;
     if (offset < 0) {
         sign = 0x002D;
         offset = -offset;
@@ -1070,30 +1070,30 @@ UnicodeString& TimeZoneTest::formatOffset(int32_t offset, UnicodeString &rv) {
     int32_t m = offset % 60;
     int32_t h = offset / 60;
 
-    rv += (UChar)(sign);
+    rv += (char16_t)(sign);
     if (h >= 10) {
-        rv += (UChar)(0x0030 + (h/10));
+        rv += (char16_t)(0x0030 + (h/10));
     } else {
-        rv += (UChar)0x0030;
+        rv += (char16_t)0x0030;
     }
-    rv += (UChar)(0x0030 + (h%10));
+    rv += (char16_t)(0x0030 + (h%10));
 
-    rv += (UChar)0x003A; /* ':' */
+    rv += (char16_t)0x003A; /* ':' */
     if (m >= 10) {
-        rv += (UChar)(0x0030 + (m/10));
+        rv += (char16_t)(0x0030 + (m/10));
     } else {
-        rv += (UChar)0x0030;
+        rv += (char16_t)0x0030;
     }
-    rv += (UChar)(0x0030 + (m%10));
+    rv += (char16_t)(0x0030 + (m%10));
 
     if (s) {
-        rv += (UChar)0x003A; /* ':' */
+        rv += (char16_t)0x003A; /* ':' */
         if (s >= 10) {
-            rv += (UChar)(0x0030 + (s/10));
+            rv += (char16_t)(0x0030 + (s/10));
         } else {
-            rv += (UChar)0x0030;
+            rv += (char16_t)0x0030;
         }
-        rv += (UChar)(0x0030 + (s%10));
+        rv += (char16_t)(0x0030 + (s%10));
     }
     return rv;
 }
@@ -1104,7 +1104,7 @@ UnicodeString& TimeZoneTest::formatOffset(int32_t offset, UnicodeString &rv) {
  */
 UnicodeString& TimeZoneTest::formatTZID(int32_t offset, UnicodeString &rv) {
     rv.remove();
-    UChar sign = 0x002B;
+    char16_t sign = 0x002B;
     if (offset < 0) {
         sign = 0x002D;
         offset = -offset;
@@ -1116,29 +1116,29 @@ UnicodeString& TimeZoneTest::formatTZID(int32_t offset, UnicodeString &rv) {
     int32_t h = offset / 60;
 
     rv += "GMT";
-    rv += (UChar)(sign);
+    rv += (char16_t)(sign);
     if (h >= 10) {
-        rv += (UChar)(0x0030 + (h/10));
+        rv += (char16_t)(0x0030 + (h/10));
     } else {
-        rv += (UChar)0x0030;
+        rv += (char16_t)0x0030;
     }
-    rv += (UChar)(0x0030 + (h%10));
-    rv += (UChar)0x003A;
+    rv += (char16_t)(0x0030 + (h%10));
+    rv += (char16_t)0x003A;
     if (m >= 10) {
-        rv += (UChar)(0x0030 + (m/10));
+        rv += (char16_t)(0x0030 + (m/10));
     } else {
-        rv += (UChar)0x0030;
+        rv += (char16_t)0x0030;
     }
-    rv += (UChar)(0x0030 + (m%10));
+    rv += (char16_t)(0x0030 + (m%10));
 
     if (s) {
-        rv += (UChar)0x003A;
+        rv += (char16_t)0x003A;
         if (s >= 10) {
-            rv += (UChar)(0x0030 + (s/10));
+            rv += (char16_t)(0x0030 + (s/10));
         } else {
-            rv += (UChar)0x0030;
+            rv += (char16_t)0x0030;
         }
-        rv += (UChar)(0x0030 + (s%10));
+        rv += (char16_t)(0x0030 + (s%10));
     }
     return rv;
 }
index f821557f39b9c5d00af64f3ab41409702e3038d7..7a8347c7edca5f6ffc5b34695e8338a7e6a2d6ec 100644 (file)
@@ -156,7 +156,7 @@ static const uint32_t IS_SHIFTED = 1;
 static const uint32_t FROM_RULES = 2;
 
 static UBool
-skipLineBecauseOfBug(const UChar *s, int32_t length, uint32_t flags) {
+skipLineBecauseOfBug(const char16_t *s, int32_t length, uint32_t flags) {
     // Add temporary exceptions here if there are ICU bugs, until we can fix them.
     // For examples see the ICU 52 version of this file.
     (void)s;
@@ -188,8 +188,8 @@ void UCAConformanceTest::testConformance(const Collator *coll)
 
     int32_t line = 0;
 
-    UChar b1[1024], b2[1024];
-    UChar *buffer = b1, *oldB = nullptr;
+    char16_t b1[1024], b2[1024];
+    char16_t *buffer = b1, *oldB = nullptr;
 
     char lineB1[1024], lineB2[1024];
     char *lineB = lineB1, *oldLineB = lineB2;
index d98812cda2a7fb47c996f9d8b58d7590b1be2b0c..503340e051ceca72ca9e0e08ef44783a60c0f507 100644 (file)
@@ -351,7 +351,7 @@ void UnicodeTest::TestConsistency() {
     UnicodeSet set1, set2;
     if (nfcImpl->getCanonStartSet(0x49, set1)) {
         /* enumerate all characters that are plausible to be latin letters */
-        for(UChar start=0xa0; start<0x2000; ++start) {
+        for(char16_t start=0xa0; start<0x2000; ++start) {
             UnicodeString decomp=nfd->normalize(UnicodeString(start), errorCode);
             if(decomp.length()>1 && decomp[0]==0x49) {
                 set2.add(start);
@@ -548,11 +548,11 @@ void UnicodeTest::TestEmojiProperties() {
 
 namespace {
 
-UBool hbp(const UChar *s, int32_t length, UProperty which) {
+UBool hbp(const char16_t *s, int32_t length, UProperty which) {
     return u_stringHasBinaryProperty(s, length, which);
 }
 
-UBool hbp(const UChar *s, UProperty which) {
+UBool hbp(const char16_t *s, UProperty which) {
     return u_stringHasBinaryProperty(s, -1, which);
 }
 
index d863688ec4bb06f4165f6c7ec71e970fa117451d..de6fd39f234b3ae4f64e79710f518ab1bffe07af 100644 (file)
@@ -343,12 +343,12 @@ class Generator {
 public:
     Generator() : value(4711), num(0) {}
     void next() {
-        UChar c;
+        char16_t c;
         s.truncate(0);
-        s.append(c=(UChar)(value>>16));
-        s.append((UChar)(value>>4));
+        s.append(c=(char16_t)(value>>16));
+        s.append((char16_t)(value>>4));
         if(value&1) {
-            s.append((UChar)value);
+            s.append((char16_t)value);
         }
         set.add(c);
         value+=((value>>5)&0x7ff)*3+1;
@@ -925,7 +925,7 @@ void UCharsTrieTest::checkNext(UCharsTrie &trie,
         }
         if((result==USTRINGTRIE_INTERMEDIATE_VALUE)!=nextContinues) {
             errln("(trie.current()==USTRINGTRIE_INTERMEDIATE_VALUE) contradicts "
-                  "(trie.next(some UChar)!=USTRINGTRIE_NO_MATCH) after end of %s", data[i].s);
+                  "(trie.next(some char16_t)!=USTRINGTRIE_NO_MATCH) after end of %s", data[i].s);
         }
         trie.reset();
     }
index e58612a1b7c599956856e59b6013456433ef3c88..d16bd7f9133d51863a814f084ccbfe57f3eed7ec 100644 (file)
@@ -320,7 +320,7 @@ public:
 // Appendable is abstract; we define a subclass to verify that there is no "poor man's RTTI".
 class DummyAppendable : public Appendable {
 public:
-    virtual UBool appendCodeUnit(UChar /*c*/) override { return true; }
+    virtual UBool appendCodeUnit(char16_t /*c*/) override { return true; }
 };
 
 void UObjectTest::testIDs()
@@ -373,7 +373,7 @@ void UObjectTest::testIDs()
 
     TESTCLASSID_FACTORY(MeasureUnit, MeasureUnit::createMeter(status));
     TESTCLASSID_FACTORY(TimeUnit, TimeUnit::createInstance(TimeUnit::UTIMEUNIT_YEAR, status));
-    static const UChar SMALL_STR[] = u"QQQ";
+    static const char16_t SMALL_STR[] = u"QQQ";
     TESTCLASSID_CTOR(CurrencyAmount, (1.0, SMALL_STR, status));
     TESTCLASSID_CTOR(CurrencyUnit, (SMALL_STR, status));
 
@@ -572,7 +572,7 @@ void UObjectTest::TestMFCCompatibility() {
 #if U_HAVE_DEBUG_LOCATION_NEW
     /* Make sure that it compiles with MFC's debuggable new usage. */
     UnicodeString *str = new(__FILE__, __LINE__) UnicodeString();
-    str->append((UChar)0x0040); // Is it usable?
+    str->append((char16_t)0x0040); // Is it usable?
     if(str->charAt(0) != 0x0040) {
         errln("debug new doesn't work.");
     }
index 2598855e2adcc6581c5fb31869a0b2943cfae0f8..f0ed0e49479f61de766dd1657f20cb9e618726cc 100644 (file)
@@ -279,7 +279,7 @@ UnicodeSetTest::TestPatterns(void) {
     // Throw in a test of complement
     set.complement();
     UnicodeString exp;
-    exp.append((UChar)0x0000).append("aeeoouu").append((UChar)(u'z'+1)).append((UChar)0xFFFF);
+    exp.append((char16_t)0x0000).append("aeeoouu").append((char16_t)(u'z'+1)).append((char16_t)0xFFFF);
     expectPairs(set, exp);
 }
 
@@ -302,7 +302,7 @@ UnicodeSetTest::TestCategories(void) {
     set.applyPattern("[:L:]", status);
     if (U_FAILURE(status)) { errln("FAIL"); return; }
     for (i=0; i<0x200; ++i) {
-        UBool l = u_isalpha((UChar)i);
+        UBool l = u_isalpha((char16_t)i);
         if (l != set.contains(i)) {
             errln((UnicodeString)"FAIL: L contains " + (unsigned short)i + " = " + 
                   set.contains(i));
@@ -313,7 +313,7 @@ UnicodeSetTest::TestCategories(void) {
     set.applyPattern("[:Lu:]", status);
     if (U_FAILURE(status)) { errln("FAIL"); return; }
     for (i=0; i<0x200; ++i) {
-        UBool lu = (u_charType((UChar)i) == U_UPPERCASE_LETTER);
+        UBool lu = (u_charType((char16_t)i) == U_UPPERCASE_LETTER);
         if (lu != set.contains(i)) {
             errln((UnicodeString)"FAIL: Lu contains " + (unsigned short)i + " = " + 
                   set.contains(i));
@@ -1464,7 +1464,7 @@ void UnicodeSetTest::TestEscapePattern() {
 
         for (int32_t i=0; i<set.getRangeCount(); ++i) {
             UnicodeString str("Range ");
-            str.append((UChar)(u'0' + i))
+            str.append((char16_t)(u'0' + i))
                 .append(": ")
                 .append((UChar32)set.getRangeStart(i))
                 .append(" - ")
@@ -1654,7 +1654,7 @@ public:
         int32_t i = start;
         UnicodeString result;
         while (i < limit) {
-            UChar c = text.charAt(i);
+            char16_t c = text.charAt(i);
             if ((i==start && !u_isIDStart(c)) || !u_isIDPart(c)) {
                 break;
             }
@@ -1932,7 +1932,7 @@ UnicodeString UnicodeSetTest::getPairs(const UnicodeSet& set) {
             end = 0xFFFF;
             i = set.getRangeCount(); // Should be unnecessary
         }
-        pairs.append((UChar)start).append((UChar)end);
+        pairs.append((char16_t)start).append((char16_t)end);
     }
     return pairs;
 }
@@ -2205,7 +2205,7 @@ void UnicodeSetTest::expectToPattern(const UnicodeSet& set,
     }
 }
 
-static UChar toHexString(int32_t i) { return (UChar)(i + (i < 10 ? u'0' : (u'A' - 10))); }
+static char16_t toHexString(int32_t i) { return (char16_t)(i + (i < 10 ? u'0' : (u'A' - 10))); }
 
 void
 UnicodeSetTest::doAssert(UBool condition, const char *message)
@@ -2387,7 +2387,7 @@ void UnicodeSetTest::TestFreezable() {
 
 // Append the UTF-8 version of the string to t and return the appended UTF-8 length.
 static int32_t
-appendUTF8(const UChar *s, int32_t length, char *t, int32_t capacity) {
+appendUTF8(const char16_t *s, int32_t length, char *t, int32_t capacity) {
     UErrorCode errorCode=U_ZERO_ERROR;
     int32_t length8=0;
     u_strToUTF8(t, capacity, &length8, s, length, &errorCode);
@@ -2500,7 +2500,7 @@ private:
 // at code point boundaries.
 // That is, each edge of a match must not be in the middle of a surrogate pair.
 static inline UBool
-matches16CPB(const UChar *s, int32_t start, int32_t limit, const UnicodeString &t) {
+matches16CPB(const char16_t *s, int32_t start, int32_t limit, const UnicodeString &t) {
     s+=start;
     limit-=start;
     int32_t length=t.length();
@@ -2510,7 +2510,7 @@ matches16CPB(const UChar *s, int32_t start, int32_t limit, const UnicodeString &
 }
 
 // Implement span() with contains() for comparison.
-static int32_t containsSpanUTF16(const UnicodeSetWithStrings &set, const UChar *s, int32_t length,
+static int32_t containsSpanUTF16(const UnicodeSetWithStrings &set, const char16_t *s, int32_t length,
                                  USetSpanCondition spanCondition) {
     const UnicodeSet &realSet(set.getSet());
     if(!set.hasStrings()) {
@@ -2608,7 +2608,7 @@ static int32_t containsSpanUTF16(const UnicodeSetWithStrings &set, const UChar *
     }
 }
 
-static int32_t containsSpanBackUTF16(const UnicodeSetWithStrings &set, const UChar *s, int32_t length,
+static int32_t containsSpanBackUTF16(const UnicodeSetWithStrings &set, const char16_t *s, int32_t length,
                                      USetSpanCondition spanCondition) {
     if(length==0) {
         return 0;
@@ -2934,7 +2934,7 @@ static inline USetSpanCondition invertSpanCondition(USetSpanCondition spanCondit
 }
 
 static inline int32_t slen(const void *s, UBool isUTF16) {
-    return isUTF16 ? u_strlen((const UChar *)s) : static_cast<int32_t>(strlen((const char *)s));
+    return isUTF16 ? u_strlen((const char16_t *)s) : static_cast<int32_t>(strlen((const char *)s));
 }
 
 /*
@@ -3034,7 +3034,7 @@ static int32_t getSpans(const UnicodeSetWithStrings &set, UBool isComplement,
             length=slen(s, isUTF16);
         }
         for(;;) {
-            start+= isUTF16 ? containsSpanUTF16(set, (const UChar *)s+start, length-start, spanCondition) :
+            start+= isUTF16 ? containsSpanUTF16(set, (const char16_t *)s+start, length-start, spanCondition) :
                               containsSpanUTF8(set, (const char *)s+start, length-start, spanCondition);
             if(count<limitsCapacity) {
                 limits[count]=start;
@@ -3050,14 +3050,14 @@ static int32_t getSpans(const UnicodeSetWithStrings &set, UBool isComplement,
     case 3:
         start=0;
         for(;;) {
-            start+= isUTF16 ? realSet.span((const UChar *)s+start, length>=0 ? length-start : length, spanCondition) :
+            start+= isUTF16 ? realSet.span((const char16_t *)s+start, length>=0 ? length-start : length, spanCondition) :
                               realSet.spanUTF8((const char *)s+start, length>=0 ? length-start : length, spanCondition);
             if(count<limitsCapacity) {
                 limits[count]=start;
             }
             ++count;
             if(length>=0 ? start>=length :
-                           isUTF16 ? ((const UChar *)s)[start]==0 :
+                           isUTF16 ? ((const char16_t *)s)[start]==0 :
                                      ((const char *)s)[start]==0
             ) {
                 break;
@@ -3075,7 +3075,7 @@ static int32_t getSpans(const UnicodeSetWithStrings &set, UBool isComplement,
             if(count<=limitsCapacity) {
                 limits[limitsCapacity-count]=length;
             }
-            length= isUTF16 ? containsSpanBackUTF16(set, (const UChar *)s, length, spanCondition) :
+            length= isUTF16 ? containsSpanBackUTF16(set, (const char16_t *)s, length, spanCondition) :
                               containsSpanBackUTF8(set, (const char *)s, length, spanCondition);
             if(length==0 && spanCondition==firstSpanCondition) {
                 break;
@@ -3096,7 +3096,7 @@ static int32_t getSpans(const UnicodeSetWithStrings &set, UBool isComplement,
             // Note: Length<0 is tested only for the first spanBack().
             // If we wanted to keep length<0 for all spanBack()s, we would have to
             // temporarily modify the string by placing a NUL where the previous spanBack() stopped.
-            length= isUTF16 ? realSet.spanBack((const UChar *)s, length, spanCondition) :
+            length= isUTF16 ? realSet.spanBack((const char16_t *)s, length, spanCondition) :
                               realSet.spanBackUTF8((const char *)s, length, spanCondition);
             if(length==0 && spanCondition==firstSpanCondition) {
                 break;
@@ -3204,7 +3204,7 @@ void UnicodeSetTest::testSpan(const UnicodeSetWithStrings *sets[4],
     // Compare span() with containsAll()/containsNone(),
     // but only if we have expectLimits[] from the uncomplemented set.
     if(isUTF16 && (whichSpans&SPAN_SET)!=0) {
-        const UChar *s16=(const UChar *)s;
+        const char16_t *s16=(const char16_t *)s;
         UnicodeString string;
         int32_t prev=0, limit, length;
         for(i=0; i<expectCount; ++i) {
@@ -3251,8 +3251,8 @@ void UnicodeSetTest::testSpan(const UnicodeSetWithStrings *sets[4],
     testSpan(sets, s, length, isUTF16, whichSpans, expectLimits, expectCount, testName, index);
 }
 
-UBool stringContainsUnpairedSurrogate(const UChar *s, int32_t length) {
-    UChar c, c2;
+UBool stringContainsUnpairedSurrogate(const char16_t *s, int32_t length) {
+    char16_t c, c2;
 
     if(length>=0) {
         while(length>0) {
@@ -3282,7 +3282,7 @@ UBool stringContainsUnpairedSurrogate(const UChar *s, int32_t length) {
 // Testing UTF-16 and UTF-8 together requires that surrogate code points
 // have the same contains(c) value as U+FFFD.
 void UnicodeSetTest::testSpanBothUTFs(const UnicodeSetWithStrings *sets[4],
-                                      const UChar *s16, int32_t length16,
+                                      const char16_t *s16, int32_t length16,
                                       uint32_t whichSpans,
                                       const char *testName, int32_t index) {
     int32_t expectLimits[500];
@@ -3301,7 +3301,7 @@ void UnicodeSetTest::testSpanBothUTFs(const UnicodeSetWithStrings *sets[4],
     uint8_t s8[3000];
     int32_t offsets[3000];
 
-    const UChar *s16Limit=s16+length16;
+    const char16_t *s16Limit=s16+length16;
     char *t=(char *)s8;
     char *tLimit=t+sizeof(s8);
     int32_t *o=offsets;
@@ -3368,7 +3368,7 @@ void UnicodeSetTest::testSpanContents(const UnicodeSetWithStrings *sets[4], uint
                sets[0]->getSet().containsNone(0xd800, 0xdfff)) ||
              sets[0]->hasStringsWithSurrogates());
 
-    UChar s[1000];
+    char16_t s[1000];
     int32_t length=0;
     uint32_t localWhichSpans;
 
@@ -3393,7 +3393,7 @@ void UnicodeSetTest::testSpanContents(const UnicodeSetWithStrings *sets[4], uint
 // Test with a particular, interesting string.
 // Specify length and try NUL-termination.
 void UnicodeSetTest::testSpanUTF16String(const UnicodeSetWithStrings *sets[4], uint32_t whichSpans, const char *testName) {
-    static const UChar s[]={
+    static const char16_t s[]={
         0x61, 0x62, 0x20,                       // Latin, space
         0x3b1, 0x3b2, 0x3b3,                    // Greek
         0xd900,                                 // lead surrogate
@@ -3864,7 +3864,7 @@ void UnicodeSetTest::TestStringSpan() {
     }
 
     string16=u"byayaxya";
-    const UChar *s16=string16.getBuffer();
+    const char16_t *s16=string16.getBuffer();
     int32_t length16=string16.length();
     (void)length16;   // Suppress set but not used warning.
     if( set.span(s16, 8, USET_SPAN_NOT_CONTAINED)!=4 ||
index b559642a45cfe7ff97ff0a8b691491a079c7c288..9271edbb04e24220bc0b57e44c050f546b2d73fc 100644 (file)
@@ -188,7 +188,7 @@ private:
                   uint32_t whichSpans,
                   const char *testName, int32_t index);
     void testSpanBothUTFs(const UnicodeSetWithStrings *sets[4],
-                          const UChar *s16, int32_t length16,
+                          const char16_t *s16, int32_t length16,
                           uint32_t whichSpans,
                           const char *testName, int32_t index);
     void testSpanContents(const UnicodeSetWithStrings *sets[4], uint32_t whichSpans, const char *testName);
index d7bfff5cc113943de79735a7966d56e414203a53..b1489f86cc8afa521c26783b96eb3c4a4ed71323 100644 (file)
@@ -100,7 +100,7 @@ UnicodeStringTest::TestBasicManipulation()
     if (test1 != expectedValue)
         errln("replace() failed:  expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
     
-    UChar     temp[80];
+    char16_t  temp[80];
     test1.extract(0, 15, temp);
     
     UnicodeString       test2(temp, 15);
@@ -200,7 +200,7 @@ UnicodeStringTest::TestBasicManipulation()
             errln("UnicodeString(codepageData, dataLength, codepage) does not work with dataLength==-1");
         }
 
-        UChar buffer[10]={ 0x61, 0x62, 0x20ac, 0xd900, 0xdc05, 0,   0x62, 0xffff, 0xdbff, 0xdfff };
+        char16_t buffer[10]={ 0x61, 0x62, 0x20ac, 0xd900, 0xdc05, 0,   0x62, 0xffff, 0xdbff, 0xdfff };
         UnicodeString s, t(buffer, -1, UPRV_LENGTHOF(buffer));
 
         if(s.setTo(buffer, -1, UPRV_LENGTHOF(buffer)).length()!=u_strlen(buffer)) {
@@ -211,10 +211,10 @@ UnicodeStringTest::TestBasicManipulation()
         }
 
         if(0!=s.caseCompare(buffer, -1, U_FOLD_CASE_DEFAULT)) {
-            errln("UnicodeString.caseCompare(const UChar *, length, options) does not work with length==-1");
+            errln("UnicodeString.caseCompare(const char16_t *, length, options) does not work with length==-1");
         }
         if(0!=s.caseCompare(0, s.length(), buffer, U_FOLD_CASE_DEFAULT)) {
-            errln("UnicodeString.caseCompare(start, _length, const UChar *, options) does not work");
+            errln("UnicodeString.caseCompare(start, _length, const char16_t *, options) does not work");
         }
 
         buffer[u_strlen(buffer)]=0xe4;
@@ -242,7 +242,7 @@ UnicodeStringTest::TestBasicManipulation()
     {
         // Test the hardcoded-UTF-8 UnicodeString optimizations.
         static const uint8_t utf8[]={ 0x61, 0xC3, 0xA4, 0xC3, 0x9F, 0xE4, 0xB8, 0x80, 0 };
-        static const UChar utf16[]={ 0x61, 0xE4, 0xDF, 0x4E00 };
+        static const char16_t utf16[]={ 0x61, 0xE4, 0xDF, 0x4E00 };
         UnicodeString from8a = UnicodeString((const char *)utf8);
         UnicodeString from8b = UnicodeString((const char *)utf8, (int32_t)sizeof(utf8)-1);
         UnicodeString from16(false, utf16, UPRV_LENGTHOF(utf16));
@@ -270,10 +270,10 @@ UnicodeStringTest::TestCompare()
     UnicodeString   test3("this is a test of the emergency broadcast system");
     UnicodeString   test4("never say, \"this is a test\"!!");
 
-    UnicodeString   test5((UChar)0x5000);
-    UnicodeString   test6((UChar)0x5100);
+    UnicodeString   test5((char16_t)0x5000);
+    UnicodeString   test6((char16_t)0x5100);
 
-    UChar         uniChars[] = { 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 
+    char16_t      uniChars[] = { 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73,
                  0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0 };
     char            chars[] = "this is a test";
 
@@ -303,17 +303,17 @@ UnicodeStringTest::TestCompare()
         test3.compare(0, 18, test1) <=0  )
         errln("compare(offset, length, UnicodeString) fails");
 
-    // test compare(UChar*)
+    // test compare(char16_t*)
     if (test2.compare(uniChars) != 0 || test3.compare(uniChars) <= 0 || test4.compare(uniChars) >= 0)
-        errln("compare(UChar*) failed");
+        errln("compare(char16_t*) failed");
 
     // test compare(char*)
     if (test2.compare(chars) != 0 || test3.compare(chars) <= 0 || test4.compare(chars) >= 0)
         errln("compare(char*) failed");
 
-    // test compare(UChar*, length)
+    // test compare(char16_t*, length)
     if (test1.compare(uniChars, 4) <= 0 || test1.compare(uniChars, 4) <= 0)
-        errln("compare(UChar*, length) failed");
+        errln("compare(char16_t*, length) failed");
 
     // test compare(thisOffset, thisLength, that, thatOffset, thatLength)
     if (test1.compare(0, 14, test2, 0, 14) != 0 
@@ -352,7 +352,7 @@ UnicodeStringTest::TestCompare()
     /* test compareCodePointOrder() */
     {
         /* these strings are in ascending order */
-        static const UChar strings[][4]={
+        static const char16_t strings[][4]={
             { 0x61, 0 },                    /* U+0061 */
             { 0x20ac, 0xd801, 0 },          /* U+20ac U+d801 */
             { 0x20ac, 0xd800, 0xdc00, 0 },  /* U+20ac U+10000 */
@@ -380,7 +380,7 @@ UnicodeStringTest::TestCompare()
 
     /* test caseCompare() */
     {
-        static const UChar
+        static const char16_t
         _mixed[]=               { 0x61, 0x42, 0x131, 0x3a3, 0xdf,       0x130,       0x49,  0xfb03,           0xd93f, 0xdfff, 0 },
         _otherDefault[]=        { 0x41, 0x62, 0x131, 0x3c3, 0x73, 0x53, 0x69, 0x307, 0x69,  0x46, 0x66, 0x49, 0xd93f, 0xdfff, 0 },
         _otherExcludeSpecialI[]={ 0x41, 0x62, 0x131, 0x3c3, 0x53, 0x73, 0x69,        0x131, 0x66, 0x46, 0x69, 0xd93f, 0xdfff, 0 },
@@ -428,36 +428,36 @@ UnicodeStringTest::TestCompare()
     }
 
     // test that srcLength=-1 is handled in functions that
-    // take input const UChar */int32_t srcLength (j785)
+    // take input const char16_t */int32_t srcLength (j785)
     {
-        static const UChar u[]={ 0x61, 0x308, 0x62, 0 };
+        static const char16_t u[]={ 0x61, 0x308, 0x62, 0 };
         UnicodeString s=UNICODE_STRING("a\\u0308b", 8).unescape();
 
         if(s.compare(u, -1)!=0 || s.compare(0, 999, u, 0, -1)!=0) {
-            errln("error UnicodeString::compare(..., const UChar *, srcLength=-1) does not work");
+            errln("error UnicodeString::compare(..., const char16_t *, srcLength=-1) does not work");
         }
 
         if(s.compareCodePointOrder(u, -1)!=0 || s.compareCodePointOrder(0, 999, u, 0, -1)!=0) {
-            errln("error UnicodeString::compareCodePointOrder(..., const UChar *, srcLength=-1, ...) does not work");
+            errln("error UnicodeString::compareCodePointOrder(..., const char16_t *, srcLength=-1, ...) does not work");
         }
 
         if(s.caseCompare(u, -1, U_FOLD_CASE_DEFAULT)!=0 || s.caseCompare(0, 999, u, 0, -1, U_FOLD_CASE_DEFAULT)!=0) {
-            errln("error UnicodeString::caseCompare(..., const UChar *, srcLength=-1, ...) does not work");
+            errln("error UnicodeString::caseCompare(..., const char16_t *, srcLength=-1, ...) does not work");
         }
 
         if(s.indexOf(u, 1, -1, 0, 999)!=1 || s.indexOf(u+1, -1, 0, 999)!=1 || s.indexOf(u+1, -1, 0)!=1) {
-            errln("error UnicodeString::indexOf(const UChar *, srcLength=-1, ...) does not work");
+            errln("error UnicodeString::indexOf(const char16_t *, srcLength=-1, ...) does not work");
         }
 
         if(s.lastIndexOf(u, 1, -1, 0, 999)!=1 || s.lastIndexOf(u+1, -1, 0, 999)!=1 || s.lastIndexOf(u+1, -1, 0)!=1) {
-            errln("error UnicodeString::lastIndexOf(const UChar *, srcLength=-1, ...) does not work");
+            errln("error UnicodeString::lastIndexOf(const char16_t *, srcLength=-1, ...) does not work");
         }
 
         UnicodeString s2, s3;
         s2.replace(0, 0, u+1, -1);
         s3.replace(0, 0, u, 1, -1);
         if(s.compare(1, 999, s2)!=0 || s2!=s3) {
-            errln("error UnicodeString::replace(..., const UChar *, srcLength=-1, ...) does not work");
+            errln("error UnicodeString::replace(..., const char16_t *, srcLength=-1, ...) does not work");
         }
     }
 }
@@ -467,7 +467,7 @@ UnicodeStringTest::TestExtract()
 {
     UnicodeString  test1("Now is the time for all good men to come to the aid of their country.", "");
     UnicodeString  test2;
-    UChar          test3[13] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 10, 11, 12, 13};
+    char16_t       test3[13] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 10, 11, 12, 13};
     char           test4[13] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 10, 11, 12, 13};
     UnicodeString  test5;
     char           test6[13] = {1, 2, 3, 4, 5, 6, 7, 8, 8, 10, 11, 12, 13};
@@ -508,7 +508,7 @@ UnicodeStringTest::TestExtract()
             break;
         }
         if (test1.charAt((int32_t)(11 + i)) != test3[i]) {
-            errln(UnicodeString("extracting into an array of UChar failed at position ") + i);
+            errln(UnicodeString("extracting into an array of char16_t failed at position ") + i);
             break;
         }
         if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) {
@@ -537,7 +537,7 @@ UnicodeStringTest::TestExtract()
     {
         // test new, NUL-terminating extract() function
         UnicodeString s("terminate", "");
-        UChar dest[20]={
+        char16_t dest[20]={
             0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
             0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5
         };
@@ -545,7 +545,7 @@ UnicodeStringTest::TestExtract()
         int32_t length;
 
         errorCode=U_ZERO_ERROR;
-        length=s.extract((UChar *)nullptr, 0, errorCode);
+        length=s.extract((char16_t *)nullptr, 0, errorCode);
         if(errorCode!=U_BUFFER_OVERFLOW_ERROR || length!=s.length()) {
             errln("UnicodeString.extract(nullptr, 0)==%d (%s) expected %d (U_BUFFER_OVERFLOW_ERROR)", length, s.length(), u_errorName(errorCode));
         }
@@ -655,7 +655,7 @@ UnicodeStringTest::TestRemoveReplace()
 {
     UnicodeString   test1("The rain in Spain stays mainly on the plain");
     UnicodeString   test2("eat SPAMburgers!");
-    UChar         test3[] = { 0x53, 0x50, 0x41, 0x4d, 0x4d, 0 };
+    char16_t      test3[] = { 0x53, 0x50, 0x41, 0x4d, 0x4d, 0 };
     char            test4[] = "SPAM";
     UnicodeString&  test5 = test1;
 
@@ -700,10 +700,10 @@ UnicodeStringTest::TestSearching()
 {
     UnicodeString test1("test test ttest tetest testesteststt");
     UnicodeString test2("test");
-    UChar testChar = 0x74;
+    char16_t testChar = 0x74;
     
     UChar32 testChar32 = 0x20402;
-    UChar testData[]={
+    char16_t testData[]={
         //   0       1       2       3       4       5       6       7
         0xd841, 0xdc02, 0x0071, 0xdc02, 0xd841, 0x0071, 0xd841, 0xdc02,
 
@@ -862,7 +862,7 @@ UnicodeStringTest::TestSearching()
     if(test3.indexOf((UChar32)0xd841) != 4 || test3.indexOf((UChar32)0xdc02) != 3) {
         errln("error: UnicodeString::indexOf(UChar32 surrogate) finds a partial supplementary code point");
     }
-    if( UnicodeString(test3, 0, 17).lastIndexOf((UChar)0xd841, 0) != 4 ||
+    if( UnicodeString(test3, 0, 17).lastIndexOf((char16_t)0xd841, 0) != 4 ||
         UnicodeString(test3, 0, 17).lastIndexOf((UChar32)0xd841, 2) != 4 ||
         test3.lastIndexOf((UChar32)0xd841, 0, 17) != 4 || test3.lastIndexOf((UChar32)0xdc02, 0, 17) != 16
     ) {
@@ -980,8 +980,8 @@ UnicodeStringTest::TestPrefixAndSuffix()
 void
 UnicodeStringTest::TestStartsWithAndEndsWithNulTerminated() {
     UnicodeString test("abcde");
-    const UChar ab[] = { 0x61, 0x62, 0 };
-    const UChar de[] = { 0x64, 0x65, 0 };
+    const char16_t ab[] = { 0x61, 0x62, 0 };
+    const char16_t de[] = { 0x64, 0x65, 0 };
     assertTrue("abcde.startsWith(ab, -1)", test.startsWith(ab, -1));
     assertTrue("abcde.startsWith(ab, 0, -1)", test.startsWith(ab, 0, -1));
     assertTrue("abcde.endsWith(de, -1)", test.endsWith(de, -1));
@@ -1049,12 +1049,12 @@ UnicodeStringTest::TestMiscellaneous()
 
     // test getBuffer(minCapacity) and releaseBuffer()
     test1=UnicodeString(); // make sure that it starts with its stackBuffer
-    UChar *p=test1.getBuffer(20);
+    char16_t *p=test1.getBuffer(20);
     if(test1.getCapacity()<20) {
         errln("UnicodeString::getBuffer(20).getCapacity()<20");
     }
 
-    test1.append((UChar)7); // must not be able to modify the string here
+    test1.append((char16_t)7); // must not be able to modify the string here
     test1.setCharAt(3, 7);
     test1.reverse();
     if( test1.length()!=0 ||
@@ -1068,7 +1068,7 @@ UnicodeStringTest::TestMiscellaneous()
     p[1]=2;
     p[2]=3;
     test1.releaseBuffer(3);
-    test1.append((UChar)4);
+    test1.append((char16_t)4);
 
     if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.charAt(3)!=4) {
         errln("UnicodeString::releaseBuffer(newLength) does not properly reallow access to the UnicodeString");
@@ -1081,7 +1081,7 @@ UnicodeStringTest::TestMiscellaneous()
     }
 
     // test getBuffer(const)
-    const UChar *q=test1.getBuffer(), *r=test1.getBuffer();
+    const char16_t *q=test1.getBuffer(), *r=test1.getBuffer();
     if( test1.length()!=4 ||
         q[0]!=1 || q[1]!=2 || q[2]!=3 || q[3]!=4 ||
         r[0]!=1 || r[1]!=2 || r[2]!=3 || r[3]!=4
@@ -1099,7 +1099,7 @@ UnicodeStringTest::TestMiscellaneous()
     // test releaseBuffer() with a non-NUL-terminated buffer
     p=test1.getBuffer(256);
     for(int32_t i=0; i<test1.getCapacity(); ++i) {
-        p[i]=(UChar)1;      // fill the buffer with all non-NUL code units
+        p[i]=(char16_t)1;      // fill the buffer with all non-NUL code units
     }
     test1.releaseBuffer();  // implicit -1
     if(test1.length()!=test1.getCapacity() || test1.charAt(1)!=1 || test1.charAt(100)!=1 || test1.charAt(test1.getCapacity()-1)!=1) {
@@ -1114,7 +1114,7 @@ UnicodeStringTest::TestMiscellaneous()
         errln("getTerminatedBuffer()[length]!=0");
     }
 
-    const UChar u[]={ 5, 6, 7, 8, 0 };
+    const char16_t u[]={ 5, 6, 7, 8, 0 };
     test1.setTo(false, u, 3);
     q=test1.getTerminatedBuffer();
     if(q==u || q[0]!=5 || q[1]!=6 || q[2]!=7 || q[3]!=0) {
@@ -1131,20 +1131,20 @@ UnicodeStringTest::TestMiscellaneous()
     // as u" lila", offset by 3 code units
     test1=UnicodeString(true, u"la", 2);
     test1.append(UnicodeString(true, u" lila", 5).getTerminatedBuffer(), 0, -1);
-    assertEquals("UnicodeString::append(const UChar *, start, length) failed",
+    assertEquals("UnicodeString::append(const char16_t *, start, length) failed",
         u"la lila", test1);
 
     test1.insert(3, UnicodeString(true, u"dudum ", 6), 0, INT32_MAX);
     assertEquals("UnicodeString::insert(start, const UniStr &, start, length) failed",
         u"la dudum lila", test1);
 
-    static const UChar ucs[]={ 0x68, 0x6d, 0x20, 0 };
+    static const char16_t ucs[]={ 0x68, 0x6d, 0x20, 0 };
     test1.insert(9, ucs, -1);
-    assertEquals("UnicodeString::insert(start, const UChar *, length) failed",
+    assertEquals("UnicodeString::insert(start, const char16_t *, length) failed",
         u"la dudum hm lila", test1);
 
-    test1.replace(9, 2, (UChar)0x2b);
-    assertEquals("UnicodeString::replace(start, length, UChar) failed",
+    test1.replace(9, 2, (char16_t)0x2b);
+    assertEquals("UnicodeString::replace(start, length, char16_t) failed",
         u"la dudum + lila", test1);
 
     if(test1.hasMetaData() || UnicodeString().hasMetaData()) {
@@ -1187,9 +1187,9 @@ UnicodeStringTest::TestMiscellaneous()
 void
 UnicodeStringTest::TestStackAllocation()
 {
-    UChar           testString[] ={ 
+    char16_t        testString[] ={
         0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x63, 0x72, 0x61, 0x7a, 0x79, 0x20, 0x74, 0x65, 0x73, 0x74, 0x2e, 0 };
-    UChar           guardWord = 0x4DED;
+    char16_t        guardWord = 0x4DED;
     UnicodeString*  test = 0;
 
     test = new  UnicodeString(testString);
@@ -1209,13 +1209,13 @@ UnicodeStringTest::TestStackAllocation()
     // explicitly, since we can't overload operator delete
     delete test;
 
-    UChar workingBuffer[] = {
+    char16_t workingBuffer[] = {
         0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20,
         0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d, 0x65, 0x6e, 0x20, 0x74, 0x6f, 0x20,
         0x63, 0x6f, 0x6d, 0x65, 0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-    UChar guardWord2 = 0x4DED;
+    char16_t guardWord2 = 0x4DED;
 
     test = new UnicodeString(workingBuffer, 35, 100);
     if (*test != "Now is the time for all men to come")
@@ -1280,11 +1280,11 @@ UnicodeStringTest::TestStackAllocation()
     delete test;
      
     test=new UnicodeString();
-    UChar buffer[]={0x0061, 0x0062, 0x20ac, 0x0043, 0x0042, 0x0000};
+    char16_t buffer[]={0x0061, 0x0062, 0x20ac, 0x0043, 0x0042, 0x0000};
     test->setTo(buffer, 4, 10);
     if(test->length() !=4 || test->charAt(0) != 0x0061 || test->charAt(1) != 0x0062 ||
         test->charAt(2) != 0x20ac || test->charAt(3) != 0x0043){
-        errln((UnicodeString)"UnicodeString.setTo(UChar*, length, capacity) does not work correctly\n" + prettify(*test));
+        errln((UnicodeString)"UnicodeString.setTo(char16_t*, length, capacity) does not work correctly\n" + prettify(*test));
     }
     delete test;
 
@@ -1326,14 +1326,14 @@ UnicodeStringTest::TestStackAllocation()
 void UnicodeStringTest::TestUnescape(void) {
     UnicodeString IN("abc\\u4567 \\n\\r \\U00101234xyz\\x1\\x{5289}\\x1b", -1, US_INV);
     UnicodeString OUT("abc");
-    OUT.append((UChar)0x4567);
+    OUT.append((char16_t)0x4567);
     OUT.append(" ");
-    OUT.append((UChar)0xA);
-    OUT.append((UChar)0xD);
+    OUT.append((char16_t)0xA);
+    OUT.append((char16_t)0xD);
     OUT.append(" ");
     OUT.append((UChar32)0x00101234);
     OUT.append("xyz");
-    OUT.append((UChar32)1).append((UChar32)0x5289).append((UChar)0x1b);
+    OUT.append((UChar32)1).append((UChar32)0x5289).append((char16_t)0x1b);
     UnicodeString result = IN.unescape();
     if (result != OUT) {
         errln("FAIL: " + prettify(IN) + ".unescape() -> " +
@@ -1389,7 +1389,7 @@ UnicodeStringTest::TestCountChar32(void) {
         }
 
         // NUL-terminate the string buffer and test u_countChar32(length=-1)
-        const UChar *buffer=s.getTerminatedBuffer();
+        const char16_t *buffer=s.getTerminatedBuffer();
         if(
             u_countChar32(buffer, -1)!=4 ||
             u_countChar32(buffer+1, -1)!=4 ||
@@ -1409,7 +1409,7 @@ UnicodeStringTest::TestCountChar32(void) {
     }
 
     /* test data and variables for hasMoreChar32Than() */
-    static const UChar str[]={
+    static const char16_t str[]={
         0x61, 0x62, 0xd800, 0xdc00,
         0xd801, 0xdc01, 0x63, 0xd802,
         0x64, 0xdc03, 0x65, 0x66,
@@ -1484,13 +1484,13 @@ UnicodeStringTest::TestBogus() {
 
     // verify that non-assignment modifications fail and do not revive a bogus string
     test3.setToBogus();
-    test3.append((UChar)0x61);
+    test3.append((char16_t)0x61);
     if(!test3.isBogus() || test3.getBuffer()!=0) {
         errln("bogus.append('a') worked but must not");
     }
 
     test3.setToBogus();
-    test3.findAndReplace(UnicodeString((UChar)0x61), test2);
+    test3.findAndReplace(UnicodeString((char16_t)0x61), test2);
     if(!test3.isBogus() || test3.getBuffer()!=0) {
         errln("bogus.findAndReplace() worked but must not");
     }
@@ -1545,12 +1545,12 @@ UnicodeStringTest::TestBogus() {
 
     test3.setToBogus();
     if(!test3.isBogus() || test3.setTo(test1.getBuffer(), test1.length()).isBogus() || test3!=test1) {
-        errln("bogus.setTo(const UChar *, len) failed");
+        errln("bogus.setTo(const char16_t *, len) failed");
     }
 
     test3.setToBogus();
-    if(!test3.isBogus() || test3.setTo((UChar)0x2028).isBogus() || test3!=UnicodeString((UChar)0x2028)) {
-        errln("bogus.setTo(UChar) failed");
+    if(!test3.isBogus() || test3.setTo((char16_t)0x2028).isBogus() || test3!=UnicodeString((char16_t)0x2028)) {
+        errln("bogus.setTo(char16_t) failed");
     }
 
     test3.setToBogus();
@@ -1566,7 +1566,7 @@ UnicodeStringTest::TestBogus() {
     // writable alias to another string's buffer: very bad idea, just convenient for this test
     test3.setToBogus();
     if(!test3.isBogus() ||
-            test3.setTo(const_cast<UChar *>(test1.getBuffer()),
+            test3.setTo(const_cast<char16_t *>(test1.getBuffer()),
                         test1.length(), test1.getCapacity()).isBogus() ||
             test3!=test1) {
         errln("bogus.setTo(writable alias) failed");
@@ -1603,7 +1603,7 @@ UnicodeStringTest::TestBogus() {
         errln("bogus.setTo((UChar32)-1) failed");
     }
 
-    static const UChar nul=0;
+    static const char16_t nul=0;
 
     test3.setToBogus();
     if(!test3.isBogus() || test3.setTo(&nul, 0).isBogus() || !test3.isEmpty()) {
@@ -1629,17 +1629,17 @@ UnicodeStringTest::TestBogus() {
 
     UErrorCode errorCode=U_ZERO_ERROR;
     UnicodeString
-        test4((const UChar *)nullptr),
-        test5(true, (const UChar *)nullptr, 1),
-        test6((UChar *)nullptr, 5, 5),
+        test4((const char16_t *)nullptr),
+        test5(true, (const char16_t *)nullptr, 1),
+        test6((char16_t *)nullptr, 5, 5),
         test7((const char *)nullptr, 3, nullptr, errorCode);
     if(test4.isBogus() || test5.isBogus() || test6.isBogus() || test7.isBogus()) {
         errln("a constructor set to bogus for a nullptr input string, should be empty");
     }
 
     test4.setTo(nullptr, 3);
-    test5.setTo(true, (const UChar *)nullptr, 1);
-    test6.setTo((UChar *)nullptr, 5, 5);
+    test5.setTo(true, (const char16_t *)nullptr, 1);
+    test6.setTo((char16_t *)nullptr, 5, 5);
     if(test4.isBogus() || test5.isBogus() || test6.isBogus()) {
         errln("a setTo() set to bogus for a nullptr input string, should be empty");
     }
@@ -1721,7 +1721,7 @@ UnicodeStringTest::TestStringEnumeration() {
     int32_t i, length;
     UErrorCode status;
 
-    const UChar *pu;
+    const char16_t *pu;
     const char *pc;
 
     // test the next() default implementation and ensureCharsCapacity()
@@ -1810,7 +1810,7 @@ namespace bogus {
     public:
         enum EInvariant { kInvariant };
         UnicodeString() : i(1) {}
-        UnicodeString(UBool /*isTerminated*/, const UChar * /*text*/, int32_t textLength) : i(textLength) {(void)i;}
+        UnicodeString(UBool /*isTerminated*/, const char16_t * /*text*/, int32_t textLength) : i(textLength) {(void)i;}
         UnicodeString(const char * /*src*/, int32_t length, enum EInvariant /*inv*/
 ) : i(length) {}
     private:
@@ -1844,7 +1844,7 @@ UnicodeStringTest::TestUTF32() {
         0x41, 0xd900, 0x61, 0xdc00, -1, 0x110000, 0x5a, 0x50000, 0x7a,
         0x10000, 0x20000, 0xe0000, 0x10ffff
     };
-    static const UChar expected_utf16[] = {
+    static const char16_t expected_utf16[] = {
         0x41, 0xfffd, 0x61, 0xfffd, 0xfffd, 0xfffd, 0x5a, 0xd900, 0xdc00, 0x7a,
         0xd800, 0xdc00, 0xd840, 0xdc00, 0xdb40, 0xdc00, 0xdbff, 0xdfff
     };
@@ -1854,7 +1854,7 @@ UnicodeStringTest::TestUTF32() {
         errln("UnicodeString::fromUTF32() did not create the expected string.");
     }
 
-    static const UChar utf16[] = {
+    static const char16_t utf16[] = {
         0x41, 0xd900, 0x61, 0xdc00, 0x5a, 0xd900, 0xdc00, 0x7a, 0xd800, 0xdc00, 0xdbff, 0xdfff
     };
     static const UChar32 expected_utf32[] = {
@@ -1898,7 +1898,7 @@ UnicodeStringTest::TestUTF8() {
         0xf0, 0x90, 0x80, 0x80, 0xf0, 0xa0, 0x80, 0x80,
         0xf3, 0xa0, 0x80, 0x80, 0xf4, 0x8f, 0xbf, 0xbf
     };
-    static const UChar expected_utf16[] = {
+    static const char16_t expected_utf16[] = {
         0x41, 0xfffd, 0xfffd, 0xfffd,
         0x61, 0xfffd, 0xfffd, 0xfffd,
         0xfffd,  0xfffd, 0xfffd, 0xfffd,0x5a,
@@ -1918,7 +1918,7 @@ UnicodeStringTest::TestUTF8() {
         errln("UnicodeString::fromUTF8(std::string) did not create the expected string.");
     }
 
-    static const UChar utf16[] = {
+    static const char16_t utf16[] = {
         0x41, 0xd900, 0x61, 0xdc00, 0x5a, 0xd900, 0xdc00, 0x7a, 0xd800, 0xdc00, 0xdbff, 0xdfff
     };
     static const uint8_t expected_utf8[] = {
@@ -1949,13 +1949,13 @@ UnicodeStringTest::TestUTF8() {
 }
 
 // Test if this compiler supports Return Value Optimization of unnamed temporary objects.
-static UnicodeString wrapUChars(const UChar *uchars) {
+static UnicodeString wrapUChars(const char16_t *uchars) {
     return UnicodeString(true, uchars, -1);
 }
 
 void
 UnicodeStringTest::TestReadOnlyAlias() {
-    UChar uchars[]={ 0x61, 0x62, 0 };
+    char16_t uchars[]={ 0x61, 0x62, 0 };
     UnicodeString alias(true, uchars, 2);
     if(alias.length()!=2 || alias.getBuffer()!=uchars || alias.getTerminatedBuffer()!=uchars) {
         errln("UnicodeString read-only-aliasing constructor does not behave as expected.");
@@ -2017,7 +2017,7 @@ UnicodeStringTest::TestReadOnlyAlias() {
         errln("UnicodeString.setTo(read-only-alias).retainBetween(6, 30) did not preserve aliasing as expected.");
     }
 
-    UChar abc[]={ 0x61, 0x62, 0x63, 0 };
+    char16_t abc[]={ 0x61, 0x62, 0x63, 0 };
     UBool hasRVO= wrapUChars(abc).getBuffer()==abc;
 
     UnicodeString temp;
@@ -2055,8 +2055,8 @@ UnicodeStringTest::TestReadOnlyAlias() {
 
 void
 UnicodeStringTest::doTestAppendable(UnicodeString &dest, Appendable &app) {
-    static const UChar cde[3]={ 0x63, 0x64, 0x65 };
-    static const UChar fg[3]={ 0x66, 0x67, 0 };
+    static const char16_t cde[3]={ 0x63, 0x64, 0x65 };
+    static const char16_t fg[3]={ 0x66, 0x67, 0 };
     if(!app.reserveAppendCapacity(12)) {
         errln("Appendable.reserve(12) failed");
     }
@@ -2065,14 +2065,14 @@ UnicodeStringTest::doTestAppendable(UnicodeString &dest, Appendable &app) {
     app.appendCodePoint(0x50000);
     app.appendString(cde, 3);
     app.appendString(fg, -1);
-    UChar scratch[3];
+    char16_t scratch[3];
     int32_t capacity=-1;
-    UChar *buffer=app.getAppendBuffer(3, 3, scratch, 3, &capacity);
+    char16_t *buffer=app.getAppendBuffer(3, 3, scratch, 3, &capacity);
     if(capacity<3) {
         errln("Appendable.getAppendBuffer(min=3) returned capacity=%d<3", (int)capacity);
         return;
     }
-    static const UChar hij[3]={ 0x68, 0x69, 0x6a };
+    static const char16_t hij[3]={ 0x68, 0x69, 0x6a };
     u_memcpy(buffer, hij, 3);
     app.appendString(buffer, 3);
     if(dest!=UNICODE_STRING_SIMPLE("ab\\U00050000cdefghij").unescape()) {
@@ -2092,7 +2092,7 @@ UnicodeStringTest::doTestAppendable(UnicodeString &dest, Appendable &app) {
 class SimpleAppendable : public Appendable {
 public:
     explicit SimpleAppendable(UnicodeString &dest) : str(dest) {}
-    virtual UBool appendCodeUnit(UChar c) override { str.append(c); return true; }
+    virtual UBool appendCodeUnit(char16_t c) override { str.append(c); return true; }
     SimpleAppendable &reset() { str.remove(); return *this; }
 private:
     UnicodeString &str;
@@ -2132,16 +2132,16 @@ UnicodeStringTest::TestSizeofUnicodeString() {
     // is available for internal storage of UChars.
     int32_t expectedStackBufferLength=((int32_t)UNISTR_OBJECT_SIZE-sizeof(void *)-2)/U_SIZEOF_UCHAR;
     UnicodeString s;
-    const UChar *emptyBuffer=s.getBuffer();
+    const char16_t *emptyBuffer=s.getBuffer();
     for(int32_t i=0; i<expectedStackBufferLength; ++i) {
-        s.append((UChar)0x2e);
+        s.append((char16_t)0x2e);
     }
-    const UChar *fullBuffer=s.getBuffer();
+    const char16_t *fullBuffer=s.getBuffer();
     if(fullBuffer!=emptyBuffer) {
         errln("unexpected reallocation when filling with assumed stack buffer size of %d",
               expectedStackBufferLength);
     }
-    const UChar *terminatedBuffer=s.getTerminatedBuffer();
+    const char16_t *terminatedBuffer=s.getTerminatedBuffer();
     if(terminatedBuffer==emptyBuffer) {
         errln("unexpected keeping stack buffer when overfilling assumed stack buffer size of %d",
               expectedStackBufferLength);
@@ -2155,11 +2155,11 @@ void moveFrom(UnicodeString &dest, UnicodeString &src) {
 
 void
 UnicodeStringTest::TestMoveSwap() {
-    static const UChar abc[3] = { 0x61, 0x62, 0x63 };  // "abc"
+    static const char16_t abc[3] = { 0x61, 0x62, 0x63 };  // "abc"
     UnicodeString s1(false, abc, UPRV_LENGTHOF(abc));  // read-only alias
     UnicodeString s2(100, 0x7a, 100);  // 100 * 'z' should be on the heap
     UnicodeString s3("defg", 4, US_INV);  // in stack buffer
-    const UChar *p = s2.getBuffer();
+    const char16_t *p = s2.getBuffer();
     s1.swap(s2);
     if(s1.getBuffer() != p || s1.length() != 100 || s2.getBuffer() != abc || s2.length() != 3) {
         errln("UnicodeString.swap() did not swap");
index 6df2579c969dada9e510ff8f7746a7de376cffb5..5e7f5809e1ca4d14f7083c80f5e40a2e620d9232 100644 (file)
@@ -102,7 +102,7 @@ const uint32_t severeErrors=
     UIDNA_ERROR_INVALID_ACE_LABEL;
 
 static UBool isASCII(const UnicodeString &str) {
-    const UChar *s=str.getBuffer();
+    const char16_t *s=str.getBuffer();
     int32_t length=str.length();
     for(int32_t i=0; i<length; ++i) {
         if(s[i]>=0x80) {
@@ -852,7 +852,7 @@ void UTS46Test::TestSomeCases() {
         ) {
             continue;
         }
-        if(aN.indexOf((UChar)0x2e)<0) {
+        if(aN.indexOf((char16_t)0x2e)<0) {
             if(aN!=aNL || aNInfo.getErrors()!=aNLInfo.getErrors()) {
                 prettify(aN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 prettify(aNL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
@@ -868,7 +868,7 @@ void UTS46Test::TestSomeCases() {
                 continue;
             }
         }
-        if(aT.indexOf((UChar)0x2e)<0) {
+        if(aT.indexOf((char16_t)0x2e)<0) {
             if(aT!=aTL || aTInfo.getErrors()!=aTLInfo.getErrors()) {
                 prettify(aT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 prettify(aTL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
@@ -884,7 +884,7 @@ void UTS46Test::TestSomeCases() {
                 continue;
             }
         }
-        if(uN.indexOf((UChar)0x2e)<0) {
+        if(uN.indexOf((char16_t)0x2e)<0) {
             if(uN!=uNL || uNInfo.getErrors()!=uNLInfo.getErrors()) {
                 prettify(uN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 prettify(uNL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
@@ -900,7 +900,7 @@ void UTS46Test::TestSomeCases() {
                 continue;
             }
         }
-        if(uT.indexOf((UChar)0x2e)<0) {
+        if(uT.indexOf((char16_t)0x2e)<0) {
             if(uT!=uTL || uTInfo.getErrors()!=uTLInfo.getErrors()) {
                 prettify(uT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 prettify(uTL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
index cd570269f687315fb143471574d938832ed87ca9..e9bc2c8f72fc1d08c9bfea531df4a8c9be1bd670 100644 (file)
@@ -104,9 +104,9 @@ void  UTextTest::TextTest() {
         for (j=0; j<i; j++) {
             if (j+0x30 == 0x5c) {
                 // backslash.  Needs to be escaped
-                s.append((UChar)0x5c);
+                s.append((char16_t)0x5c);
             }
-            s.append(UChar(j+0x30));
+            s.append(char16_t(j+0x30));
         }
         TestString(s);
     }
@@ -115,7 +115,7 @@ void  UTextTest::TextTest() {
    //    looking for glitches at buffer boundaries
     for (i=1; i<60; i++) {
         s.truncate(0);
-        s.append((UChar)0x41);
+        s.append((char16_t)0x41);
         for (j=0; j<i; j++) {
             s.append(UChar32(j+0x11000));
         }
@@ -188,9 +188,9 @@ void UTextTest::TestString(const UnicodeString &s) {
     cpMap[j].nativeIdx = i;   // position following the last char in utf-16 string.
 
 
-    // UChar * test, null terminated
+    // char16_t * test, null terminated
     status = U_ZERO_ERROR;
-    UChar *buf = new UChar[saLen+1];
+    char16_t *buf = new char16_t[saLen+1];
     sa.extract(buf, saLen+1, status);
     TEST_SUCCESS(status);
     ut = utext_openUChars(nullptr, buf, -1, &status);
@@ -199,9 +199,9 @@ void UTextTest::TestString(const UnicodeString &s) {
     utext_close(ut);
     delete [] buf;
 
-    // UChar * test, with length
+    // char16_t * test, with length
     status = U_ZERO_ERROR;
-    buf = new UChar[saLen+1];
+    buf = new char16_t[saLen+1];
     sa.extract(buf, saLen+1, status);
     TEST_SUCCESS(status);
     ut = utext_openUChars(nullptr, buf, saLen, &status);
@@ -238,7 +238,7 @@ void UTextTest::TestString(const UnicodeString &s) {
 
     // Character Iterator Tests
     status = U_ZERO_ERROR;
-    const UChar *cbuf = sa.getBuffer();
+    const char16_t *cbuf = sa.getBuffer();
     CharacterIterator *ci = new UCharCharacterIterator(cbuf, saLen, status);
     TEST_SUCCESS(status);
     ut = utext_openCharacterIterator(nullptr, ci, &status);
@@ -510,7 +510,7 @@ void UTextTest::TestReplace(
     //
     // Do the replace on the UText under test
     //
-    const UChar *rs = repStr.getBuffer();
+    const char16_t *rs = repStr.getBuffer();
     int32_t  rsLen = repStr.length();
     int32_t actualDelta = utext_replace(targetUT, nativeStart, nativeLimit, rs, rsLen, &status);
     int32_t expectedDelta = repStr.length() - (nativeLimit - nativeStart);
@@ -799,7 +799,7 @@ void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCoun
     // Extract
     //
     int bufSize = us.length() + 10;
-    UChar *buf = new UChar[bufSize];
+    char16_t *buf = new char16_t[bufSize];
     status = U_ZERO_ERROR;
     expectedLen = us.length();
     len = utext_extract(ut, 0, utlen, buf, bufSize, &status);
@@ -881,7 +881,7 @@ void UTextTest::ErrorTest()
         UText ut = UTEXT_INITIALIZER;
         UText  *utp;
         UnicodeString s1("Hello, World");
-        UChar s2[] = {(UChar)0x41, (UChar)0x42, (UChar)0};
+        char16_t s2[] = {(char16_t)0x41, (char16_t)0x42, (char16_t)0};
         const char  *s3 = "\x66\x67\x68";
 
         utp = utext_openUnicodeString(&ut, &s1, &status);
@@ -951,7 +951,7 @@ void UTextTest::ErrorTest()
         c = utext_char32At(ut, 6);
         TEST_ASSERT(c == 0x43);
 
-        UChar buf[10];
+        char16_t buf[10];
         int n = utext_extract(ut, 0, 9, buf, 10, &status);
         TEST_SUCCESS(status);
         TEST_ASSERT(n==7);
@@ -975,7 +975,7 @@ void UTextTest::ErrorTest()
         UnicodeString sa("Hello, this is a string");
         UBool  isExpensive;
 
-        UChar sb[100];
+        char16_t sb[100];
         memset(sb, 0x20, sizeof(sb));
         sb[99] = 0;
 
@@ -1056,7 +1056,7 @@ void UTextTest::ErrorTest()
         //   Extract from i to i+1, which may be zero or one code points,
         //     depending on whether the indices straddle a cp boundary.
         for (i=0; i<startMapLimit; i++) {
-            UChar buf[3];
+            char16_t buf[3];
             status = U_ZERO_ERROR;
             int32_t  extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
             TEST_SUCCESS(status);
@@ -1125,7 +1125,7 @@ void UTextTest::ErrorTest()
         //   Extract from i to i+1, which may be zero or one code points,
         //     depending on whether the indices straddle a cp boundary.
         for (i=0; i<startMapLimit; i++) {
-            UChar buf[3];
+            char16_t buf[3];
             status = U_ZERO_ERROR;
             int32_t  extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
             TEST_SUCCESS(status);
@@ -1193,7 +1193,7 @@ void UTextTest::ErrorTest()
         //   Extract from i to i+1, which may be zero or one code points,
         //     depending on whether the indices straddle a cp boundary.
         for (i=0; i<startMapLimit; i++) {
-            UChar buf[3];
+            char16_t buf[3];
             status = U_ZERO_ERROR;
             int32_t  extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
             TEST_SUCCESS(status);
@@ -1217,7 +1217,7 @@ void UTextTest::FreezeTest() {
 
     UnicodeString  ustr("Hello, World.");
     const char u8str[] = {char(0x31), (char)0x32, (char)0x33, 0};
-    const UChar u16str[] = {(UChar)0x31, (UChar)0x32, (UChar)0x44, 0};
+    const char16_t u16str[] = {(char16_t)0x31, (char16_t)0x32, (char16_t)0x44, 0};
 
     UErrorCode status = U_ZERO_ERROR;
     UText  *ut        = nullptr;
@@ -1312,7 +1312,7 @@ U_CDECL_BEGIN
 static UBool U_CALLCONV
 fragTextAccess(UText *ut, int64_t index, UBool forward) {
     const UnicodeString *us = (const UnicodeString *)ut->context;
-    UChar  c;
+    char16_t  c;
     int32_t length = us->length();
     if (forward && index>=0 && index<length) {
         c = us->charAt((int32_t)index);
@@ -1384,7 +1384,7 @@ openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) {
     fragmentFuncs.clone  = cloneFragmentedUnicodeString;
     ut->pFuncs = &fragmentFuncs;
 
-    ut->chunkContents = (UChar *)&ut->b;
+    ut->chunkContents = (char16_t *)&ut->b;
     ut->pFuncs->access(ut, 0, true);
     return ut;
 }
@@ -1410,7 +1410,7 @@ void UTextTest::Ticket5560() {
        UText ut2 = UTEXT_INITIALIZER;
 
        utext_openUTF8(&ut1, s1, -1, &status);
-       UChar c = utext_next32(&ut1);
+       char16_t c = utext_next32(&ut1);
        TEST_ASSERT(c == 0x41);  // c == 'A'
 
        utext_clone(&ut2, &ut1, true, false, &status);
@@ -1435,7 +1435,7 @@ void UTextTest::Ticket5560() {
 //
 void UTextTest::Ticket6847() {
     const int STRLEN = 90;
-    UChar s[STRLEN+1];
+    char16_t s[STRLEN+1];
     u_memset(s, 0x41, STRLEN);
     s[STRLEN] = 0;
 
@@ -1509,7 +1509,7 @@ void UTextTest::Ticket10983() {
     utext_close(ut);
 }
 
-// Ticket 12130 - extract on a UText wrapping a null terminated UChar * string
+// Ticket 12130 - extract on a UText wrapping a null terminated char16_t * string
 //                leaves the iteration position set incorrectly when the
 //                actual string length is not yet known.
 //
@@ -1528,10 +1528,10 @@ void UTextTest::Ticket12130() {
         "symbols in common use.";
 
     UnicodeString str(text8);
-    const UChar *ustr = str.getTerminatedBuffer();
+    const char16_t *ustr = str.getTerminatedBuffer();
     UText ut = UTEXT_INITIALIZER;
     utext_openUChars(&ut, ustr, -1, &status);
-    UChar extractBuffer[50];
+    char16_t extractBuffer[50];
 
     for (int32_t startIdx = 0; startIdx<str.length(); ++startIdx) {
         int32_t endIdx = startIdx + 20;
index c64314e20ee7bb29716327770303e5b8378a83a5..295ea0a79889e027c721e27df30d8f5ca9eaf94f 100644 (file)
@@ -173,33 +173,33 @@ void Win32DateTimeTest::testLocales(DateFormatTest *log)
         wdf->format(icuNow, udBuffer);
         wtf->format(icuNow, utBuffer);
 
-        if (ubBuffer.indexOf((const UChar *)wdBuffer, wdLength - 1, 0) < 0) {
+        if (ubBuffer.indexOf((const char16_t *)wdBuffer, wdLength - 1, 0) < 0) {
             UnicodeString baseName(wlocale.getBaseName());
-            UnicodeString expected((const UChar *)wdBuffer);
+            UnicodeString expected((const char16_t *)wdBuffer);
 
             log->errln("DateTime format error for locale " + baseName + ": expected date \"" + expected +
                        "\" got \"" + ubBuffer + "\"");
         }
 
-        if (ubBuffer.indexOf((const UChar *)wtBuffer, wtLength - 1, 0) < 0) {
+        if (ubBuffer.indexOf((const char16_t *)wtBuffer, wtLength - 1, 0) < 0) {
             UnicodeString baseName(wlocale.getBaseName());
-            UnicodeString expected((const UChar *)wtBuffer);
+            UnicodeString expected((const char16_t *)wtBuffer);
 
             log->errln("DateTime format error for locale " + baseName + ": expected time \"" + expected +
                        "\" got \"" + ubBuffer + "\"");
         }
 
-        if (udBuffer.compare((const UChar *)wdBuffer) != 0) {
+        if (udBuffer.compare((const char16_t *)wdBuffer) != 0) {
             UnicodeString baseName(wlocale.getBaseName());
-            UnicodeString expected((const UChar *)wdBuffer);
+            UnicodeString expected((const char16_t *)wdBuffer);
 
             log->errln("Date format error for locale " + baseName + ": expected \"" + expected +
                        "\" got \"" + udBuffer + "\"");
         }
 
-        if (utBuffer.compare((const UChar *)wtBuffer) != 0) {
+        if (utBuffer.compare((const char16_t *)wtBuffer) != 0) {
             UnicodeString baseName(wlocale.getBaseName());
-            UnicodeString expected((const UChar *)wtBuffer);
+            UnicodeString expected((const char16_t *)wtBuffer);
 
             log->errln("Time format error for locale " + baseName + ": expected \"" + expected +
                        "\" got \"" + utBuffer + "\"");
index 2ad25e7d13c32deccbe2e2cdc10407d8a838d8e5..638cdef6362d7d5fc5fb7d0e8f5fd7974c601fbb 100644 (file)
@@ -159,7 +159,7 @@ static UnicodeString &getWindowsFormat(int32_t lcid, UBool currency, UnicodeStri
         newLength = _vscwprintf(fmt, args);
         va_end(args);
 
-        nBuffer = NEW_ARRAY(UChar, newLength + 1);
+        nBuffer = NEW_ARRAY(char16_t, newLength + 1);
 
         va_start(args, fmt);
         result = _vsnwprintf(nBuffer, newLength + 1, fmt, args);
@@ -218,7 +218,7 @@ static UnicodeString &getWindowsFormat(int32_t lcid, UBool currency, UnicodeStri
         }
     }
 
-    appendTo.append((const UChar *)buffer, (int32_t) wcslen(buffer));
+    appendTo.append((const char16_t *)buffer, (int32_t) wcslen(buffer));
 
     if (buffer != stackBuffer) {
         DELETE_ARRAY(buffer);
index eddffd7a2d648279e95830caf32e9f442b871829..9867018d8fa52569de72facc76dbf7980ca9f241 100644 (file)
@@ -176,7 +176,7 @@ char* DataDrivenLogger::fgTestDataPath = nullptr;
 
 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_FILE_IO
 static int64_t
-uto64(const UChar     *buffer)
+uto64(const char16_t  *buffer)
 {
     uint64_t result = 0;
     /* iterate through buffer */
@@ -184,7 +184,7 @@ uto64(const UChar     *buffer)
         /* read the next digit */
         result *= 16u;
         if (!u_isxdigit(*buffer)) {
-            log_err("\\u%04X is not a valid hex digit for this test\n", (UChar)*buffer);
+            log_err("\\u%04X is not a valid hex digit for this test\n", (char16_t)*buffer);
         }
         result += *buffer - 0x0030 - (*buffer >= 0x0041 ? (*buffer >= 0x0061 ? 39 : 7) : 0);
         buffer++;
@@ -202,14 +202,14 @@ static void U_CALLCONV DataDrivenPrintf(void)
     TestData *testData;
     const DataMap *testCase;
     DataDrivenLogger logger;
-    UChar uBuffer[512];
+    char16_t uBuffer[512];
     char cBuffer[512];
     char cFormat[sizeof(cBuffer)];
     char cExpected[sizeof(cBuffer)];
     UnicodeString tempStr;
-    UChar format[512];
-    UChar expectedResult[512];
-    UChar argument[512];
+    char16_t format[512];
+    char16_t expectedResult[512];
+    char16_t argument[512];
     int32_t i;
     int8_t i8;
     int16_t i16;
@@ -287,7 +287,7 @@ static void U_CALLCONV DataDrivenPrintf(void)
                     uBufferLenReturned = u_sprintf_u(uBuffer, format, cBuffer);
                     uFileBufferLenReturned = u_fprintf_u(testFile.getAlias(), format, cBuffer);
                     break;
-                case 0x53:  // 'S' UChar *
+                case 0x53:  // 'S' char16_t *
                     uBufferLenReturned = u_sprintf_u(uBuffer, format, argument);
                     uFileBufferLenReturned = u_fprintf_u(testFile.getAlias(), format, argument);
                     break;
@@ -405,13 +405,13 @@ static void U_CALLCONV DataDrivenScanf(void)
     TestData *testData;
     const DataMap *testCase;
     DataDrivenLogger logger;
-    UChar uBuffer[512];
+    char16_t uBuffer[512];
     char cBuffer[512];
     char cExpected[sizeof(cBuffer)];
     UnicodeString tempStr;
-    UChar format[512];
-    UChar expectedResult[512];
-    UChar argument[512];
+    char16_t format[512];
+    char16_t expectedResult[512];
+    char16_t argument[512];
     int32_t i;
     int8_t i8, expected8;
     int16_t i16, expected16;
@@ -520,13 +520,13 @@ static void U_CALLCONV DataDrivenScanf(void)
                         log_err("error in scanf char * string. Got \"%s\" Expected \"%s\". Test case = %d\n", cBuffer, cExpected, i);
                     }
                     break;
-                case 0x53:  // 'S' UChar *
+                case 0x53:  // 'S' char16_t *
                     uBufferLenReturned = u_sscanf_u(argument, format, uBuffer);
                     //uFileBufferLenReturned = u_fscanf_u(testFile, format, argument);
                     if (u_strcmp(uBuffer, expectedResult) != 0) {
                         u_austrcpy(cExpected, format);
                         u_austrcpy(cBuffer, uBuffer);
-                        log_err("error in scanf UChar * string %s Got: \"%s\". Test case = %d\n", cExpected, cBuffer, i);
+                        log_err("error in scanf char16_t * string %s Got: \"%s\". Test case = %d\n", cExpected, cBuffer, i);
                     }
                     break;
                 default:
@@ -607,14 +607,14 @@ static void U_CALLCONV DataDrivenPrintfPrecision(void)
     TestData *testData;
     const DataMap *testCase;
     DataDrivenLogger logger;
-    UChar uBuffer[512];
+    char16_t uBuffer[512];
     char cBuffer[512];
     char cFormat[sizeof(cBuffer)];
     char cExpected[sizeof(cBuffer)];
     UnicodeString tempStr;
-    UChar format[512];
-    UChar expectedResult[512];
-    UChar argument[512];
+    char16_t format[512];
+    char16_t expectedResult[512];
+    char16_t argument[512];
     int32_t precision;
     int32_t i;
     int8_t i8;
@@ -678,7 +678,7 @@ static void U_CALLCONV DataDrivenPrintfPrecision(void)
                     u_austrncpy(cBuffer, uBuffer, sizeof(cBuffer));
                     uBufferLenReturned = u_sprintf_u(uBuffer, format, precision, cBuffer);
                     break;
-                case 0x53:  // 'S' UChar *
+                case 0x53:  // 'S' char16_t *
                     uBufferLenReturned = u_sprintf_u(uBuffer, format, precision, argument);
                     break;
                 default:
index 0ffc62390632ef9078e259ef5a5085f1a64b9a58..f325b0545af51ef3ae00a3f9ecc4672f77ff7ba3 100644 (file)
@@ -38,11 +38,11 @@ using namespace std;
 
 U_CDECL_BEGIN
 #if U_PLATFORM_USES_ONLY_WIN32_API
-const UChar NEW_LINE[] = {0x0d,0x0a,0};
+const char16_t NEW_LINE[] = {0x0d,0x0a,0};
 const char C_NEW_LINE[] = {0x0d,0x0a,0};
 #define UTF8_NEW_LINE "\x0d\x0a"
 #else
-const UChar NEW_LINE[] = {0x0a,0};
+const char16_t NEW_LINE[] = {0x0a,0};
 const char C_NEW_LINE[] = {'\n',0};
 #define UTF8_NEW_LINE "\x0a"
 #endif
@@ -51,8 +51,8 @@ U_CDECL_END
 U_CDECL_BEGIN
 static void U_CALLCONV TestStream(void)
 {
-    const UChar thisMu[] = { 0x74, 0x48, 0x69, 0x73, 0x3BC, 0};
-    const UChar mu[] = { 0x6D, 0x75, 0};
+    const char16_t thisMu[] = { 0x74, 0x48, 0x69, 0x73, 0x3BC, 0};
+    const char16_t mu[] = { 0x6D, 0x75, 0};
     UnicodeString str1 = UNICODE_STRING_SIMPLE("str1");
     UnicodeString str2 = UNICODE_STRING_SIMPLE(" <<");
     UnicodeString str3 = UNICODE_STRING_SIMPLE("2");
@@ -152,7 +152,7 @@ static void U_CALLCONV TestStream(void)
     memset(testLargeStreamBuf, 0, sizeof(testLargeStreamBuf));
     ostrstream outLargeStream(testLargeStreamBuf, sizeof(testLargeStreamBuf));
 #endif
-    UChar large_array[200];
+    char16_t large_array[200];
     int32_t large_array_length = UPRV_LENGTHOF(large_array);
     for (int32_t i = 0; i < large_array_length; i++) {
         large_array[i] = 0x41;
@@ -219,7 +219,7 @@ void
 testString(
             UnicodeString&  str,
             const char*     testString,
-            const UChar*    expectedString,
+            const char16_t*    expectedString,
             int32_t         expectedStatus)
 {
 #ifdef USE_SSTREAM
index 0dd6ec9f21b481b4129bae909ca8513e7f643c35..397064d241d2bae165ab788c4de4a5bff0cb9555 100644 (file)
@@ -47,7 +47,7 @@ using namespace std;
 #else
 #define _UNICODE
 typedef int DWORD;
-inline int FoldStringW(DWORD dwMapFlags, const UChar* lpSrcStr,int cchSrc, UChar* lpDestStr,int cchDest);
+inline int FoldStringW(DWORD dwMapFlags, const char16_t* lpSrcStr,int cchSrc, char16_t* lpDestStr,int cchDest);
 #endif
 
 class BreakItFunction : public UPerfFunction
@@ -637,19 +637,19 @@ public:
                 return UnicodeString(buf, "");
             }
         case Formattable::kString:
-            return UnicodeString((UChar)U_DQUOTE).append(f.getString()).append((UChar)U_DQUOTE);
+            return UnicodeString((char16_t)U_DQUOTE).append(f.getString()).append((char16_t)U_DQUOTE);
         case Formattable::kArray:
             {
                 int32_t i, count;
                 const Formattable* array = f.getArray(count);
-                UnicodeString result((UChar)U_LEFT_SQUARE_BRACKET);
+                UnicodeString result((char16_t)U_LEFT_SQUARE_BRACKET);
                 for (i=0; i<count; ++i) {
                     if (i > 0) {
-                        (result += (UChar)U_COMMA) += (UChar)U_SPACE;
+                        (result += (char16_t)U_COMMA) += (char16_t)U_SPACE;
                     }
                     result += formattableToString(array[i]);
                 }
-                result += (UChar)U_RIGHT_SQUARE_BRACKET;
+                result += (char16_t)U_RIGHT_SQUARE_BRACKET;
                 return result;
             }
         default:
index 0dc574af894c057fc7be79f2f77e7f117730e213..530ae434372c522fb6c4beb8975a8501569f0906 100644 (file)
@@ -85,7 +85,7 @@ const char gUsageString[] =
 //  Stubs for Windows API functions when building on UNIXes.
 //
 typedef int DWORD;
-inline int CompareStringW(DWORD, DWORD, UChar *, int, UChar *, int) {return 0;}
+inline int CompareStringW(DWORD, DWORD, char16_t *, int, char16_t *, int) {return 0;}
 #include <sys/time.h>
 unsigned long timeGetTime() {
     struct timeval t;
@@ -94,7 +94,7 @@ unsigned long timeGetTime() {
     val += t.tv_usec / 1000;
     return val;
 }
-inline int LCMapStringW(DWORD, DWORD, UChar *, int, UChar *, int) {return 0;}
+inline int LCMapStringW(DWORD, DWORD, char16_t *, int, char16_t *, int) {return 0;}
 const int LCMAP_SORTKEY = 0;
 #define MAKELCID(a,b) 0
 const int SORT_DEFAULT = 0;
@@ -194,7 +194,7 @@ OptSpec opts[] = {
 //      one of these structs.
 //
 struct  Line {
-    UChar     *name;
+    char16_t  *name;
     int        len;
     char      *winSortKey;
     char      *icuSortKey;
@@ -393,7 +393,7 @@ void doKeyGen()
                 for (iLoop=0; iLoop < opt_iLoopCount; iLoop++) {
                     LCMapStringW(gWinLCID, LCMAP_SORTKEY,
                         gFileLines[line].name, len,
-                        (UChar *)gFileLines[line].winSortKey, 5000);    // TODO  something with length.
+                        (char16_t *)gFileLines[line].winSortKey, 5000);    // TODO  something with length.
                 }
             }
         }
@@ -487,7 +487,7 @@ void doBinarySearch()
         if (opt_strcmp || opt_strcmpCPO) 
         {
             unsigned long startTime = timeGetTime();
-            typedef int32_t (U_EXPORT2 *PF)(const UChar *, const UChar *);
+            typedef int32_t (U_EXPORT2 *PF)(const char16_t *, const char16_t *);
             PF pf = u_strcmp;
             if (opt_strcmpCPO) {pf = u_strcmpCodePointOrder;}
             //if (opt_strcmp && opt_win) {pf = (PF)wcscmp;}   // Damn the difference between int32_t and int
@@ -835,7 +835,7 @@ void doForwardIterTest(UBool haslen) {
     }
     printf("performance test on strings from file -----------\n");
 
-    UChar dummytext[] = {0, 0};
+    char16_t dummytext[] = {0, 0};
     UCollationElements *iter = ucol_openElements(gCol, nullptr, 0, &error);
     ucol_setText(iter, dummytext, 1, &error);
     
@@ -844,7 +844,7 @@ void doForwardIterTest(UBool haslen) {
     while (count < opt_loopCount) {
         int linecount = 0;
         while (linecount < gNumFileLines) {
-            UChar *str = gFileLines[linecount].name;
+            char16_t *str = gFileLines[linecount].name;
             int strlen = haslen?gFileLines[linecount].len:-1;
             ucol_setText(iter, str, strlen, &error);
             while (ucol_next(iter, &error) != UCOL_NULLORDER) {
@@ -864,7 +864,7 @@ void doForwardIterTest(UBool haslen) {
     while (count < opt_loopCount) {
         int linecount = 0;
         while (linecount < gNumFileLines) {
-            UChar *str = gFileLines[linecount].name;
+            char16_t *str = gFileLines[linecount].name;
             int strlen = haslen?gFileLines[linecount].len:-1;
             ucol_setText(iter, str, strlen, &error);
             linecount ++;
@@ -883,7 +883,7 @@ void doForwardIterTest(UBool haslen) {
 
     printf("performance test on skipped-5 concatenated strings from file -----------\n");
 
-    UChar *str;
+    char16_t *str;
     int    strlen = 0;
     // appending all the strings
     int linecount = 0;
@@ -892,7 +892,7 @@ void doForwardIterTest(UBool haslen) {
                                       u_strlen(gFileLines[linecount].name);
         linecount ++;
     }
-    str = (UChar *)malloc(sizeof(UChar) * strlen);
+    str = (char16_t *)malloc(sizeof(char16_t) * strlen);
     int strindex = 0;
     linecount = 0;
     while (strindex < strlen) {
@@ -900,7 +900,7 @@ void doForwardIterTest(UBool haslen) {
         len += haslen?gFileLines[linecount].len:
                                       u_strlen(gFileLines[linecount].name);
         memcpy(str + strindex, gFileLines[linecount].name, 
-               sizeof(UChar) * len);
+               sizeof(char16_t) * len);
         strindex += len;
         linecount ++;
     }
@@ -999,7 +999,7 @@ void doBackwardIterTest(UBool haslen) {
     printf("performance test on strings from file -----------\n");
 
     UCollationElements *iter = ucol_openElements(gCol, nullptr, 0, &error);
-    UChar dummytext[] = {0, 0};
+    char16_t dummytext[] = {0, 0};
     ucol_setText(iter, dummytext, 1, &error);
 
     gCount = 0;
@@ -1007,7 +1007,7 @@ void doBackwardIterTest(UBool haslen) {
     while (count < opt_loopCount) {
         int linecount = 0;
         while (linecount < gNumFileLines) {
-            UChar *str = gFileLines[linecount].name;
+            char16_t *str = gFileLines[linecount].name;
             int strlen = haslen?gFileLines[linecount].len:-1;
             ucol_setText(iter, str, strlen, &error);
             while (ucol_previous(iter, &error) != UCOL_NULLORDER) {
@@ -1028,7 +1028,7 @@ void doBackwardIterTest(UBool haslen) {
     while (count < opt_loopCount) {
         int linecount = 0;
         while (linecount < gNumFileLines) {
-            UChar *str = gFileLines[linecount].name;
+            char16_t *str = gFileLines[linecount].name;
             int strlen = haslen?gFileLines[linecount].len:-1;
             ucol_setText(iter, str, strlen, &error);
             linecount ++;
@@ -1047,7 +1047,7 @@ void doBackwardIterTest(UBool haslen) {
 
     printf("performance test on skipped-5 concatenated strings from file -----------\n");
 
-    UChar *str;
+    char16_t *str;
     int    strlen = 0;
     // appending all the strings
     int linecount = 0;
@@ -1056,7 +1056,7 @@ void doBackwardIterTest(UBool haslen) {
                                       u_strlen(gFileLines[linecount].name);
         linecount ++;
     }
-    str = (UChar *)malloc(sizeof(UChar) * strlen);
+    str = (char16_t *)malloc(sizeof(char16_t) * strlen);
     int strindex = 0;
     linecount = 0;
     while (strindex < strlen) {
@@ -1064,7 +1064,7 @@ void doBackwardIterTest(UBool haslen) {
         len += haslen?gFileLines[linecount].len:
                                       u_strlen(gFileLines[linecount].name);
         memcpy(str + strindex, gFileLines[linecount].name, 
-               sizeof(UChar) * len);
+               sizeof(char16_t) * len);
         strindex += len;
         linecount ++;
     }
@@ -1211,7 +1211,7 @@ class UCharFile {
 public:
     UCharFile(const char *fileName);
     ~UCharFile();
-    UChar   get();
+    char16_t   get();
     UBool   eof() {return fEof;};
     UBool   error() {return fError;};
     
@@ -1223,7 +1223,7 @@ private:
     const char   *fName;
     UBool        fEof;
     UBool        fError;
-    UChar        fPending2ndSurrogate;
+    char16_t     fPending2ndSurrogate;
     
     enum {UTF16LE, UTF16BE, UTF8} fEncoding;
 };
@@ -1268,8 +1268,8 @@ UCharFile::~UCharFile() {
 
 
 
-UChar UCharFile::get() {
-    UChar   c;
+char16_t UCharFile::get() {
+    char16_t   c;
     switch (fEncoding) {
     case UTF16LE:
         {
@@ -1303,7 +1303,7 @@ UChar UCharFile::get() {
                 break;
             }
             
-            int ch = fgetc(fFile);   // Note:  c and ch are separate cause eof test doesn't work on UChar type.
+            int ch = fgetc(fFile);   // Note:  c and ch are separate cause eof test doesn't work on char16_t type.
             if (ch == EOF) {
                 c = 0;
                 fEof = true;
@@ -1344,13 +1344,13 @@ UChar UCharFile::get() {
             i = 0;
             uint32_t  cp;
             U8_NEXT_UNSAFE(bytes, i, cp);
-            c = (UChar)cp;
+            c = (char16_t)cp;
             
             if (cp >= 0x10000) {
                 // The code point needs to be broken up into a utf-16 surrogate pair.
                 //  Process first half this time through the main loop, and
                 //   remember the other half for the next time through.
-                UChar utf16Buf[3];
+                char16_t utf16Buf[3];
                 i = 0;
                 UTF16_APPEND_CHAR_UNSAFE(utf16Buf, i, cp);
                 fPending2ndSurrogate = utf16Buf[1];
@@ -1379,8 +1379,8 @@ UCollator *openRulesCollator() {
     }
 
     int  bufLen = 10000;
-    UChar *buf = (UChar *)malloc(bufLen * sizeof(UChar));
-    UChar *tmp;
+    char16_t *buf = (char16_t *)malloc(bufLen * sizeof(char16_t));
+    char16_t *tmp;
     int i = 0;
 
     for(;;) {
@@ -1395,7 +1395,7 @@ UCollator *openRulesCollator() {
         if (i >= bufLen) {
             tmp = buf;
             bufLen += 10000;
-            buf = (UChar *)realloc(buf, bufLen);
+            buf = (char16_t *)realloc(buf, bufLen);
             if (buf == nullptr) {
                 free(tmp);
                 return 0;
@@ -1546,7 +1546,7 @@ int main(int argc, const char** argv) {
 
     const int MAXLINES = 100000;
     gFileLines = new Line[MAXLINES];
-    UChar buf[1024];
+    char16_t buf[1024];
     int   column = 0;
 
     //  Read the file, split into lines, and save in memory.
@@ -1554,7 +1554,7 @@ int main(int argc, const char** argv) {
     //    (The number of bytes read from file per loop iteration depends on external encoding.)
     for (;;) {
 
-        UChar c = f.get();
+        char16_t c = f.get();
         if (f.error()){
             exit(-1);
         }
@@ -1570,9 +1570,9 @@ int main(int argc, const char** argv) {
         if (f.eof() || c == 0x0a || c==0x2028) {  // Unipad inserts 2028 line separators!
             buf[column++] = 0;
             if (column > 1) {
-                gFileLines[gNumFileLines].name  = new UChar[column];
+                gFileLines[gNumFileLines].name  = new char16_t[column];
                 gFileLines[gNumFileLines].len   = column-1;
-                memcpy(gFileLines[gNumFileLines].name, buf, column * sizeof(UChar));
+                memcpy(gFileLines[gNumFileLines].name, buf, column * sizeof(char16_t));
                 gNumFileLines++;
                 column = 0;
                 if (gNumFileLines >= MAXLINES) {
@@ -1636,7 +1636,7 @@ int main(int argc, const char** argv) {
          t=LCMapStringW(gWinLCID, LCMAP_SORTKEY, gFileLines[line].name, -1, buf, sizeof(buf));
          gFileLines[line].winSortKey  = new char[t];
          if (t > (int32_t)sizeof(buf)) {
-             t = LCMapStringW(gWinLCID, LCMAP_SORTKEY, gFileLines[line].name, -1, (UChar *)(gFileLines[line].winSortKey), t);
+             t = LCMapStringW(gWinLCID, LCMAP_SORTKEY, gFileLines[line].name, -1, (char16_t *)(gFileLines[line].winSortKey), t);
          }
          else
          {
@@ -1669,7 +1669,7 @@ int main(int argc, const char** argv) {
         int  i;
         for (line=0; line<gNumFileLines; line++) {
             for (i=0;;i++) {
-                UChar  c = gFileLines[line].name[i];
+                char16_t  c = gFileLines[line].name[i];
                 if (c == 0)
                     break;
                 if (c < 0x20 || c > 0x7e) {
index a99d1774e810d1956ca02c0f794f1a7b05ea9ebe..cceb58dd967982a3a70ceb4d8cf7164ee10e452a 100644 (file)
@@ -55,12 +55,12 @@ struct CompactArrays{\
     int32_t lengthOf(int i){return index[i+1] - index[i] - 1; }        /*exclude terminating NUL*/  \
 };
 
-//typedef CompactArrays<UChar> CA_uchar;
+//typedef CompactArrays<char16_t> CA_uchar;
 //typedef CompactArrays<char> CA_char;
 //typedef CompactArrays<uint8_t> CA_uint8;
 //typedef CompactArrays<WCHAR> CA_win_wchar;
 
-COMPATCT_ARRAY(CA_uchar, UChar)
+COMPATCT_ARRAY(CA_uchar, char16_t)
 COMPATCT_ARRAY(CA_char, char)
 COMPATCT_ARRAY(CA_uint8, uint8_t)
 COMPATCT_ARRAY(CA_win_wchar, WCHAR)
@@ -70,7 +70,7 @@ struct DataIndex {
     static DWORD        win_langid;     // for qsort callback function
     static UCollator *  col;            // for qsort callback function
     uint8_t *   icu_key;
-    UChar *     icu_data;
+    char16_t *     icu_data;
     int32_t     icu_data_len;
     char*       posix_key;
     char*       posix_data;
@@ -147,7 +147,7 @@ public:
     CmdIter(UErrorCode & status, UCollator * col, int32_t count, CA_uchar *data, Func fn, int32_t,int32_t)
         :count(count), data(data), fn(fn){
             exec_count = 0;
-            UChar dummytext[] = {0, 0};
+            char16_t dummytext[] = {0, 0};
             iter = ucol_openElements(col, nullptr, 0, &status);
             ucol_setText(iter, dummytext, 1, &status);
         }
@@ -188,7 +188,7 @@ public:
 class CmdIterAll : public UPerfFunction {
     typedef    void (CmdIterAll::* Func)(UErrorCode* status);
     int32_t     count;
-    UChar *     data;
+    char16_t *     data;
     Func        fn;
     UCollationElements *iter;
     int32_t     exec_count;
@@ -199,7 +199,7 @@ public:
     ~CmdIterAll(){
         ucol_closeElements(iter);
     }
-    CmdIterAll(UErrorCode & status, UCollator * col, int32_t count,  UChar * data, CALL call,int32_t,int32_t)
+    CmdIterAll(UErrorCode & status, UCollator * col, int32_t count,  char16_t * data, CALL call,int32_t,int32_t)
         :count(count),data(data)
     {
         exec_count = 0;
@@ -495,7 +495,7 @@ public:
     UCollator *     col;
     DWORD           win_langid;
 
-    UChar * icu_data_all;
+    char16_t * icu_data_all;
     int32_t icu_data_all_len;
 
     int32_t         count;
@@ -753,7 +753,7 @@ public:
         icu_data = new CA_uchar();
 
         // Following code is borrowed from UPerfTest::getLines();
-        const UChar*    line=nullptr;
+        const char16_t*    line=nullptr;
         int32_t         len =0;
         for (;;) {
             line = ucbuf_readline(ucharBuf,&len,&status);
@@ -768,7 +768,7 @@ public:
                 continue; //skip empty line
             } else {
                 icu_data->append_one(len);
-                memcpy(icu_data->last(), line, len * sizeof(UChar));
+                memcpy(icu_data->last(), line, len * sizeof(char16_t));
                 icu_data->last()[len -1] = 0;
             }
         }
@@ -783,7 +783,7 @@ public:
         icu_data_all_len =  icu_data->index[count]; // includes all NULs
         icu_data_all_len -= count;  // excludes all NULs
         icu_data_all_len += 1;      // the terminal NUL
-        icu_data_all = new UChar[icu_data_all_len];
+        icu_data_all = new char16_t[icu_data_all_len];
         icu_data_all[icu_data_all_len - 1] = 0; //the terminal NUL
 
         icu_key  = new CA_uint8;
@@ -796,12 +796,12 @@ public:
         DataIndex::col        = col;
 
 
-        UChar * p = icu_data_all;
+        char16_t * p = icu_data_all;
         int32_t s;
         int32_t t;
         for (int i=0; i < count; i++) {
             // ICU all data
-            s = sizeof(UChar) * icu_data->lengthOf(i);
+            s = sizeof(char16_t) * icu_data->lengthOf(i);
             memcpy(p, icu_data->dataOf(i), s);
             p += icu_data->lengthOf(i);
 
index 2bc33f734c1b7597ef0aede63e6079034497aa21..e0a367189f8c7e312349648dd2d57fc0e55b2bf3 100644 (file)
@@ -45,7 +45,7 @@ struct CompactArrays{\
     int32_t lengthOf(int i) const {return index[i+1] - index[i] - 1; } /*exclude terminating NUL*/  \
 };
 
-COMPACT_ARRAY(CA_uchar, UChar)
+COMPACT_ARRAY(CA_uchar, char16_t)
 COMPACT_ARRAY(CA_char, char)
 
 #define MAX_TEST_STRINGS_FOR_PERMUTING 1000
@@ -1179,7 +1179,7 @@ const CA_uchar* CollPerf2Test::getData16(UErrorCode &status)
     if (data16) return data16;
 
     CA_uchar* d16 = new CA_uchar();
-    const UChar *line = nullptr;
+    const char16_t *line = nullptr;
     int32_t len = 0;
     int32_t numData = 0;
 
@@ -1196,7 +1196,7 @@ const CA_uchar* CollPerf2Test::getData16(UErrorCode &status)
             continue; // skip empty/comment line
         } else {
             d16->append_one(len);
-            UChar *p = d16->last();
+            char16_t *p = d16->last();
             u_memcpy(p, line, len - 1);  // exclude the CR
             p[len - 1] = 0;  // NUL-terminate
 
@@ -1232,20 +1232,20 @@ const CA_uchar* CollPerf2Test::getModData16(UErrorCode &status)
     CA_uchar* modData16 = new CA_uchar();
 
     for (int32_t i = 0; i < d16->count; i++) {
-        const UChar *s = d16->dataOf(i);
+        const char16_t *s = d16->dataOf(i);
         int32_t len = d16->lengthOf(i) + 1; // including NUL terminator
 
         modData16->append_one(len);
         u_memcpy(modData16->last(), s, len);
 
         // replacing the last character with a different character
-        UChar *lastChar = &modData16->last()[len -2];
+        char16_t *lastChar = &modData16->last()[len -2];
         for (int32_t j = i + 1; j != i; j++) {
             if (j >= d16->count) {
                 j = 0;
             }
-            const UChar *s1 = d16->dataOf(j);
-            UChar lastChar1 = s1[d16->lengthOf(j) - 1];
+            const char16_t *s1 = d16->dataOf(j);
+            char16_t lastChar1 = s1[d16->lengthOf(j) - 1];
             if (*lastChar != lastChar1) {
                 *lastChar = lastChar1;
                 break;
@@ -1340,7 +1340,7 @@ CA_uchar* CollPerf2Test::sortData16(const CA_uchar* d16,
     LocalPointer<CA_uchar> newD16(new CA_uchar());
     for (int32_t i = 0; i < d16->count; i++) {
         int32_t j = indexes[i];
-        const UChar* s = d16->dataOf(j);
+        const char16_t* s = d16->dataOf(j);
         int32_t len = d16->lengthOf(j);
         int32_t capacity = len + 1;  // including NUL terminator
         newD16->append_one(capacity);
@@ -1360,7 +1360,7 @@ CA_char* CollPerf2Test::getData8FromData16(const CA_uchar* d16, UErrorCode &stat
     // UTF-16 -> UTF-8 conversion
     LocalPointer<CA_char> d8(new CA_char());
     for (int32_t i = 0; i < d16->count; i++) {
-        const UChar *s16 = d16->dataOf(i);
+        const char16_t *s16 = d16->dataOf(i);
         int32_t length16 = d16->lengthOf(i);
 
         // get length in UTF-8
index 5a583bc047b616b54171274b65a692f30cb71a20..5df6f869ec6725d6e84204248afef56cffcfd18a 100644 (file)
@@ -144,7 +144,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_OpenAllConverters() {
 
 UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8", (UChar *)utf8_uniSource, UPRV_LENGTHOF(utf8_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8", (char16_t *)utf8_uniSource, UPRV_LENGTHOF(utf8_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -201,7 +201,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_UTF8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1", (UChar *)latin1_uniSource, UPRV_LENGTHOF(latin1_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1", (char16_t *)latin1_uniSource, UPRV_LENGTHOF(latin1_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -258,7 +258,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin1_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8", (UChar *)latin8_uniSource, UPRV_LENGTHOF(latin8_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8", (char16_t *)latin8_uniSource, UPRV_LENGTHOF(latin8_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -315,7 +315,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic", (UChar *)ebcdic_arabic_uniSource, UPRV_LENGTHOF(ebcdic_arabic_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic", (char16_t *)ebcdic_arabic_uniSource, UPRV_LENGTHOF(ebcdic_arabic_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -372,7 +372,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis", (UChar *)sjis_uniSource, UPRV_LENGTHOF(sjis_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis", (char16_t *)sjis_uniSource, UPRV_LENGTHOF(sjis_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -431,7 +431,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_SJIS_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp", (UChar *)eucjp_uniSource, UPRV_LENGTHOF(eucjp_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp", (char16_t *)eucjp_uniSource, UPRV_LENGTHOF(eucjp_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -490,7 +490,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EUCJP_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312", (UChar *)gb2312_uniSource, UPRV_LENGTHOF(gb2312_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312", (char16_t *)gb2312_uniSource, UPRV_LENGTHOF(gb2312_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -548,7 +548,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_GB2312_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr", (UChar *)iso2022kr_uniSource, UPRV_LENGTHOF(iso2022kr_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr", (char16_t *)iso2022kr_uniSource, UPRV_LENGTHOF(iso2022kr_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
@@ -605,7 +605,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022KR_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp", (UChar *)iso2022jp_uniSource, UPRV_LENGTHOF(iso2022jp_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp", (char16_t *)iso2022jp_uniSource, UPRV_LENGTHOF(iso2022jp_uniSource), status);
     if(U_FAILURE(status)){
         return nullptr;
     }
index aef9b633a111fb5bae8da1e3030d48100c453b49..527dbaf3a3c00a0fa6c216fc7945d10d641b9348 100644 (file)
@@ -30,8 +30,8 @@ private:
     UConverter* conv;
     const char* src;
     int32_t srcLen;
-    UChar* target;
-    UChar* targetLimit;
+    char16_t* target;
+    char16_t* targetLimit;
     
 public:
     ICUToUnicodePerfFunction(const char* name,  const char* source, int32_t sourceLen, UErrorCode& status){
@@ -48,7 +48,7 @@ public:
                                         source, srcLen, &status);
         if(status==U_BUFFER_OVERFLOW_ERROR) {
             status=U_ZERO_ERROR;
-            target=(UChar*)malloc((reqdLen) * U_SIZEOF_UCHAR*2);
+            target=(char16_t*)malloc((reqdLen) * U_SIZEOF_UCHAR*2);
             targetLimit = target + reqdLen;
             if(target == nullptr){
                 status = U_MEMORY_ALLOCATION_ERROR;
@@ -59,7 +59,7 @@ public:
     virtual void call(UErrorCode* status){
         const char* mySrc = src;
         const char* sourceLimit = src + srcLen;
-        UChar* myTarget = target;
+        char16_t* myTarget = target;
         ucnv_toUnicode(conv, &myTarget, targetLimit, &mySrc, sourceLimit, nullptr, true, status);
     }
     virtual long getOperationsPerIteration(void){
@@ -73,14 +73,14 @@ public:
 class ICUFromUnicodePerfFunction : public UPerfFunction{
 private:
     UConverter* conv;
-    const UChar* src;
+    const char16_t* src;
     int32_t srcLen;
     char* target;
     char* targetLimit;
     const char* name;
     
 public:
-    ICUFromUnicodePerfFunction(const char* name,  const UChar* source, int32_t sourceLen, UErrorCode& status){
+    ICUFromUnicodePerfFunction(const char* name,  const char16_t* source, int32_t sourceLen, UErrorCode& status){
         conv = ucnv_open(name,&status);
         src = source;
         srcLen = sourceLen;
@@ -103,8 +103,8 @@ public:
         }
     }
     virtual void call(UErrorCode* status){
-        const UChar* mySrc = src;
-        const UChar* sourceLimit = src + srcLen;
+        const char16_t* mySrc = src;
+        const char16_t* sourceLimit = src + srcLen;
         char* myTarget = target;
         ucnv_fromUnicode(conv,&myTarget, targetLimit, &mySrc, sourceLimit, nullptr, true, status);
     }
index fedc4dc06b095965be04cb23cc6660a465f7ed48..8fdfa76fc202e56e8923d541ca2654108532d211 100644 (file)
@@ -56,7 +56,7 @@ public:
                     ++numTextLines;
                     // Remove trailing CR LF.
                     int32_t len=lines[i].len;
-                    UChar c;
+                    char16_t c;
                     while(len>0 && ((c=lines[i].name[len-1])==0xa || c==0xd)) {
                         --len;
                     }
@@ -352,7 +352,7 @@ ucharsTrieMatches(UCharsTrie &trie,
     UChar32 c=utext_next32(text);
     // Notes:
     // a) CompactTrieDictionary::matches() does not check for U_SENTINEL.
-    // b) It also ignores non-BMP code points by casting to UChar!
+    // b) It also ignores non-BMP code points by casting to char16_t!
     if(c<0) {
         return 0;
     }
@@ -380,7 +380,7 @@ ucharsTrieMatches(UCharsTrie &trie,
         UChar32 c=utext_next32(text);
         // Notes:
         // a) CompactTrieDictionary::matches() does not check for U_SENTINEL.
-        // b) It also ignores non-BMP code points by casting to UChar!
+        // b) It also ignores non-BMP code points by casting to char16_t!
         if(c<0) {
             break;
         }
@@ -490,10 +490,10 @@ static inline int32_t thaiCharToByte(UChar32 c) {
     }
 }
 
-static UBool thaiWordToBytes(const UChar *s, int32_t length,
+static UBool thaiWordToBytes(const char16_t *s, int32_t length,
                              CharString &str, UErrorCode &errorCode) {
     for(int32_t i=0; i<length; ++i) {
-        UChar c=s[i];
+        char16_t c=s[i];
         int32_t b=thaiCharToByte(c);
         if(b>=0) {
             str.append((char)b, errorCode);
@@ -621,7 +621,7 @@ public:
         const ULine *lines=perf.getCachedLines();
         int32_t numLines=perf.getNumLines();
         for(int32_t i=0; i<numLines; ++i) {
-            const UChar *line=lines[i].name;
+            const char16_t *line=lines[i].name;
             // Skip comment lines (start with a character below 'A').
             if(line[0]<0x41) {
                 continue;
index 3553f2fd75b920c43e15de877c78435208fa1da7..026e37e89d085ad9f7d5b5bc4ea0a490fc9da3ab 100644 (file)
@@ -265,7 +265,7 @@ private:
   UNumberFormat *fFmt;
   UnicodeString fPat;
   UnicodeString fString;
-  const UChar *fStr;
+  const char16_t *fStr;
   int32_t fLen;
   const char *fFile;
   int fLine;
@@ -393,7 +393,7 @@ private:
   UNumberFormat *fFmt;
   UnicodeString fPat;
   UnicodeString fString;
-  const UChar *fStr;
+  const char16_t *fStr;
   int32_t fLen;
   const char *fFile;
   int fLine;
@@ -432,7 +432,7 @@ public:
   }
   void warmup() {
     fFmt = initFmt();
-    UChar buf[100];
+    char16_t buf[100];
     if(U_SUCCESS(setupStatus)) {
       int32_t trial = unum_formatDouble(fFmt,fExpect, buf, 100, nullptr, &setupStatus);
       if(!U_SUCCESS(setupStatus)
@@ -450,7 +450,7 @@ public:
   int32_t run() {
     int32_t trial;
     int i;
-    UChar buf[100];
+    char16_t buf[100];
     if(U_SUCCESS(setupStatus)) {
       for(i=0;i<U_LOTS_OF_TIMES;i++){
         trial = unum_formatDouble(fFmt,fExpect, buf, 100, nullptr, &setupStatus);
@@ -478,7 +478,7 @@ private:
   UNumberFormat *fFmt;
   UnicodeString fPat;
   UnicodeString fString;
-  const UChar *fStr;
+  const char16_t *fStr;
   int32_t fLen;
   const char *fFile;
   int fLine;
@@ -556,7 +556,7 @@ public:
   }
   void warmup() {
     fFmt = initFmt();
-    UChar buf[100];
+    char16_t buf[100];
     if(U_SUCCESS(setupStatus)) {
       int32_t trial = unum_formatInt64(fFmt,fExpect, buf, 100, nullptr, &setupStatus);
       if(!U_SUCCESS(setupStatus)
@@ -574,7 +574,7 @@ public:
   int32_t run() {
     int32_t trial;
     int i;
-    UChar buf[100];
+    char16_t buf[100];
     if(U_SUCCESS(setupStatus)) {
       for(i=0;i<U_LOTS_OF_TIMES;i++){
         trial = unum_formatInt64(fFmt,fExpect, buf, 100, nullptr, &setupStatus);
@@ -605,7 +605,7 @@ private:
   UNumberFormat *fFmt;
   UnicodeString fPat;
   UnicodeString fString;
-  const UChar *fStr;
+  const char16_t *fStr;
   int32_t fLen;
   const char *fFile;
   int fLine;
@@ -683,26 +683,26 @@ public:
 #define DO_NumFmtStringPieceTest(p,n,x) { NumFmtStringPieceTest t(p,n,x,__FILE__,__LINE__); runTestOn(t); }
 
 // TODO: move, scope.
-static UChar pattern[] = { 0x23 }; // '#'
-static UChar strdot[] = { '2', '.', '0', 0 };
-static UChar strspc[] = { '2', ' ', 0 };
-static UChar strgrp[] = {'2',',','2','2','2', 0 };
-static UChar strbeng[] = {0x09E8,0x09E8,0x09E8,0x09E8, 0 };
+static char16_t pattern[] = { 0x23 }; // '#'
+static char16_t strdot[] = { '2', '.', '0', 0 };
+static char16_t strspc[] = { '2', ' ', 0 };
+static char16_t strgrp[] = {'2',',','2','2','2', 0 };
+static char16_t strbeng[] = {0x09E8,0x09E8,0x09E8,0x09E8, 0 };
 
 UNumberFormat *NumParseTest_fmt;
 
 // TODO: de-uglify.
-QuickTest(NumParseTest,{    static UChar pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    static UChar str[] = { 0x31 };double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,str,1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
+QuickTest(NumParseTest,{    static char16_t pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    static char16_t str[] = { 0x31 };double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,str,1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
 
-QuickTest(NumParseTestdot,{    static UChar pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;  double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strdot,1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
-QuickTest(NumParseTestspc,{    static UChar pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strspc,1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
-QuickTest(NumParseTestgrp,{    static UChar pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strgrp,-1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
+QuickTest(NumParseTestdot,{    static char16_t pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;  double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strdot,1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
+QuickTest(NumParseTestspc,{    static char16_t pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strspc,1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
+QuickTest(NumParseTestgrp,{    static char16_t pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strgrp,-1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
 
-QuickTest(NumParseTestbeng,{    static UChar pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strbeng,-1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
+QuickTest(NumParseTestbeng,{    static char16_t pattern[] = { 0x23 };    NumParseTest_fmt = unum_open(UNUM_PATTERN_DECIMAL,         pattern,                    1,                    TEST_LOCALE,                    0,                    &setupStatus);  },{    int32_t i;    double val;    for(i=0;i<U_LOTS_OF_TIMES;i++) {      val=unum_parse(NumParseTest_fmt,strbeng,-1,nullptr,&setupStatus);    }    return i;  },{unum_close(NumParseTest_fmt);})
 
 UDateFormat *DateFormatTest_fmt = nullptr;
 UDate sometime = 100000000.0;
-UChar onekbuf[1024];
+char16_t onekbuf[1024];
 const int32_t onekbuf_len = UPRV_LENGTHOF(onekbuf);
 
 
index 22dab949838ce5a24da64fdad23e0358e6ed2b1f..08a0af6317b5221bead616a07cd3639d9d5c4a1d 100644 (file)
@@ -47,7 +47,7 @@ using namespace std;
 #else
 #define _UNICODE
 typedef int DWORD;
-inline int FoldStringW(DWORD dwMapFlags, const UChar* lpSrcStr,int cchSrc, UChar* lpDestStr,int cchDest);
+inline int FoldStringW(DWORD dwMapFlags, const char16_t* lpSrcStr,int cchSrc, char16_t* lpDestStr,int cchDest);
 #endif
 
 class DateTimeRoundTripFunction : public UPerfFunction
index 832f2d0c82c2678f0b87917dffdf277e24633b39..4789d7f045b38778770d038b2100c825edf657bd 100644 (file)
@@ -74,7 +74,7 @@ UPerfFunction* NormalizerPerformanceTest::runIndexedTest(int32_t index, UBool ex
 
 }
 
-void NormalizerPerformanceTest::normalizeInput(ULine* dest,const UChar* src ,int32_t srcLen,UNormalizationMode mode, int32_t options){
+void NormalizerPerformanceTest::normalizeInput(ULine* dest,const char16_t* src ,int32_t srcLen,UNormalizationMode mode, int32_t options){
     int32_t reqLen = 0;
     UErrorCode status = U_ZERO_ERROR;
     for(;;){
@@ -82,7 +82,7 @@ void NormalizerPerformanceTest::normalizeInput(ULine* dest,const UChar* src ,int
         reqLen=unorm_normalize(src,srcLen,mode, options,nullptr,0,&status);
         if(status==U_BUFFER_OVERFLOW_ERROR){
             status=U_ZERO_ERROR;
-            dest->name = new UChar[reqLen+1];
+            dest->name = new char16_t[reqLen+1];
             reqLen= unorm_normalize(src,srcLen,mode, options,dest->name,reqLen+1,&status);
             dest->len=reqLen;
             break;
@@ -91,16 +91,16 @@ void NormalizerPerformanceTest::normalizeInput(ULine* dest,const UChar* src ,int
         }
     }
 }
-UChar* NormalizerPerformanceTest::normalizeInput(int32_t& len, const UChar* src ,int32_t srcLen,UNormalizationMode mode, int32_t options){
+char16_t* NormalizerPerformanceTest::normalizeInput(int32_t& len, const char16_t* src ,int32_t srcLen,UNormalizationMode mode, int32_t options){
     int32_t reqLen = 0;
     UErrorCode status = U_ZERO_ERROR;
-    UChar* dest = nullptr;
+    char16_t* dest = nullptr;
     for(;;){
         /* pure pre-flight */
         reqLen=unorm_normalize(src,srcLen,mode, options,nullptr,0,&status);
         if(status==U_BUFFER_OVERFLOW_ERROR){
             status=U_ZERO_ERROR;
-            dest = new UChar[reqLen+1];
+            dest = new char16_t[reqLen+1];
             reqLen= unorm_normalize(src,srcLen,mode, options,dest,reqLen+1,&status);
             len=reqLen;
             break;
@@ -156,7 +156,7 @@ NormalizerPerformanceTest::NormalizerPerformanceTest(int32_t argc, const char* a
         }
     }else if(bulk_mode){
         int32_t srcLen = 0;
-        const UChar* src = getBuffer(srcLen,status);
+        const char16_t* src = getBuffer(srcLen,status);
         NFDBufferLen = 0;
         NFCBufferLen = 0;
 
index 769e83ac76268b647100d3aa5b12dc86d44f7cd2..1ba042cbc8a6c0b9e1c774c9afd73084feda7a71 100644 (file)
 #else
 #define _UNICODE
 typedef int DWORD;
-inline int FoldStringW(DWORD dwMapFlags, const UChar* lpSrcStr,int cchSrc, UChar* lpDestStr,int cchDest);
+inline int FoldStringW(DWORD dwMapFlags, const char16_t* lpSrcStr,int cchSrc, char16_t* lpDestStr,int cchDest);
 #endif
 
 #define DEST_BUFFER_CAPACITY 6000
-typedef int32_t (*NormFn)(const UChar* src,int32_t srcLen, UChar* dest,int32_t dstLen, int32_t options, UErrorCode* status);
-typedef int32_t (*QuickCheckFn)(const UChar* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status);
+typedef int32_t (*NormFn)(const char16_t* src,int32_t srcLen, char16_t* dest,int32_t dstLen, int32_t options, UErrorCode* status);
+typedef int32_t (*QuickCheckFn)(const char16_t* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status);
 
 class QuickCheckPerfFunction : public UPerfFunction{
 private:
@@ -40,7 +40,7 @@ private:
     UNormalizationMode mode;
     int32_t retVal;
     UBool uselen;
-    const UChar* src;
+    const char16_t* src;
     int32_t srcLen;
     UBool line_mode;
     int32_t options;
@@ -88,7 +88,7 @@ public:
         srcLen = 0;
         line_mode = true;
     }
-    QuickCheckPerfFunction(QuickCheckFn func, const UChar* source,int32_t sourceLen, UNormalizationMode _mode, int32_t opts, UBool _uselen) : options(opts) {
+    QuickCheckPerfFunction(QuickCheckFn func, const char16_t* source,int32_t sourceLen, UNormalizationMode _mode, int32_t opts, UBool _uselen) : options(opts) {
         fn = func;
         lines = nullptr;
         numLines = 0;
@@ -105,13 +105,13 @@ class NormPerfFunction : public UPerfFunction{
 private:
     ULine* lines;
     int32_t numLines;
-    UChar dest[DEST_BUFFER_CAPACITY];
-    UChar* pDest;
+    char16_t dest[DEST_BUFFER_CAPACITY];
+    char16_t* pDest;
     int32_t destLen;
     NormFn fn;
     int32_t retVal;
     UBool uselen;
-    const UChar* src;
+    const char16_t* src;
     int32_t srcLen;
     UBool line_mode;
     int32_t options;
@@ -158,13 +158,13 @@ public:
         srcLen = 0;
         line_mode = true;
     }
-    NormPerfFunction(NormFn func, int32_t opts, const UChar* source,int32_t sourceLen,UBool _uselen) : options(opts) {
+    NormPerfFunction(NormFn func, int32_t opts, const char16_t* source,int32_t sourceLen,UBool _uselen) : options(opts) {
         fn = func;
         lines = nullptr;
         numLines = 0;
         uselen = _uselen;
         destLen = sourceLen*3;
-        pDest = (UChar*) malloc(destLen * U_SIZEOF_UCHAR);
+        pDest = (char16_t*) malloc(destLen * U_SIZEOF_UCHAR);
         src = source;
         srcLen = sourceLen;
         line_mode = false;
@@ -182,16 +182,16 @@ class  NormalizerPerformanceTest : public UPerfTest{
 private:
     ULine* NFDFileLines;
     ULine* NFCFileLines;
-    UChar* NFDBuffer;
-    UChar* NFCBuffer;
-    UChar* origBuffer;
+    char16_t* NFDBuffer;
+    char16_t* NFCBuffer;
+    char16_t* origBuffer;
     int32_t origBufferLen;
     int32_t NFDBufferLen;
     int32_t NFCBufferLen;
     int32_t options;
 
-    void normalizeInput(ULine* dest,const UChar* src ,int32_t srcLen,UNormalizationMode mode, int32_t options);
-    UChar* normalizeInput(int32_t& len, const UChar* src ,int32_t srcLen,UNormalizationMode mode, int32_t options);
+    void normalizeInput(ULine* dest,const char16_t* src ,int32_t srcLen,UNormalizationMode mode, int32_t options);
+    char16_t* normalizeInput(int32_t& len, const char16_t* src ,int32_t srcLen,UNormalizationMode mode, int32_t options);
 
 public:
 
@@ -258,96 +258,96 @@ public:
 
 #if (U_ICU_VERSION_MAJOR_NUM > 1 ) || ((U_ICU_VERSION_MAJOR_NUM == 1 )&&(U_ICU_VERSION_MINOR_NUM > 8) && (U_ICU_VERSION_PATCHLEVEL_NUM >=1))
 
-int32_t ICUNormNFD(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFD(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UNORM_NFD, options,dest,dstLen,status);
 }
 
-int32_t ICUNormNFC(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFC(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UNORM_NFC, options,dest,dstLen,status);
 }
 
-int32_t ICUNormNFKD(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFKD(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UNORM_NFKD, options,dest,dstLen,status);
 }
-int32_t ICUNormNFKC(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFKC(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UNORM_NFKC, options,dest,dstLen,status);
 }
 
-int32_t ICUNormFCD(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormFCD(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UNORM_FCD, options,dest,dstLen,status);
 }
 
-int32_t ICUQuickCheck(const UChar* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
+int32_t ICUQuickCheck(const char16_t* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
 #if (U_ICU_VERSION_MAJOR_NUM > 2 ) || ((U_ICU_VERSION_MAJOR_NUM == 2 )&&(U_ICU_VERSION_MINOR_NUM >= 6))
     return unorm_quickCheckWithOptions(src,srcLen,mode, options, status);
 #else
     return unorm_quickCheck(src,srcLen,mode,status);
 #endif
 }
-int32_t ICUIsNormalized(const UChar* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
+int32_t ICUIsNormalized(const char16_t* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
     return unorm_isNormalized(src,srcLen,mode,status);
 }
 
 
 #else
 
-int32_t ICUNormNFD(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFD(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UCOL_DECOMP_CAN, options,dest,dstLen,status);
 }
 
-int32_t ICUNormNFC(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFC(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UCOL_COMPOSE_CAN, options,dest,dstLen,status);
 }
 
-int32_t ICUNormNFKD(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFKD(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UCOL_DECOMP_COMPAT, options,dest,dstLen,status);
 }
-int32_t ICUNormNFKC(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormNFKC(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UCOL_COMPOSE_COMPAT, options,dest,dstLen,status);
 }
 
-int32_t ICUNormFCD(const UChar* src, int32_t srcLen,UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t ICUNormFCD(const char16_t* src, int32_t srcLen,char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return unorm_normalize(src,srcLen,UNORM_FCD, options,dest,dstLen,status);
 }
 
-int32_t ICUQuickCheck(const UChar* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
+int32_t ICUQuickCheck(const char16_t* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
     return unorm_quickCheck(src,srcLen,mode,status);
 }
 
-int32_t ICUIsNormalized(const UChar* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
+int32_t ICUIsNormalized(const char16_t* src,int32_t srcLen, UNormalizationMode mode, int32_t options, UErrorCode* status){
     return 0;
 }
 #endif
 
 #if U_PLATFORM_HAS_WIN32_API
 
-int32_t WinNormNFD(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFD(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return FoldStringW(MAP_COMPOSITE, toOldUCharPtr(src),srcLen, toOldUCharPtr(dest),dstLen);
 }
 
-int32_t WinNormNFC(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFC(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return FoldStringW(MAP_PRECOMPOSED, toOldUCharPtr(src),srcLen, toOldUCharPtr(dest),dstLen);
 }
 
-int32_t WinNormNFKD(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFKD(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return FoldStringW(MAP_COMPOSITE+MAP_FOLDCZONE, toOldUCharPtr(src),srcLen, toOldUCharPtr(dest),dstLen);
 }
-int32_t WinNormNFKC(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFKC(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return FoldStringW(MAP_FOLDCZONE, toOldUCharPtr(src),srcLen, toOldUCharPtr(dest),dstLen);
 }
 #else
-int32_t WinNormNFD(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFD(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return 0 ;
 }
 
-int32_t WinNormNFC(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFC(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return 0;
 }
 
-int32_t WinNormNFKD(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFKD(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return 0;
 }
-int32_t WinNormNFKC(const UChar* src, int32_t srcLen, UChar* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
+int32_t WinNormNFKC(const char16_t* src, int32_t srcLen, char16_t* dest, int32_t dstLen, int32_t options, UErrorCode* status) {
     return 0;
 }
 #endif
index 2f7341b71f6c8642a64f8c4471c896bcc628b99f..8b2fbd48ce22fe9fc68e689faee0a2a744c55b97 100644 (file)
@@ -61,14 +61,14 @@ private:
         return result;
     }
 
-    static const UChar *const latin1;
-    static const UChar *const lowercaseLatin1;
-    static const UChar *const ascii;
-    static const UChar *const japanese;
-    static const UChar *const arabic;
+    static const char16_t *const latin1;
+    static const char16_t *const lowercaseLatin1;
+    static const char16_t *const ascii;
+    static const char16_t *const japanese;
+    static const char16_t *const arabic;
 };
 
-const UChar *const CommonChars::latin1 =
+const char16_t *const CommonChars::latin1 =
       // Goethe’s Bergschloß in normal sentence case.
       u"Da droben auf jenem Berge, da steht ein altes Schloß, "
       u"wo hinter Toren und Türen sonst lauerten Ritter und Roß.\n"
@@ -97,7 +97,7 @@ const UChar *const CommonChars::latin1 =
       u"Und Knapp und Kellnerin glänzen als Herren weit und breit; "
       u"sie nimmt sich zum Kredenzen und er zum Danke sich Zeit.\n";
 
-const UChar *const CommonChars::lowercaseLatin1 =
+const char16_t *const CommonChars::lowercaseLatin1 =
       // Goethe’s Bergschloß in all lowercase
       u"da droben auf jenem berge, da steht ein altes schloß, "
       u"wo hinter toren und türen sonst lauerten ritter und roß.\n"
@@ -126,7 +126,7 @@ const UChar *const CommonChars::lowercaseLatin1 =
       u"und knapp und kellnerin glänzen als herren weit und breit; "
       u"sie nimmt sich zum kredenzen und er zum danke sich zeit.\n";
 
-const UChar *const CommonChars::ascii =
+const char16_t *const CommonChars::ascii =
       // Goethe’s Bergschloß in normal sentence case but ASCII-fied
       u"Da droben auf jenem Berge, da steht ein altes Schloss, "
       u"wo hinter Toren und Tueren sonst lauerten Ritter und Ross.\n"
@@ -155,7 +155,7 @@ const UChar *const CommonChars::ascii =
       u"Und Knapp und Kellnerin glaenzen als Herren weit und breit; "
       u"sie nimmt sich zum Kredenzen und er zum Danke sich Zeit.\n";
 
-const UChar *const CommonChars::japanese =
+const char16_t *const CommonChars::japanese =
       // Ame ni mo makezu = Be not Defeated by the Rain, by Kenji Miyazawa.
       u"雨にもまけず風にもまけず雪にも夏の暑さにもまけぬ"
       u"丈夫なからだをもち慾はなく決して瞋らず"
@@ -172,7 +172,7 @@ const UChar *const CommonChars::japanese =
       u"さむさのなつはおろおろあるきみんなにでくのぼうとよばれ"
       u"ほめられもせずくにもされずそういうものにわたしはなりたい";
 
-const UChar *const CommonChars::arabic =
+const char16_t *const CommonChars::arabic =
       // Some Arabic for variety. "What is Unicode?"
       // http://www.unicode.org/standard/translations/arabic.html
       u"تتعامل الحواسيب بالأسام مع الأرقام فقط، "
@@ -241,7 +241,7 @@ public:
 private:
     const Normalizer2 &norm2;
     UnicodeString src;
-    const UChar *s;
+    const char16_t *s;
     UnicodeString dest;
 };
 
index 15ffdeec9a044242aea0409e00d60286fc65e653..f43c94f6ee7ff083b636130f441644a751ce0ff6 100644 (file)
@@ -38,7 +38,7 @@ StringSearchPerformanceTest::StringSearchPerformanceTest(int32_t argc, const cha
     start = ubrk_preceding(brk, 1000);
     end = ubrk_following(brk, start);
     pttrnLen = end - start;
-    UChar* temp = (UChar*)malloc(sizeof(UChar)*(pttrnLen));
+    char16_t* temp = (char16_t*)malloc(sizeof(char16_t)*(pttrnLen));
     for (int i = 0; i < pttrnLen; i++) {
         temp[i] = src[start++];
     }
@@ -49,7 +49,7 @@ StringSearchPerformanceTest::StringSearchPerformanceTest(int32_t argc, const cha
     start = 0;
 
     for(end = start; ; end += 1) {
-        UChar ch = src[end];
+        char16_t ch = src[end];
 
         if (ch == 0x000A || ch == 0x000D || ch == 0x2028) {
             break;
@@ -57,7 +57,7 @@ StringSearchPerformanceTest::StringSearchPerformanceTest(int32_t argc, const cha
     }
 
     pttrnLen = end - start;
-    UChar* temp = (UChar*)malloc(sizeof(UChar)*(pttrnLen));
+    char16_t* temp = (char16_t*)malloc(sizeof(char16_t)*(pttrnLen));
     for (int i = 0; i < pttrnLen; i++) {
         temp[i] = src[start++];
     }
index 5ea66b6309259ed800e88b64027465c29d1f0efa..3344c7cc012fa02fd28eab0ec50feb6759efd73e 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 
-typedef void (*StrSrchFn)(UStringSearch* srch, const UChar* src,int32_t srcLen, const UChar* pttrn, int32_t pttrnLen, UErrorCode* status);
+typedef void (*StrSrchFn)(UStringSearch* srch, const char16_t* src,int32_t srcLen, const char16_t* pttrn, int32_t pttrnLen, UErrorCode* status);
 
 class StringSearchPerfFunction : public UPerfFunction {
 private:
     StrSrchFn fn;
-    const UChar* src;
+    const char16_t* src;
     int32_t srcLen;
-    const UChar* pttrn;
+    const char16_t* pttrn;
     int32_t pttrnLen;
     UStringSearch* srch;
     
@@ -36,7 +36,7 @@ public:
         return (long) srcLen;
     }
     
-    StringSearchPerfFunction(StrSrchFn func, UStringSearch* search, const UChar* source,int32_t sourceLen, const UChar* pattern, int32_t patternLen) {
+    StringSearchPerfFunction(StrSrchFn func, UStringSearch* search, const char16_t* source,int32_t sourceLen, const char16_t* pattern, int32_t patternLen) {
         fn = func;
         src = source;
         srcLen = sourceLen;
@@ -48,9 +48,9 @@ public:
 
 class StringSearchPerformanceTest : public UPerfTest {
 private:
-    const UChar* src;
+    const char16_t* src;
     int32_t srcLen;
-    UChar* pttrn;
+    char16_t* pttrn;
     int32_t pttrnLen;
     UStringSearch* srch;
     
@@ -63,7 +63,7 @@ public:
 };
 
 
-void ICUForwardSearch(UStringSearch *srch, const UChar* source, int32_t sourceLen, const UChar* pattern, int32_t patternLen, UErrorCode* status) {
+void ICUForwardSearch(UStringSearch *srch, const char16_t* source, int32_t sourceLen, const char16_t* pattern, int32_t patternLen, UErrorCode* status) {
     int32_t match;
     
     match = usearch_first(srch, status);
@@ -72,7 +72,7 @@ void ICUForwardSearch(UStringSearch *srch, const UChar* source, int32_t sourceLe
     }
 }
 
-void ICUBackwardSearch(UStringSearch *srch, const UChar* source, int32_t sourceLen, const UChar* pattern, int32_t patternLen, UErrorCode* status) {
+void ICUBackwardSearch(UStringSearch *srch, const char16_t* source, int32_t sourceLen, const char16_t* pattern, int32_t patternLen, UErrorCode* status) {
     int32_t match;
     
     match = usearch_last(srch, status);
index 95581162fab180c5a520c36140d81998abc8feb6..341f4cd285cbbdfe821c0df097d92a0829a6f7af 100644 (file)
 class ICUBreakFunction : public UPerfFunction {
 protected:
   BreakIterator *m_brkIt_;
-  const UChar *m_file_;
+  const char16_t *m_file_;
   int32_t m_fileLen_;
   int32_t m_noBreaks_;
   UErrorCode m_status_;
 public:
-  ICUBreakFunction(const char *locale, const char *mode, const UChar *file, int32_t file_len) :
+  ICUBreakFunction(const char *locale, const char *mode, const char16_t *file, int32_t file_len) :
       m_brkIt_(nullptr),
       m_file_(file),
       m_fileLen_(file_len),
@@ -60,7 +60,7 @@ public:
 
 class ICUIsBound : public ICUBreakFunction {
 public:
-  ICUIsBound(const char *locale, const char *mode, const UChar *file, int32_t file_len) :
+  ICUIsBound(const char *locale, const char *mode, const char16_t *file, int32_t file_len) :
       ICUBreakFunction(locale, mode, file, file_len)
   {
     m_noBreaks_ = 0;
@@ -87,7 +87,7 @@ public:
 
 class ICUForward : public ICUBreakFunction {
 public:
-  ICUForward(const char *locale, const char *mode, const UChar *file, int32_t file_len) :
+  ICUForward(const char *locale, const char *mode, const char16_t *file, int32_t file_len) :
       ICUBreakFunction(locale, mode, file, file_len)
   {
     m_noBreaks_ = 0;
@@ -115,7 +115,7 @@ public:
 class BreakIteratorPerformanceTest : public UPerfTest {
 private:
   const char* m_mode_;
-  const UChar* m_file_;
+  const char16_t* m_file_;
   int32_t m_fileLen_;
 
 public:
index 2122fb417f4e4448b28f8a2254edd1a097bf5568..3e5c6f308b582c24c8adc1de63b33837080fa11f 100644 (file)
@@ -165,7 +165,7 @@ OptSpec opts[] = {
 
 //DWORD          gWinLCID;
 BreakIterator *brkit = nullptr;
-UChar *text = nullptr;
+char16_t *text = nullptr;
 int32_t textSize = 0;
 
 
@@ -474,7 +474,7 @@ class UCharFile {
 public:
     UCharFile(const char *fileName);
     ~UCharFile();
-    UChar   get();
+    char16_t   get();
     UBool   eof() {return fEof;};
     UBool   error() {return fError;};
     int32_t size() { return fFileSize; };
@@ -487,7 +487,7 @@ private:
     const char   *fName;
     UBool        fEof;
     UBool        fError;
-    UChar        fPending2ndSurrogate;
+    char16_t     fPending2ndSurrogate;
     int32_t      fFileSize;
     
     enum {UTF16LE, UTF16BE, UTF8} fEncoding;
@@ -541,8 +541,8 @@ UCharFile::~UCharFile() {
 
 
 
-UChar UCharFile::get() {
-    UChar   c;
+char16_t UCharFile::get() {
+    char16_t   c;
     switch (fEncoding) {
     case UTF16LE:
         {
@@ -576,7 +576,7 @@ UChar UCharFile::get() {
                 break;
             }
             
-            int ch = fgetc(fFile);   // Note:  c and ch are separate cause eof test doesn't work on UChar type.
+            int ch = fgetc(fFile);   // Note:  c and ch are separate cause eof test doesn't work on char16_t type.
             if (ch == EOF) {
                 c = 0;
                 fEof = true;
@@ -617,13 +617,13 @@ UChar UCharFile::get() {
             i = 0;
             uint32_t  cp;
             U8_NEXT_UNSAFE(bytes, i, cp);
-            c = (UChar)cp;
+            c = (char16_t)cp;
             
             if (cp >= 0x10000) {
                 // The code point needs to be broken up into a utf-16 surrogate pair.
                 //  Process first half this time through the main loop, and
                 //   remember the other half for the next time through.
-                UChar utf16Buf[3];
+                char16_t utf16Buf[3];
                 i = 0;
                 UTF16_APPEND_CHAR_UNSAFE(utf16Buf, i, cp);
                 fPending2ndSurrogate = utf16Buf[1];
@@ -693,10 +693,10 @@ int main(int argc, const char** argv) {
     int32_t bufSize = 0;
     int32_t charCount = 0;
     if(fileSize != -1) {
-      text = (UChar *)malloc(fileSize*sizeof(UChar));
+      text = (char16_t *)malloc(fileSize*sizeof(char16_t));
       bufSize = fileSize;
     } else {
-      text = (UChar *)malloc(STARTSIZE*sizeof(UChar));
+      text = (char16_t *)malloc(STARTSIZE*sizeof(char16_t));
       bufSize = STARTSIZE;
     }
     if(text == nullptr) {
@@ -710,7 +710,7 @@ int main(int argc, const char** argv) {
     //    (The number of bytes read from file per loop iteration depends on external encoding.)
     for (;;) {
 
-        UChar c = f.get();
+        char16_t c = f.get();
         if(f.eof()) {
           break;
         }
@@ -720,7 +720,7 @@ int main(int argc, const char** argv) {
         // We now have a good UTF-16 value in c.
         text[charCount++] = c;
         if(charCount == bufSize) {
-          text = (UChar *)realloc(text, 2*bufSize*sizeof(UChar));
+          text = (char16_t *)realloc(text, 2*bufSize*sizeof(char16_t));
           if(text == nullptr) {
             fprintf(stderr, "Reallocating buffer failed\n");
             exit(-1);
index aeb43d20e6ed1a242256299cd8ffa30265a385eb..fd9a3831811f76d369d03ddeffe3fc9164be2624 100644 (file)
@@ -26,13 +26,13 @@ public:
 
     virtual UBool contains(UChar32 c) const = 0;
 
-    virtual int32_t span(const UChar *s, int32_t length);
+    virtual int32_t span(const char16_t *s, int32_t length);
 
-    virtual int32_t spanNot(const UChar *s, int32_t length);
+    virtual int32_t spanNot(const char16_t *s, int32_t length);
 
-    virtual int32_t spanUTF8(const UChar *s, int32_t length);
+    virtual int32_t spanUTF8(const char16_t *s, int32_t length);
 
-    virtual int32_t spanNotUTF8(const UChar *s, int32_t length);
+    virtual int32_t spanNotUTF8(const char16_t *s, int32_t length);
 
     virtual UClassID getDynamicClassID(void) const;
 };
index 86a451765c5d91f52b1ac7755249aea5bdbf5253..9310a06950fe21cff03f6a7af5849d0ef2c7aaad 100644 (file)
@@ -80,7 +80,7 @@ public:
 
                 if(verbose) {
                     printf("code points:%ld  len16:%ld  len8:%ld  spans:%ld  "
-                           "cp/span:%.3g  UChar/span:%.3g  B/span:%.3g  B/cp:%.3g\n",
+                           "cp/span:%.3g  char16_t/span:%.3g  B/span:%.3g  B/cp:%.3g\n",
                            (long)countInputCodePoints, (long)bufferLen, (long)utf8Length, (long)spanCount,
                            (double)countInputCodePoints/spanCount, (double)bufferLen/spanCount, (double)utf8Length/spanCount,
                            (double)utf8Length/countInputCodePoints);
@@ -96,7 +96,7 @@ public:
     // If the very first character is in the set, then one additional
     // not-span is counted.
     void countSpans() {
-        const UChar *s=getBuffer();
+        const char16_t *s=getBuffer();
         int32_t length=getBufferLen();
         int32_t i=0;
         UBool tf=false;
@@ -106,7 +106,7 @@ public:
             ++spanCount;
         }
     }
-    int32_t span(const UChar *s, int32_t length, int32_t start, UBool tf) const {
+    int32_t span(const char16_t *s, int32_t length, int32_t start, UBool tf) const {
         UChar32 c;
         int32_t prev;
         while((prev=start)<length) {
@@ -118,7 +118,7 @@ public:
         return prev;
     }
 
-    const UChar *getBuffer() const { return buffer; }
+    const char16_t *getBuffer() const { return buffer; }
     int32_t getBufferLen() const { return bufferLen; }
 
     char *utf8;
@@ -177,7 +177,7 @@ public:
     }
     virtual void call(UErrorCode* pErrorCode) {
         const UnicodeSet &set=testcase.set;
-        const UChar *s=testcase.getBuffer();
+        const char16_t *s=testcase.getBuffer();
         int32_t length=testcase.getBufferLen();
         int32_t count=0;
         int32_t i=0;
@@ -192,7 +192,7 @@ public:
                     (long)count, (long)testcase.spanCount);
         }
     }
-    static int32_t span(const UnicodeSet &set, const UChar *s, int32_t length, UBool tf) {
+    static int32_t span(const UnicodeSet &set, const char16_t *s, int32_t length, UBool tf) {
         UChar32 c;
         int32_t start=0, prev;
         while((prev=start)<length) {
@@ -210,19 +210,19 @@ protected:
     SpanUTF16(const UnicodeSetPerformanceTest &testcase) : Command(testcase) {
         // Verify that the frozen set is equal to the unfrozen one.
         UnicodeSet set;
-        UChar utf16[2];
+        char16_t utf16[2];
         UChar32 c, c2;
 
         for(c=0; c<=0xffff; ++c) {
-            utf16[0]=(UChar)c;
+            utf16[0]=(char16_t)c;
             if(testcase.set.span(utf16, 1, USET_SPAN_CONTAINED)>0) {
                 set.add(c);
             }
         }
         for(c=0xd800; c<=0xdbff; ++c) {
-            utf16[0]=(UChar)c;
+            utf16[0]=(char16_t)c;
             for(c2=0xdc00; c2<=0xdfff; ++c2) {
-                utf16[1]=(UChar)c2;
+                utf16[1]=(char16_t)c2;
                 if(testcase.set.span(utf16, 2, USET_SPAN_CONTAINED)>0) {
                     set.add(U16_GET_SUPPLEMENTARY(c, c2));
                 }
@@ -239,7 +239,7 @@ public:
     }
     virtual void call(UErrorCode* pErrorCode) {
         const UnicodeSet &set=testcase.set;
-        const UChar *s=testcase.getBuffer();
+        const char16_t *s=testcase.getBuffer();
         int32_t length=testcase.getBufferLen();
         int32_t count=0;
         int32_t i=0;
@@ -261,19 +261,19 @@ protected:
     SpanBackUTF16(const UnicodeSetPerformanceTest &testcase) : Command(testcase) {
         // Verify that the frozen set is equal to the unfrozen one.
         UnicodeSet set;
-        UChar utf16[2];
+        char16_t utf16[2];
         UChar32 c, c2;
 
         for(c=0; c<=0xffff; ++c) {
-            utf16[0]=(UChar)c;
+            utf16[0]=(char16_t)c;
             if(testcase.set.spanBack(utf16, 1, USET_SPAN_CONTAINED)==0) {
                 set.add(c);
             }
         }
         for(c=0xd800; c<=0xdbff; ++c) {
-            utf16[0]=(UChar)c;
+            utf16[0]=(char16_t)c;
             for(c2=0xdc00; c2<=0xdfff; ++c2) {
-                utf16[1]=(UChar)c2;
+                utf16[1]=(char16_t)c2;
                 if(testcase.set.spanBack(utf16, 2, USET_SPAN_CONTAINED)==0) {
                     set.add(U16_GET_SUPPLEMENTARY(c, c2));
                 }
@@ -290,7 +290,7 @@ public:
     }
     virtual void call(UErrorCode* pErrorCode) {
         const UnicodeSet &set=testcase.set;
-        const UChar *s=testcase.getBuffer();
+        const char16_t *s=testcase.getBuffer();
         int32_t length=testcase.getBufferLen();
         int32_t count=0;
         /*
index 13f52e22892ebb2a5634717a7c5a2dc999f14919..cc3370a747d8ec2f9279231b83402149fd93a760 100644 (file)
@@ -96,20 +96,20 @@ StringPerformanceTest::StringPerformanceTest(int32_t argc, const char *argv[],
         filelines_ = new ULine[numLines];
         for (int i =0; i < numLines; i++) {
             len = filelines[i].len;
-            filelines_[i].name  = new UChar[len];
+            filelines_[i].name  = new char16_t[len];
             filelines_[i].len   = len;
             memcpy(filelines_[i].name, filelines[i].name, len * U_SIZEOF_UCHAR);
         }
 
     }else if(bulk_mode){
         int32_t srcLen = 0;
-        const UChar* src = getBuffer(srcLen,status);
+        const char16_t* src = getBuffer(srcLen,status);
         if(U_FAILURE(status)){
             fprintf(stderr, "FAILED to read buffer from file and create UPerfTest object. Error: %s\n", u_errorName(status));
             return;
         }
 
-        StrBuffer = new UChar[srcLen];
+        StrBuffer = new char16_t[srcLen];
         StrBufferLen = srcLen;
         memcpy(StrBuffer, src, srcLen * U_SIZEOF_UCHAR);
 
index ee353774016ff397e3b0920e8a68ec612eeb7e2b..eae8f9f440624b6fefe00b4c42c26042fed0228e 100644 (file)
@@ -30,7 +30,7 @@ typedef std::wstring stlstring;
 //#define LOOPS 10
 #define catenate_STRLEN 2
 
-const UChar uTESTCHAR1 =  'a';
+const char16_t uTESTCHAR1 =  'a';
 const wchar_t wTESTCHAR1 = 'a';
 const UnicodeString uEMPTY;
 const stlstring sEMPTY;
@@ -60,7 +60,7 @@ struct  WLine {
 
 enum FnType { Fn_ICU, Fn_STD };
 typedef FnType FnType;
-typedef void (*ICUStringPerfFn)(const UChar* src,int32_t srcLen, UnicodeString s0);
+typedef void (*ICUStringPerfFn)(const char16_t* src,int32_t srcLen, UnicodeString s0);
 typedef void (*StdStringPerfFn)(const wchar_t* src,int32_t srcLen, stlstring s0);
 
 
@@ -183,7 +183,7 @@ public:
         prepareLinesForStd();
     }
 
-    StringPerfFunction(ICUStringPerfFn func, UChar* source, int32_t sourceLen, UBool uselen)
+    StringPerfFunction(ICUStringPerfFn func, char16_t* source, int32_t sourceLen, UBool uselen)
     {
 
         fn1_ = func;
@@ -192,7 +192,7 @@ public:
         numLines_=0;
         uselen_=uselen;
         line_mode_=false;
-        src_ = new UChar[sourceLen];
+        src_ = new char16_t[sourceLen];
         memcpy(src_, source, sourceLen * U_SIZEOF_UCHAR);
         srcLen_ = sourceLen;
         wsrc_ = nullptr;
@@ -205,7 +205,7 @@ public:
         sbulk_=nullptr;
     }
 
-    StringPerfFunction(StdStringPerfFn func, UChar* source, int32_t sourceLen, UBool uselen)
+    StringPerfFunction(StdStringPerfFn func, char16_t* source, int32_t sourceLen, UBool uselen)
     {
 
         fn2_ = func;
@@ -214,7 +214,7 @@ public:
         numLines_=0;
         uselen_=uselen;
         line_mode_=false;
-        src_ = new UChar[sourceLen];
+        src_ = new char16_t[sourceLen];
         memcpy(src_, source, sourceLen * U_SIZEOF_UCHAR);
         srcLen_ = sourceLen;
         fnType_ = Fn_STD;
@@ -276,7 +276,7 @@ private:
     {
         UErrorCode err=U_ZERO_ERROR;
 
-        const UChar* uSrc = src_;
+        const char16_t* uSrc = src_;
         int32_t uSrcLen = srcLen_;
         wchar_t* wDest = nullptr;
         int32_t wDestLen = 0;
@@ -330,7 +330,7 @@ private:
     int32_t numLines_;
 
     UBool uselen_;
-    UChar* src_;
+    char16_t* src_;
     int32_t srcLen_;
     wchar_t* wsrc_;
     int32_t wsrcLen_;
@@ -382,60 +382,60 @@ public:
 private:
     long COUNT_;
     ULine* filelines_;
-    UChar* StrBuffer;
+    char16_t* StrBuffer;
     int32_t StrBufferLen;
 
 };
 
 
-inline void ctor(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void ctor(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     UnicodeString a;
 }
 
-inline void ctor1(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void ctor1(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     UnicodeString b(uTESTCHAR1);
 }
 
-inline void ctor2(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void ctor2(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     UnicodeString c(uEMPTY);
 }
 
-inline void ctor3(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void ctor3(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     UnicodeString d(src,srcLen);
 }
 
-inline UnicodeString icu_assign_helper(const UChar* src,int32_t srcLen)
+inline UnicodeString icu_assign_helper(const char16_t* src,int32_t srcLen)
 {
     if (srcLen==-1) { return src;}
     else { return UnicodeString(src, srcLen);}
 }
 
-inline void assign(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void assign(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     unistr = icu_assign_helper(src,srcLen);
 }
 
-inline void assign1(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void assign1(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     unistr.setTo(src, srcLen);
 }
 
-inline void assign2(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void assign2(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     unistr = s0;
 }
 
-inline void getch(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void getch(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     s0.charAt(0);
 }
 
 
-inline void catenate(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void catenate(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     UTimer mystart, mystop;
     utimer_getTime(&mystart);
@@ -451,21 +451,21 @@ inline void catenate(const UChar* src,int32_t srcLen, UnicodeString s0)
 volatile int scan_idx;
 U_STRING_DECL(SCAN1, "123", 3);
 
-inline void scan(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void scan(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
-    UChar c='.';
+    char16_t c='.';
     scan_idx = uScan_STRING.indexOf(c);
 }
 
-inline void scan1(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void scan1(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
     scan_idx = uScan_STRING.indexOf(SCAN1,3);
 }
 
-inline void scan2(const UChar* src,int32_t srcLen, UnicodeString s0)
+inline void scan2(const char16_t* src,int32_t srcLen, UnicodeString s0)
 {
-    UChar c1='s';
-    UChar c2='m';
+    char16_t c1='s';
+    char16_t c2='m';
     scan_idx = uScan_STRING.indexOf(c1);
     scan_idx = uScan_STRING.indexOf(c2);
 }
index d4adacf84fe66aa4d26f77f67cb3a3f4790597e0..706f2c9655a416214ad1524c89c691ed108a347c 100644 (file)
@@ -34,9 +34,9 @@
 #define OUTPUT_CAPACITY INPUT_CAPACITY
 
 static char utf8[INPUT_CAPACITY];
-static UChar pivot[INTERMEDIATE_CAPACITY];
+static char16_t pivot[INTERMEDIATE_CAPACITY];
 
-static UChar output[OUTPUT_CAPACITY];
+static char16_t output[OUTPUT_CAPACITY];
 static char intermediate[OUTPUT_CAPACITY];
 
 static int32_t utf8Length, encodedLength, outputLength, countInputCodePoints;
@@ -95,7 +95,7 @@ public:
 
     virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = nullptr);
 
-    const UChar *getBuffer() const { return buffer; }
+    const char16_t *getBuffer() const { return buffer; }
     int32_t getBufferLen() const { return bufferLen; }
 
     const char *charset;
@@ -107,7 +107,7 @@ U_CDECL_BEGIN
 static void U_CALLCONV
 fromUCallback(const void *context,
               UConverterFromUnicodeArgs *fromUArgs,
-              const UChar *codeUnits,
+              const char16_t *codeUnits,
               int32_t length,
               UChar32 codePoint,
               UConverterCallbackReason reason,
@@ -144,7 +144,7 @@ public:
     }
 
     const UtfPerformanceTest &testcase;
-    const UChar *input;
+    const char16_t *input;
     int32_t inputLength;
     UErrorCode errorCode;
     UConverter *cnv;
@@ -165,8 +165,8 @@ public:
         }
     }
     virtual void call(UErrorCode* pErrorCode){
-        const UChar *pIn, *pInLimit;
-        UChar *pOut, *pOutLimit;
+        const char16_t *pIn, *pInLimit;
+        char16_t *pOut, *pOutLimit;
         char *pInter, *pInterLimit;
         const char *p;
         UBool flush;
@@ -232,7 +232,7 @@ public:
         }
     }
     virtual void call(UErrorCode* pErrorCode){
-        const UChar *pIn, *pInLimit;
+        const char16_t *pIn, *pInLimit;
         char *pInter, *pInterLimit;
 
         ucnv_resetFromUnicode(cnv);
@@ -287,7 +287,7 @@ public:
     virtual void call(UErrorCode* pErrorCode){
         const char *pIn, *pInLimit;
         char *pInter, *pInterLimit;
-        UChar *pivotSource, *pivotTarget, *pivotLimit;
+        char16_t *pivotSource, *pivotTarget, *pivotLimit;
 
         ucnv_resetToUnicode(utf8Cnv);
         ucnv_resetFromUnicode(cnv);
index 30f9fea1086ce214d8d351fcc6609cbc0f00b95a..5cbef68ad1247d03af3898907eb614f99217f325 100644 (file)
@@ -83,7 +83,7 @@ public:
 
     virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = nullptr);
 
-    const UChar *getBuffer() const { return buffer; }
+    const char16_t *getBuffer() const { return buffer; }
     int32_t getBufferLen() const { return bufferLen; }
 
     char *utf8;
@@ -180,7 +180,7 @@ protected:
                                      UNORM_NFC, 0,
                                      nullptr, 0,
                                      &errorCode);
-        dest=new UChar[destCapacity];
+        dest=new char16_t[destCapacity];
     }
     ~ToNFC() {
         delete [] dest;
@@ -202,7 +202,7 @@ public:
     }
 
 private:
-    UChar *dest;
+    char16_t *dest;
     int32_t destCapacity;
 };
 
@@ -214,7 +214,7 @@ public:
         return new GetBiDiClass(testcase);
     }
     virtual void call(UErrorCode* pErrorCode) {
-        const UChar *buffer=testcase.getBuffer();
+        const char16_t *buffer=testcase.getBuffer();
         int32_t length=testcase.getBufferLen();
         UChar32 c;
         int32_t i;
index de5d1f8865e4d539ab58ae1779945c7b1c954867..f377b3aafd800dc0481e34565ba1439e55675abb 100644 (file)
@@ -40,7 +40,7 @@ public:
     // The constructor:
     // text  - pointer to an array of UChars to iterate over
     // count - the number of UChars in text
-    SpaceBreakIterator(const UChar *text, int32_t count);
+    SpaceBreakIterator(const char16_t *text, int32_t count);
 
     // the destructor
     ~SpaceBreakIterator();
@@ -61,8 +61,8 @@ private:
     // The underlying BreakIterator
     BreakIterator *fBreakIter;
 
-    // address of the UChar array
-    const UChar *fText;
+    // address of the char16_t array
+    const char16_t *fText;
 
     // number of UChars in fText
     int32_t fTextCount;
@@ -87,12 +87,12 @@ class ThaiWordbreakTest
 {
 public:
     // The main constructor:
-    // spaces       - pointer to a UChar array for the text with spaces
+    // spaces       - pointer to a char16_t array for the text with spaces
     // spaceCount   - the number of characters in the spaces array
-    // noSpaces     - pointer to a UChar array for the text without spaces
+    // noSpaces     - pointer to a char16_t array for the text without spaces
     // noSpaceCount - the number of characters in the noSpaces array
     // verbose      - report all breaks if true, otherwise just report differences
-    ThaiWordbreakTest(const UChar *spaces, int32_t spaceCount, const UChar *noSpaces, int32_t noSpaceCount, UBool verbose);
+    ThaiWordbreakTest(const char16_t *spaces, int32_t spaceCount, const char16_t *noSpaces, int32_t noSpaceCount, UBool verbose);
     ~ThaiWordbreakTest();
 
     // returns the number of breaks that are in the spaces array
@@ -109,28 +109,28 @@ public:
     // reads the input Unicode text file:
     // fileName  - the path name of the file
     // charCount - set to the number of UChars read from the file
-    // returns   - the address of the UChar array containing the characters
-    static const UChar *readFile(char *fileName, int32_t &charCount);
+    // returns   - the address of the char16_t array containing the characters
+    static const char16_t *readFile(char *fileName, int32_t &charCount);
 
-    // removes spaces form the input UChar array:
-    // spaces        - pointer to the input UChar array
+    // removes spaces form the input char16_t array:
+    // spaces        - pointer to the input char16_t array
     // count         - number of UChars in the spaces array
     // nonSpaceCount - the number of UChars in the result array
-    // returns       - the address of the UChar array with spaces removed
-    static const UChar *crunchSpaces(const UChar *spaces, int32_t count, int32_t &nonSpaceCount);
+    // returns       - the address of the char16_t array with spaces removed
+    static const char16_t *crunchSpaces(const char16_t *spaces, int32_t count, int32_t &nonSpaceCount);
 
 private:
     // The no arg constructor - private so clients can't call it
     ThaiWordbreakTest();
 
     // This does the actual comparison:
-    // spaces - the address of the UChar array for the text with spaces
+    // spaces - the address of the char16_t array for the text with spaces
     // spaceCount - the number of UChars in the spaces array
-    // noSpaces   - the address of the UChar array for the text without spaces
+    // noSpaces   - the address of the char16_t array for the text without spaces
     // noSpaceCount - the number of UChars in the noSpaces array
     // returns      - true if all breaks match, false otherwise
-    UBool compareWordBreaks(const UChar *spaces, int32_t spaceCount,
-                            const UChar *noSpaces, int32_t noSpaceCount);
+    UBool compareWordBreaks(const char16_t *spaces, int32_t spaceCount,
+                            const char16_t *noSpaces, int32_t noSpaceCount);
 
     // helper method to report a break in the spaces
     // array that's not found in the noSpaces array
@@ -158,8 +158,8 @@ private:
 /*
  * The main constructor: it calls compareWordBreaks and reports any differences
  */
-ThaiWordbreakTest::ThaiWordbreakTest(const UChar *spaces, int32_t spaceCount,
-                                     const UChar *noSpaces, int32_t noSpaceCount, UBool verbose)
+ThaiWordbreakTest::ThaiWordbreakTest(const char16_t *spaces, int32_t spaceCount,
+                                     const char16_t *noSpaces, int32_t noSpaceCount, UBool verbose)
 : fBreaksNotFound(0), fInvalidBreaks(0), fWordCount(0), fVerbose(verbose)
 {
     compareWordBreaks(spaces, spaceCount, noSpaces, noSpaceCount);
@@ -213,8 +213,8 @@ inline int32_t ThaiWordbreakTest::getWordCount()
  * and a word instance of a Thai BreakIterator to iterate over the text
  * without spaces.
  */
-UBool ThaiWordbreakTest::compareWordBreaks(const UChar *spaces, int32_t spaceCount,
-                                           const UChar *noSpaces, int32_t noSpaceCount)
+UBool ThaiWordbreakTest::compareWordBreaks(const char16_t *spaces, int32_t spaceCount,
+                                           const char16_t *noSpaces, int32_t noSpaceCount)
 {
     UBool result = true;
     Locale thai("th");
@@ -304,12 +304,12 @@ void ThaiWordbreakTest::foundInvalidBreak(int32_t br)
  * Read the text from a file. The text must start with a Unicode Byte
  * Order Mark (BOM) so that we know what order to read the bytes in.
  */
-const UChar *ThaiWordbreakTest::readFile(char *fileName, int32_t &charCount)
+const char16_t *ThaiWordbreakTest::readFile(char *fileName, int32_t &charCount)
 {
     FILE *f;
     int32_t fileSize;
     
-    UChar *buffer;
+    char16_t *buffer;
     char *bufferChars;
     
     f = fopen(fileName, "rb");
@@ -345,7 +345,7 @@ const UChar *ThaiWordbreakTest::readFile(char *fileName, int32_t &charCount)
     delete[] bufferChars;
     
     charCount = myText.length();
-    buffer = new UChar[charCount];
+    buffer = new char16_t[charCount];
     if(buffer == 0) {
         fprintf(stderr,"Couldn't get memory for reading %s reason: %s \n", fileName, strerror(errno));
         return 0;
@@ -359,13 +359,13 @@ const UChar *ThaiWordbreakTest::readFile(char *fileName, int32_t &charCount)
 }
 
 /*
- * Remove spaces from the input UChar array.
+ * Remove spaces from the input char16_t array.
  *
  * We check explicitly for a Unicode code value of 0x0020
  * because Unicode::isSpaceChar returns true for CR, LF, etc.
  *
  */
-const UChar *ThaiWordbreakTest::crunchSpaces(const UChar *spaces, int32_t count, int32_t &nonSpaceCount)
+const char16_t *ThaiWordbreakTest::crunchSpaces(const char16_t *spaces, int32_t count, int32_t &nonSpaceCount)
 {
     int32_t i, out, spaceCount;
 
@@ -377,7 +377,7 @@ const UChar *ThaiWordbreakTest::crunchSpaces(const UChar *spaces, int32_t count,
     }
 
     nonSpaceCount = count - spaceCount;
-    UChar *noSpaces = new UChar[nonSpaceCount];
+    char16_t *noSpaces = new char16_t[nonSpaceCount];
 
     if (noSpaces == 0) {
         fprintf(stderr, "Couldn't allocate memory for the space stripped text.\n");
@@ -396,7 +396,7 @@ const UChar *ThaiWordbreakTest::crunchSpaces(const UChar *spaces, int32_t count,
 /*
  * Generate a text file with spaces in it from a file without.
  */
-int generateFile(const UChar *chars, int32_t length) {
+int generateFile(const char16_t *chars, int32_t length) {
     Locale root("");
     UCharCharacterIterator *noSpaceIter = new UCharCharacterIterator(chars, length);
     UErrorCode status = U_ZERO_ERROR;
@@ -406,7 +406,7 @@ int generateFile(const UChar *chars, int32_t length) {
     breakIter->adoptText(noSpaceIter);
     char outbuf[1024];
     int32_t strlength;
-    UChar bom = 0xFEFF;
+    char16_t bom = 0xFEFF;
     
     printf("%s", u_strToUTF8(outbuf, sizeof(outbuf), &strlength, &bom, 1, &status));
     int32_t prevbreak = 0;
@@ -464,7 +464,7 @@ int main(int argc, char **argv)
     }
 
     int32_t spaceCount, nonSpaceCount;
-    const UChar *spaces, *noSpaces;
+    const char16_t *spaces, *noSpaces;
 
     spaces = ThaiWordbreakTest::readFile(fileName, spaceCount);
 
@@ -495,7 +495,7 @@ int main(int argc, char **argv)
  * The main constructor. Clear all the counts and construct a default
  * word instance of a BreakIterator.
  */
-SpaceBreakIterator::SpaceBreakIterator(const UChar *text, int32_t count)
+SpaceBreakIterator::SpaceBreakIterator(const char16_t *text, int32_t count)
   : fBreakIter(0), fText(text), fTextCount(count), fWordCount(0), fSpaceCount(0), fDone(false)
 {
     UCharCharacterIterator *iter = new UCharCharacterIterator(text, count);
index 6ab715eefb2b85c98bc7e65b850c740858bbaece..0dd86f4f5b3022590f2442691c4f77db74acafe0 100644 (file)
@@ -21,7 +21,7 @@ int32_t
 DataMap::utoi(const UnicodeString &s) const
 {
   char ch[256];
-  const UChar *u = toUCharPtr(s.getBuffer());
+  const char16_t *u = toUCharPtr(s.getBuffer());
   int32_t len = s.length();
   u_UCharsToChars(u, ch, len);
   ch[len] = 0; /* include terminating \0 */
@@ -85,7 +85,7 @@ void RBDataMap::init(UResourceBundle *headers, UResourceBundle *data, UErrorCode
   int32_t i = 0;
   fData->removeAll();
   UResourceBundle *t = nullptr;
-  const UChar *key = nullptr;
+  const char16_t *key = nullptr;
   int32_t keyLen = 0;
   if(ures_getSize(headers) == ures_getSize(data)) {
     for(i = 0; i < ures_getSize(data); i++) {
index e7e0479769f9633843467a9630ddd8836ba0f32f..fe6e7961c3fcd06adb255ddfef6b86f8197a2ef6 100644 (file)
@@ -145,7 +145,7 @@ public:
     
     ULine* getLines(UErrorCode& status);
 
-    const UChar* getBuffer(int32_t& len,UErrorCode& status);
+    const char16_t* getBuffer(int32_t& len,UErrorCode& status);
 
 protected:
     UPerfTest(int32_t argc, const char* argv[], UErrorCode& status);
@@ -177,7 +177,7 @@ protected:
     ULine*       lines;
     int32_t      numLines;
     UBool        line_mode;
-    UChar* buffer;
+    char16_t* buffer;
     int32_t      bufferLen;
     UBool        verbose;
     UBool        bulk_mode;
index ab7bcb8fb4084952a658221b22f25922d81f03c9..10f80833cba266459748658c759672d6e174fa89 100644 (file)
@@ -33,9 +33,9 @@
  *    <code>
  *      typedef Params Params;
  *      struct Params{
- *          UChar* target;
+ *          char16_t* target;
  *          int32_t targetLen;
- *          const UChar* source;
+ *          const char16_t* source;
  *          int32_t sourceLen;
  *          UNormalizationMode mode;
  *      }
  *          int  line;
  *          int  loops;
  *          UErrorCode error = U_ZERO_ERROR;
- *          UChar* dest=nullptr;
+ *          char16_t* dest=nullptr;
  *          int32_t destCapacity=0;
  *          int len =-1;
  *          double elapsedTime = 0; 
  *          int retVal=0;
  *
- *          UChar arr[5000];
+ *          char16_t arr[5000];
  *          dest=arr;
  *          destCapacity = 5000;
  *          UTimer start;
  * iii) Let a higher level function do the calculation of confidence levels etc.
  *     Example:
  *     <code>
- *       void perf(UTimer* timer, UChar* source, int32_t sourceLen, UChar* target, int32_t targetLen, int32_t loopCount,UNormalizationMode mode, UErrorCode* error){
+ *       void perf(UTimer* timer, char16_t* source, int32_t sourceLen, char16_t* target, int32_t targetLen, int32_t loopCount,UNormalizationMode mode, UErrorCode* error){
  *              int32_t loops;
  *              for (loops=0; loops<loopCount; loops++) {
  *                  unorm_normalize(source,sourceLen,target, targetLen,mode,error);
index 7a75dfbe035450deb84d200034e843ded5a06083..c4e90dd50d9daada37d0334ffc91f46c838a9ada 100644 (file)
@@ -218,14 +218,14 @@ ULine* UPerfTest::getLines(UErrorCode& status){
     lines     = new ULine[MAXLINES];
     int maxLines = MAXLINES;
     numLines=0;
-    const UChar* line=nullptr;
+    const char16_t* line=nullptr;
     int32_t len =0;
     for (;;) {
         line = ucbuf_readline(ucharBuf,&len,&status);
         if(line == nullptr || U_FAILURE(status)){
             break;
         }
-        lines[numLines].name  = new UChar[len];
+        lines[numLines].name  = new char16_t[len];
         lines[numLines].len   = len;
         memcpy(lines[numLines].name, line, len * U_SIZEOF_UCHAR);
 
@@ -248,12 +248,12 @@ ULine* UPerfTest::getLines(UErrorCode& status){
     }
     return lines;
 }
-const UChar* UPerfTest::getBuffer(int32_t& len, UErrorCode& status){
+const char16_t* UPerfTest::getBuffer(int32_t& len, UErrorCode& status){
     if (U_FAILURE(status)) {
         return nullptr;
     }
     len = ucbuf_size(ucharBuf);
-    buffer =  (UChar*) uprv_malloc(U_SIZEOF_UCHAR * (len+1));
+    buffer =  (char16_t*) uprv_malloc(U_SIZEOF_UCHAR * (len+1));
     u_strncpy(buffer,ucbuf_getBuffer(ucharBuf,&bufferLen,&status),len);
     buffer[len]=0;
     len = bufferLen;
index e94fa9036bc58e97875e8f3e884860ff99a38594..dce4af6867d698b542b7ab107de7e59ab6b68fa5 100644 (file)
@@ -25,8 +25,8 @@ int main(int argc, const char *argv[]) {
   for(int i=0x00; i<0x100; i++) {
     char cp1047[1];
     cp1047[0] = i;
-    UChar u[1];
-    UChar *target = u;
+    char16_t u[1];
+    char16_t *target = u;
     const char *source = cp1047;
     ucnv_toUnicode(cnv.getAlias(), &target, u+1, &source, cp1047+1, nullptr, true, &status);
     if(U_FAILURE(status)) {
@@ -69,7 +69,7 @@ Some discussion at http://unicode.org/mail-arch/unicode-ml/y2003-m10/0471.html
 
 
   printf("static const bool oldIllegal[256] = { \n");
-  for(UChar i=0x00; i<0x100;i++) {
+  for(char16_t i=0x00; i<0x100;i++) {
     printf(" %s, /* U+%04X */\n",
            (oldIllegal.contains(i))?" true":"false",
            i);
index a83d782b411f2ba10c08ef59208e860f08050c4c..2b175d459b3a3aa1e2352e15b213972ff3485c9c 100644 (file)
@@ -250,7 +250,7 @@ int  main(int argc, char **argv) {
     }
 
     //
-    // Convert the rules to UChar.
+    // Convert the rules to char16_t.
     //  Preflight first to determine required buffer size.
     //
     uint32_t destCap = ucnv_toUChars(conv,
@@ -265,7 +265,7 @@ int  main(int argc, char **argv) {
     }
 
     status = U_ZERO_ERROR;
-    UChar *ruleSourceU = new UChar[destCap+1];
+    char16_t *ruleSourceU = new char16_t[destCap+1];
     ucnv_toUChars(conv,
                   ruleSourceU,     //  dest,
                   destCap+1,
index f4ddb62b6717364c976f434621ecab59632eb755..ee12e69f9b39c879048153eebdae973c4e4bcb5d 100644 (file)
@@ -76,7 +76,7 @@ int main(int argc, const char *argv[]) {
     }
 
 
-    const UChar *buf = pattern.getBuffer();
+    const char16_t *buf = pattern.getBuffer();
     int32_t needed = pattern.length();
 
     // print
@@ -118,7 +118,7 @@ int main(int argc, const char *argv[]) {
 #if PATTERN
   printf("#define COLLUNSAFE_PATTERN 1\n");
   printf("static const int32_t collunsafe_len = %d;\n", needed);
-  printf("static const UChar collunsafe_pattern[collunsafe_len] = {\n");
+  printf("static const char16_t collunsafe_pattern[collunsafe_len] = {\n");
   for(int i=0;i<needed;i++) {
     if( (i>0) && (i%8 == 0) ) {
       printf(" // %d\n", i);
index f7e09b35fb135f3c8e53a02bb15932f147311253..995bd327249bad1d19027ac2c1d678ea20aede6e 100644 (file)
@@ -217,15 +217,15 @@ public:
 };
 #endif
 
-static const UChar LINEFEED_CHARACTER = 0x000A;
-static const UChar CARRIAGE_RETURN_CHARACTER = 0x000D;
+static const char16_t LINEFEED_CHARACTER = 0x000A;
+static const char16_t CARRIAGE_RETURN_CHARACTER = 0x000D;
 
 static UBool readLine(UCHARBUF *f, UnicodeString &fileLine, IcuToolErrorCode &errorCode) {
     int32_t lineLength;
-    const UChar *line = ucbuf_readline(f, &lineLength, errorCode);
+    const char16_t *line = ucbuf_readline(f, &lineLength, errorCode);
     if(line == nullptr || errorCode.isFailure()) { return false; }
     // Strip trailing CR/LF, comments, and spaces.
-    const UChar *comment = u_memchr(line, 0x23, lineLength);  // '#'
+    const char16_t *comment = u_memchr(line, 0x23, lineLength);  // '#'
     if(comment != nullptr) {
         lineLength = (int32_t)(comment - line);
     } else {
@@ -463,7 +463,7 @@ int  main(int argc, char **argv) {
             printf("%s -> %i\n", s.data(), val);
         }
     } else {
-        UCharsTrie::Iterator it((const UChar *)outData, outDataSize, status);
+        UCharsTrie::Iterator it((const char16_t *)outData, outDataSize, status);
         while (it.hasNext()) {
             it.next(status);
             const UnicodeString s = it.getString();
index c833d484c97ce8b14bab11c5ea8b88eb0294c7c1..f31bc418ea9a9b3904bfc4d7813f025b3b5688e5 100644 (file)
@@ -53,7 +53,7 @@ int32_t ExtraData::writeMapping(UChar32 c, const Norm &norm, UnicodeString &data
                     (long)c, Normalizer2Impl::MAPPING_LENGTH_MASK);
             exit(U_INVALID_FORMAT_ERROR);
         }
-        UChar rm0=rm.charAt(0);
+        char16_t rm0=rm.charAt(0);
         if( rmLength==length-1 &&
             // 99: overlong substring lengths get pinned to remainder lengths anyway
             0==rm.compare(1, 99, m, 2, 99) &&
@@ -71,18 +71,18 @@ int32_t ExtraData::writeMapping(UChar32 c, const Norm &norm, UnicodeString &data
         } else {
             // Store the raw mapping with its length.
             dataString.append(rm);
-            dataString.append((UChar)rmLength);
+            dataString.append((char16_t)rmLength);
             preMappingLength=rmLength+1;
         }
         firstUnit|=Normalizer2Impl::MAPPING_HAS_RAW_MAPPING;
     }
     int32_t cccLccc=norm.cc|(norm.leadCC<<8);
     if(cccLccc!=0) {
-        dataString.append((UChar)cccLccc);
+        dataString.append((char16_t)cccLccc);
         ++preMappingLength;
         firstUnit|=Normalizer2Impl::MAPPING_HAS_CCC_LCCC_WORD;
     }
-    dataString.append((UChar)firstUnit);
+    dataString.append((char16_t)firstUnit);
     dataString.append(m);
     return preMappingLength;
 }
@@ -165,9 +165,9 @@ void ExtraData::writeCompositions(UChar32 c, const Norm &norm, UnicodeString &da
         if(i==(length-1)) {
             firstUnit|=Normalizer2Impl::COMP_1_LAST_TUPLE;
         }
-        dataString.append((UChar)firstUnit).append((UChar)secondUnit);
+        dataString.append((char16_t)firstUnit).append((char16_t)secondUnit);
         if(thirdUnit>=0) {
-            dataString.append((UChar)thirdUnit);
+            dataString.append((char16_t)thirdUnit);
         }
     }
 }
index 247a710702367fdb93e56a68afa9a2cac60e2602..338878e6238c3b14644d2dd829162875f14748c5 100644 (file)
@@ -296,7 +296,7 @@ void parseFile(std::ifstream &f, Normalizer2DataBuilder &builder) {
             continue;
         }
         if(*delimiter=='=' || *delimiter=='>') {
-            UChar uchars[Normalizer2Impl::MAPPING_LENGTH_MASK];
+            char16_t uchars[Normalizer2Impl::MAPPING_LENGTH_MASK];
             int32_t length=u_parseString(delimiter+1, uchars, UPRV_LENGTHOF(uchars), nullptr, errorCode);
             if(errorCode.isFailure()) {
                 fprintf(stderr, "gennorm2 error: parsing mapping string from %s\n", line);
index 8790f8c28c7d81d2ff85e351e636c06ed26ed190..1de031c6bb804a8896e7c0be89d403f47835c386 100644 (file)
@@ -596,7 +596,7 @@ LocalUCPTriePointer Normalizer2DataBuilder::processData() {
     // Pad the maybeYesCompositions length to a multiple of 4,
     // so that NO_NO_DELTA bits 2..1 can be used without subtracting the center.
     while(extra.maybeYesCompositions.length()&3) {
-        extra.maybeYesCompositions.append((UChar)0);
+        extra.maybeYesCompositions.append((char16_t)0);
     }
     extraData.insert(0, extra.maybeYesCompositions);
     indexes[Normalizer2Impl::IX_MIN_MAYBE_YES]=
@@ -605,7 +605,7 @@ LocalUCPTriePointer Normalizer2DataBuilder::processData() {
 
     // Pad to even length for 4-byte alignment of following data.
     if(extraData.length()&1) {
-        extraData.append((UChar)0);
+        extraData.append((char16_t)0);
     }
 
     int32_t minNoNoDelta=getMinNoNoDelta();
index b96c704ed4252079bb8650ee92ab8ad9fb14a330..9dd8dca977cbf766cfd9383010c86d54342645c8 100644 (file)
@@ -231,7 +231,7 @@ void Decomposer::rangeHandler(UChar32 start, UChar32 end, Norm &norm) {
     if(!norm.hasMapping()) { return; }
     const UnicodeString &m=*norm.mapping;
     UnicodeString *decomposed=nullptr;
-    const UChar *s=toUCharPtr(m.getBuffer());
+    const char16_t *s=toUCharPtr(m.getBuffer());
     int32_t length=m.length();
     int32_t prev, i=0;
     UChar32 c;
@@ -286,7 +286,7 @@ void Decomposer::rangeHandler(UChar32 start, UChar32 end, Norm &norm) {
             }
             decomposed->append(*cNorm.mapping);
         } else if(Hangul::isHangul(c)) {
-            UChar buffer[3];
+            char16_t buffer[3];
             int32_t hangulLength=Hangul::decompose(c, buffer);
             if(norm.mappingType==Norm::ROUND_TRIP && prev!=0) {
                 fprintf(stderr,
index 0454670ac5fe37fa1554b980e81a21e239af5e40..3b28289569268a9607a7a0cc471e7f27a7860187 100644 (file)
@@ -44,9 +44,9 @@ static UBool opt_truncate = false;
 
 static const char *getEncodingName(const char *encoding);
 static void reportError(const char *pname, UErrorCode *status, const char *when);
-static UChar *quotedString(const UChar *string);
+static char16_t *quotedString(const char16_t *string);
 static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent, const char *pname, UErrorCode *status);
-static void printString(UFILE *out, const UChar *str, int32_t len);
+static void printString(UFILE *out, const char16_t *str, int32_t len);
 static void printCString(UFILE *out, const char *str, int32_t len);
 static void printIndent(UFILE *out, int32_t indent);
 static void printHex(UFILE *out, uint8_t what);
@@ -178,7 +178,7 @@ main(int argc, char* argv[]) {
     ustderr = u_finit(stderr, nullptr, nullptr);
 
     for (i = 1; i < argc; ++i) {
-        static const UChar sp[] = { 0x0020 }; /* " " */
+        static const char16_t sp[] = { 0x0020 }; /* " " */
 
         arg = getLongPathname(argv[i]);
 
@@ -319,11 +319,11 @@ main(int argc, char* argv[]) {
     return 0;
 }
 
-static UChar *quotedString(const UChar *string) {
+static char16_t *quotedString(const char16_t *string) {
     int len = u_strlen(string);
     int alen = len;
-    const UChar *sp;
-    UChar *newstr, *np;
+    const char16_t *sp;
+    char16_t *newstr, *np;
 
     for (sp = string; *sp; ++sp) {
         switch (*sp) {
@@ -334,7 +334,7 @@ static UChar *quotedString(const UChar *string) {
         }
     }
 
-    newstr = (UChar *) uprv_malloc((1 + alen) * U_SIZEOF_UCHAR);
+    newstr = (char16_t *) uprv_malloc((1 + alen) * U_SIZEOF_UCHAR);
     for (sp = string, np = newstr; *sp; ++sp) {
         switch (*sp) {
             case '\n':
@@ -356,7 +356,7 @@ static UChar *quotedString(const UChar *string) {
 }
 
 
-static void printString(UFILE *out, const UChar *str, int32_t len) {
+static void printString(UFILE *out, const char16_t *str, int32_t len) {
   u_file_write(str, len, out);
 }
 
@@ -375,7 +375,7 @@ static void printIndent(UFILE *out, int32_t indent) {
 
 static void printHex(UFILE *out, uint8_t what) {
     static const char map[] = "0123456789ABCDEF";
-    UChar hex[2];
+    char16_t hex[2];
 
     hex[0] = map[what >> 4];
     hex[1] = map[what & 0xf];
@@ -384,10 +384,10 @@ static void printHex(UFILE *out, uint8_t what) {
 }
 
 static void printOutAlias(UFILE *out,  UResourceBundle *parent, Resource r, const char *key, int32_t indent, const char *pname, UErrorCode *status) {
-    static const UChar cr[] = { 0xA };  // LF
+    static const char16_t cr[] = { 0xA };  // LF
     int32_t len = 0;
-    const UChar* thestr = res_getAlias(&(parent->getResData()), r, &len);
-    UChar *string = quotedString(thestr);
+    const char16_t* thestr = res_getAlias(&(parent->getResData()), r, &len);
+    char16_t *string = quotedString(thestr);
     if(opt_truncate && len > truncsize) {
         char msg[128];
         printIndent(out, indent);
@@ -397,8 +397,8 @@ static void printOutAlias(UFILE *out,  UResourceBundle *parent, Resource r, cons
         len = truncsize;
     }
     if(U_SUCCESS(*status)) {
-        static const UChar openStr[] = { 0x003A, 0x0061, 0x006C, 0x0069, 0x0061, 0x0073, 0x0020, 0x007B, 0x0020, 0x0022 }; /* ":alias { \"" */
-        static const UChar closeStr[] = { 0x0022, 0x0020, 0x007D, 0x0020 }; /* "\" } " */
+        static const char16_t openStr[] = { 0x003A, 0x0061, 0x006C, 0x0069, 0x0061, 0x0073, 0x0020, 0x007B, 0x0020, 0x0022 }; /* ":alias { \"" */
+        static const char16_t closeStr[] = { 0x0022, 0x0020, 0x007D, 0x0020 }; /* "\" } " */
         printIndent(out, indent);
         if(key != nullptr) {
             printCString(out, key, -1);
@@ -418,7 +418,7 @@ static void printOutAlias(UFILE *out,  UResourceBundle *parent, Resource r, cons
 
 static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent, const char *pname, UErrorCode *status)
 {
-    static const UChar cr[] = { 0xA };  // LF
+    static const char16_t cr[] = { 0xA };  // LF
 
 /*    int32_t noOfElements = ures_getSize(resource);*/
     int32_t i = 0;
@@ -428,8 +428,8 @@ static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent
     case URES_STRING :
         {
             int32_t len=0;
-            const UChar* thestr = ures_getString(resource, &len, status);
-            UChar *string = quotedString(thestr);
+            const char16_t* thestr = ures_getString(resource, &len, status);
+            char16_t *string = quotedString(thestr);
 
             /* TODO: String truncation */
             if(opt_truncate && len > truncsize) {
@@ -442,15 +442,15 @@ static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent
             }
             printIndent(out, indent);
             if(key != nullptr) {
-                static const UChar openStr[] = { 0x0020, 0x007B, 0x0020, 0x0022 }; /* " { \"" */
-                static const UChar closeStr[] = { 0x0022, 0x0020, 0x007D }; /* "\" }" */
+                static const char16_t openStr[] = { 0x0020, 0x007B, 0x0020, 0x0022 }; /* " { \"" */
+                static const char16_t closeStr[] = { 0x0022, 0x0020, 0x007D }; /* "\" }" */
                 printCString(out, key, (int32_t)uprv_strlen(key));
                 printString(out, openStr, UPRV_LENGTHOF(openStr));
                 printString(out, string, len);
                 printString(out, closeStr, UPRV_LENGTHOF(closeStr));
             } else {
-                static const UChar openStr[] = { 0x0022 }; /* "\"" */
-                static const UChar closeStr[] = { 0x0022, 0x002C }; /* "\"," */
+                static const char16_t openStr[] = { 0x0022 }; /* "\"" */
+                static const char16_t closeStr[] = { 0x0022, 0x002C }; /* "\"," */
 
                 printString(out, openStr, UPRV_LENGTHOF(openStr));
                 printString(out, string, (int32_t)(u_strlen(string)));
@@ -468,9 +468,9 @@ static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent
 
     case URES_INT :
         {
-            static const UChar openStr[] = { 0x003A, 0x0069, 0x006E, 0x0074, 0x0020, 0x007B, 0x0020 }; /* ":int { " */
-            static const UChar closeStr[] = { 0x0020, 0x007D }; /* " }" */
-            UChar num[20];
+            static const char16_t openStr[] = { 0x003A, 0x0069, 0x006E, 0x0074, 0x0020, 0x007B, 0x0020 }; /* ":int { " */
+            static const char16_t closeStr[] = { 0x0020, 0x007D }; /* " }" */
+            char16_t num[20];
 
             printIndent(out, indent);
             if(key != nullptr) {
@@ -500,8 +500,8 @@ static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent
                 len = truncsize;
             }
             if(U_SUCCESS(*status)) {
-                static const UChar openStr[] = { 0x003A, 0x0062, 0x0069, 0x006E, 0x0061, 0x0072, 0x0079, 0x0020, 0x007B, 0x0020 }; /* ":binary { " */
-                static const UChar closeStr[] = { 0x0020, 0x007D, 0x0020 }; /* " } " */
+                static const char16_t openStr[] = { 0x003A, 0x0062, 0x0069, 0x006E, 0x0061, 0x0072, 0x0079, 0x0020, 0x007B, 0x0020 }; /* ":binary { " */
+                static const char16_t closeStr[] = { 0x0020, 0x007D, 0x0020 }; /* " } " */
                 printIndent(out, indent);
                 if(key != nullptr) {
                     printCString(out, key, -1);
@@ -525,9 +525,9 @@ static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent
             int32_t len = 0;
             const int32_t *data = ures_getIntVector(resource, &len, status);
             if(U_SUCCESS(*status)) {
-                static const UChar openStr[] = { 0x003A, 0x0069, 0x006E, 0x0074, 0x0076, 0x0065, 0x0063, 0x0074, 0x006F, 0x0072, 0x0020, 0x007B, 0x0020 }; /* ":intvector { " */
-                static const UChar closeStr[] = { 0x0020, 0x007D, 0x0020 }; /* " } " */
-                UChar num[20];
+                static const char16_t openStr[] = { 0x003A, 0x0069, 0x006E, 0x0074, 0x0076, 0x0065, 0x0063, 0x0074, 0x006F, 0x0072, 0x0020, 0x007B, 0x0020 }; /* ":intvector { " */
+                static const char16_t closeStr[] = { 0x0020, 0x007D, 0x0020 }; /* " } " */
+                char16_t num[20];
 
                 printIndent(out, indent);
                 if(key != nullptr) {
@@ -558,8 +558,8 @@ static void printOutBundle(UFILE *out, UResourceBundle *resource, int32_t indent
     case URES_TABLE :
     case URES_ARRAY :
         {
-            static const UChar openStr[] = { 0x007B }; /* "{" */
-            static const UChar closeStr[] = { 0x007D, '\n' }; /* "}\n" */
+            static const char16_t openStr[] = { 0x007B }; /* "{" */
+            static const char16_t closeStr[] = { 0x007D, '\n' }; /* "}\n" */
 
             UResourceBundle *t = nullptr;
             ures_resetIterator(resource);
index cbc9d7f13e4a22ff14790cdfdeedb148ad9f2396..fbf396d468a833305e83216840b31e6a3764b508 100644 (file)
@@ -449,7 +449,7 @@ main(int argc,
             }
             // The PseudoListResource constructor call did not allocate further memory.
             assert(U_SUCCESS(status));
-            const UChar *p = (const UChar *)(pRoot + keysTop);
+            const char16_t *p = (const char16_t *)(pRoot + keysTop);
             int32_t remaining = stringUnitsLength;
             do {
                 int32_t first = *p;
index 4ea2f2dfce979c5b4f12cdd58f7e392282e0539a..1e82bda6e5e051e317b99fd50c6f5a74f3686d53 100644 (file)
@@ -112,7 +112,7 @@ const char *tokenNames[TOK_TOKEN_COUNT] =
 };
 
 /* Just to store "TRUE" */
-//static const UChar trueValue[] = {0x0054, 0x0052, 0x0055, 0x0045, 0x0000};
+//static const char16_t trueValue[] = {0x0054, 0x0052, 0x0055, 0x0045, 0x0000};
 
 typedef struct {
     struct Lookahead  lookahead[MAX_LOOKAHEAD + 1];
@@ -327,9 +327,9 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt
     UCHARBUF *ucbuf=nullptr;
     UChar32   c     = 0;
     const char* cp  = nullptr;
-    UChar *pTarget     = nullptr;
-    UChar *target      = nullptr;
-    UChar *targetLimit = nullptr;
+    char16_t *pTarget     = nullptr;
+    char16_t *target      = nullptr;
+    char16_t *targetLimit = nullptr;
     int32_t size = 0;
 
     expect(state, TOK_STRING, &tokenValue, nullptr, &line, status);
@@ -379,7 +379,7 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt
     * is not known in UTF-8 byte stream
     */
     size        = ucbuf_size(ucbuf) + 1;
-    pTarget     = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * size);
+    pTarget     = (char16_t*) uprv_malloc(U_SIZEOF_UCHAR * size);
     uprv_memset(pTarget, 0, size*U_SIZEOF_UCHAR);
     target      = pTarget;
     targetLimit = pTarget+size;
@@ -432,7 +432,7 @@ parseUCARules(ParseState* state, char *tag, uint32_t startline, const struct USt
             continue;
         }
 
-        /* Append UChar * after dissembling if c > 0xffff*/
+        /* Append char16_t * after dissembling if c > 0xffff*/
         if (c != (UChar32)U_EOF)
         {
             U_APPEND_CHAR32_ONLY(c, target);
@@ -469,8 +469,8 @@ parseTransliterator(ParseState* state, char *tag, uint32_t startline, const stru
     uint32_t          line;
     UCHARBUF *ucbuf=nullptr;
     const char* cp  = nullptr;
-    UChar *pTarget     = nullptr;
-    const UChar *pSource     = nullptr;
+    char16_t *pTarget     = nullptr;
+    const char16_t *pSource     = nullptr;
     int32_t size = 0;
 
     expect(state, TOK_STRING, &tokenValue, nullptr, &line, status);
@@ -517,7 +517,7 @@ parseTransliterator(ParseState* state, char *tag, uint32_t startline, const stru
     * is not known in UTF-8 byte stream
     */
     pSource = ucbuf_getBuffer(ucbuf, &size, status);
-    pTarget     = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * (size + 1));
+    pTarget     = (char16_t*) uprv_malloc(U_SIZEOF_UCHAR * (size + 1));
     uprv_memset(pTarget, 0, size*U_SIZEOF_UCHAR);
 
 #if !UCONFIG_NO_TRANSLITERATION
@@ -795,7 +795,7 @@ GenrbImporter::getRules(
 // Quick-and-dirty escaping function.
 // Assumes that we are on an ASCII-based platform.
 static void
-escape(const UChar *s, char *buffer, size_t n) {
+escape(const char16_t *s, char *buffer, size_t n) {
     int32_t length = u_strlen(s);
     int32_t i = 0;
     for (;;) {
@@ -1973,12 +1973,12 @@ parseInclude(ParseState* state, char *tag, uint32_t startline, const struct UStr
     int32_t           len=0;
     char             *filename;
     uint32_t          line;
-    UChar *pTarget     = nullptr;
+    char16_t *pTarget     = nullptr;
 
     UCHARBUF *ucbuf;
     char     *fullname = nullptr;
     const char* cp = nullptr;
-    const UChar* uBuffer = nullptr;
+    const char16_t* uBuffer = nullptr;
 
     int32_t stringLength;
     filename = getInvariantString(state, &line, nullptr, stringLength, status);
@@ -2094,7 +2094,7 @@ typedef enum EResourceType
 
 static struct {
     const char *nameChars;   /* only used for debugging */
-    const UChar *nameUChars;
+    const char16_t *nameUChars;
     ParseResourceFunction *parseFunction;
 } gResourceTypes[] = {
     {"Unknown", nullptr, nullptr},
index b963493dbed8c04274ad163b14e874d6a93ba602..ea55352b41fdefaa01f9dfbe2a98aac3a1ef24f3 100644 (file)
@@ -44,7 +44,7 @@ const char *patternStrings[UPC_LIMIT]={
 };
 
 U_CFUNC int32_t 
-removeText(UChar *source, int32_t srcLen, 
+removeText(char16_t *source, int32_t srcLen,
            UnicodeString patString,uint32_t options,  
            UnicodeString replaceText, UErrorCode *status){
 
@@ -68,7 +68,7 @@ removeText(UChar *source, int32_t srcLen,
 
 }
 U_CFUNC int32_t
-trim(UChar *src, int32_t srcLen, UErrorCode *status){
+trim(char16_t *src, int32_t srcLen, UErrorCode *status){
      srcLen = removeText(src, srcLen, UnicodeString("^[ \\r\\n]+ "), 0, UnicodeString(), status); // remove leading new lines
      srcLen = removeText(src, srcLen, UnicodeString("^\\s+"), 0, UnicodeString(), status); // remove leading spaces
      srcLen = removeText(src, srcLen, UnicodeString("\\s+$"), 0, UnicodeString(), status); // remove trailing spcaes
@@ -76,7 +76,7 @@ trim(UChar *src, int32_t srcLen, UErrorCode *status){
 }
 
 U_CFUNC int32_t 
-removeCmtText(UChar* source, int32_t srcLen, UErrorCode* status){
+removeCmtText(char16_t* source, int32_t srcLen, UErrorCode* status){
     srcLen = trim(source, srcLen, status);
     UnicodeString patString("^\\s*?\\*\\s*?");  // remove pattern like " * " at the beginning of the line
     srcLen = removeText(source, srcLen, patString, UREGEX_MULTILINE, UnicodeString(), status);
@@ -84,8 +84,8 @@ removeCmtText(UChar* source, int32_t srcLen, UErrorCode* status){
 }
 
 U_CFUNC int32_t 
-getText(const UChar* source, int32_t srcLen,
-        UChar** dest, int32_t destCapacity,
+getText(const char16_t* source, int32_t srcLen,
+        char16_t** dest, int32_t destCapacity,
         UnicodeString patternString, 
         UErrorCode* status){
     
@@ -121,8 +121,8 @@ getText(const UChar* source, int32_t srcLen,
 #define AT_SIGN  0x0040
 
 U_CFUNC int32_t
-getDescription( const UChar* source, int32_t srcLen,
-                UChar** dest, int32_t destCapacity,
+getDescription( const char16_t* source, int32_t srcLen,
+                char16_t** dest, int32_t destCapacity,
                 UErrorCode* status){
     if(status == nullptr || U_FAILURE(*status)){
         return 0;
@@ -137,7 +137,7 @@ getDescription( const UChar* source, int32_t srcLen,
     }
     pattern->split(src, stringArray,MAX_SPLIT_STRINGS , *status);
 
-    if(stringArray[0].indexOf((UChar)AT_SIGN)==-1){
+    if(stringArray[0].indexOf((char16_t)AT_SIGN)==-1){
         int32_t destLen =  stringArray[0].extract(*dest, destCapacity, *status);
         return trim(*dest, destLen, status);
     }
@@ -145,7 +145,7 @@ getDescription( const UChar* source, int32_t srcLen,
 }
 
 U_CFUNC int32_t
-getCount(const UChar* source, int32_t srcLen, 
+getCount(const char16_t* source, int32_t srcLen,
          UParseCommentsOption option, UErrorCode *status){
     
     if(status == nullptr || U_FAILURE(*status)){
@@ -182,8 +182,8 @@ getCount(const UChar* source, int32_t srcLen,
 }
 
 U_CFUNC int32_t 
-getAt(const UChar* source, int32_t srcLen,
-        UChar** dest, int32_t destCapacity,
+getAt(const char16_t* source, int32_t srcLen,
+        char16_t** dest, int32_t destCapacity,
         int32_t index,
         UParseCommentsOption option,
         UErrorCode* status){
@@ -224,8 +224,8 @@ getAt(const UChar* source, int32_t srcLen,
 }
 
 U_CFUNC int32_t
-getTranslate( const UChar* source, int32_t srcLen,
-              UChar** dest, int32_t destCapacity,
+getTranslate( const char16_t* source, int32_t srcLen,
+              char16_t** dest, int32_t destCapacity,
               UErrorCode* status){
     UnicodeString     notePatternString("^translate\\s*?(.*)");
     
@@ -234,8 +234,8 @@ getTranslate( const UChar* source, int32_t srcLen,
 }
 
 U_CFUNC int32_t 
-getNote(const UChar* source, int32_t srcLen,
-        UChar** dest, int32_t destCapacity,
+getNote(const char16_t* source, int32_t srcLen,
+        char16_t** dest, int32_t destCapacity,
         UErrorCode* status){
 
     UnicodeString     notePatternString("^note\\s*?(.*)");
index 366a126041edb1e8b0287f1442241334145c618d..7185bb9a1931beee7beb431507a6e9b855382758 100644 (file)
@@ -99,7 +99,7 @@ static UDataInfo dataInfo= {
 
     U_IS_BIG_ENDIAN,
     U_CHARSET_FAMILY,
-    sizeof(UChar),
+    sizeof(char16_t),
     0,
 
     {0x52, 0x65, 0x73, 0x42},     /* dataFormat="ResB" */
@@ -269,7 +269,7 @@ void PseudoListResource::add(SResource *res) {
 }
 
 StringBaseResource::StringBaseResource(SRBRoot *bundle, const char *tag, int8_t type,
-                                       const UChar *value, int32_t len,
+                                       const char16_t *value, int32_t len,
                                        const UString* comment, UErrorCode &errorCode)
         : SResource(bundle, tag, type, comment, errorCode) {
     if (len == 0 && gFormatVersion > 1) {
@@ -301,7 +301,7 @@ StringBaseResource::StringBaseResource(SRBRoot *bundle, int8_t type,
 }
 
 // Pool bundle string, alias the buffer. Guaranteed NUL-terminated and not empty.
-StringBaseResource::StringBaseResource(int8_t type, const UChar *value, int32_t len,
+StringBaseResource::StringBaseResource(int8_t type, const char16_t *value, int32_t len,
                                        UErrorCode &errorCode)
         : SResource(nullptr, nullptr, type, nullptr, errorCode), fString(true, value, len) {
     assert(len > 0);
@@ -430,7 +430,7 @@ StringResource::handlePreflightStrings(SRBRoot *bundle, UHashtable *stringSet,
     if (bundle->fStringsForm != STRINGS_UTF16_V1) {
         int32_t len = length();
         if (len <= MAX_IMPLICIT_STRING_LENGTH &&
-                !U16_IS_TRAIL(fString[0]) && fString.indexOf((UChar)0) < 0) {
+                !U16_IS_TRAIL(fString[0]) && fString.indexOf((char16_t)0) < 0) {
             /*
              * This string will be stored without an explicit length.
              * Runtime will detect !U16_IS_TRAIL(s[0]) and call u_strlen().
@@ -542,7 +542,7 @@ StringResource::handleWrite16(SRBRoot * /*bundle*/) {
 void
 ContainerResource::writeAllRes16(SRBRoot *bundle) {
     for (SResource *current = fFirst; current != nullptr; current = current->fNext) {
-        bundle->f16BitUnits.append((UChar)current->fRes16);
+        bundle->f16BitUnits.append((char16_t)current->fRes16);
     }
     fWritten = true;
 }
@@ -562,7 +562,7 @@ ArrayResource::handleWrite16(SRBRoot *bundle) {
     }
     if (fCount <= 0xffff && res16 >= 0 && gFormatVersion > 1) {
         fRes = URES_MAKE_RESOURCE(URES_ARRAY16, bundle->f16BitUnits.length());
-        bundle->f16BitUnits.append((UChar)fCount);
+        bundle->f16BitUnits.append((char16_t)fCount);
         writeAllRes16(bundle);
     }
 }
@@ -589,9 +589,9 @@ TableResource::handleWrite16(SRBRoot *bundle) {
         if (res16 >= 0 && gFormatVersion > 1) {
             /* 16-bit count, key offsets and values */
             fRes = URES_MAKE_RESOURCE(URES_TABLE16, bundle->f16BitUnits.length());
-            bundle->f16BitUnits.append((UChar)fCount);
+            bundle->f16BitUnits.append((char16_t)fCount);
             for (SResource *current = fFirst; current != nullptr; current = current->fNext) {
-                bundle->f16BitUnits.append((UChar)current->fKey16);
+                bundle->f16BitUnits.append((char16_t)current->fKey16);
             }
             writeAllRes16(bundle);
         } else {
@@ -938,7 +938,7 @@ void SRBRoot::write(const char *outputDir, const char *outputPkg,
         return;
     }
     if (f16BitUnits.length() & 1) {
-        f16BitUnits.append((UChar)0xaaaa);  /* pad to multiple of 4 bytes */
+        f16BitUnits.append((char16_t)0xaaaa);  /* pad to multiple of 4 bytes */
     }
 
     byteOffset = fKeysTop + f16BitUnits.length() * 2;
@@ -1103,13 +1103,13 @@ ArrayResource* array_open(struct SRBRoot *bundle, const char *tag, const struct
     return U_SUCCESS(*status) ? res.orphan() : nullptr;
 }
 
-struct SResource *string_open(struct SRBRoot *bundle, const char *tag, const UChar *value, int32_t len, const struct UString* comment, UErrorCode *status) {
+struct SResource *string_open(struct SRBRoot *bundle, const char *tag, const char16_t *value, int32_t len, const struct UString* comment, UErrorCode *status) {
     LocalPointer<SResource> res(
             new StringResource(bundle, tag, value, len, comment, *status), *status);
     return U_SUCCESS(*status) ? res.orphan() : nullptr;
 }
 
-struct SResource *alias_open(struct SRBRoot *bundle, const char *tag, UChar *value, int32_t len, const struct UString* comment, UErrorCode *status) {
+struct SResource *alias_open(struct SRBRoot *bundle, const char *tag, char16_t *value, int32_t len, const struct UString* comment, UErrorCode *status) {
     LocalPointer<SResource> res(
             new AliasResource(bundle, tag, value, len, comment, *status), *status);
     return U_SUCCESS(*status) ? res.orphan() : nullptr;
@@ -1149,7 +1149,7 @@ SRBRoot::SRBRoot(const UString *comment, UBool isPoolBundle, UErrorCode &errorCo
     if (gFormatVersion > 1) {
         // f16BitUnits must start with a zero for empty resources.
         // We might be able to omit it if there are no empty 16-bit resources.
-        f16BitUnits.append((UChar)0);
+        f16BitUnits.append((char16_t)0);
     }
 
     fKeys = (char *) uprv_malloc(sizeof(char) * KEY_SPACE_SIZE);
@@ -1200,7 +1200,7 @@ SRBRoot::~SRBRoot() {
 
 /* Misc Functions */
 
-void SRBRoot::setLocale(UChar *locale, UErrorCode &errorCode) {
+void SRBRoot::setLocale(char16_t *locale, UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) {
         return;
     }
@@ -1506,10 +1506,10 @@ static int32_t U_CALLCONV
 compareStringSuffixes(const void * /*context*/, const void *l, const void *r) {
     const StringResource *left = *((const StringResource **)l);
     const StringResource *right = *((const StringResource **)r);
-    const UChar *lStart = left->getBuffer();
-    const UChar *lLimit = lStart + left->length();
-    const UChar *rStart = right->getBuffer();
-    const UChar *rLimit = rStart + right->length();
+    const char16_t *lStart = left->getBuffer();
+    const char16_t *lLimit = lStart + left->length();
+    const char16_t *rStart = right->getBuffer();
+    const char16_t *rLimit = rStart + right->length();
     int32_t diff;
     /* compare keys in reverse character order */
     while (lStart < lLimit && rStart < rLimit) {
@@ -1555,22 +1555,22 @@ StringResource::writeUTF16v2(int32_t base, UnicodeString &dest) {
     case 0:
         break;
     case 1:
-        dest.append((UChar)(0xdc00 + len));
+        dest.append((char16_t)(0xdc00 + len));
         break;
     case 2:
-        dest.append((UChar)(0xdfef + (len >> 16)));
-        dest.append((UChar)len);
+        dest.append((char16_t)(0xdfef + (len >> 16)));
+        dest.append((char16_t)len);
         break;
     case 3:
-        dest.append((UChar)0xdfff);
-        dest.append((UChar)(len >> 16));
-        dest.append((UChar)len);
+        dest.append((char16_t)0xdfff);
+        dest.append((char16_t)(len >> 16));
+        dest.append((char16_t)len);
         break;
     default:
         break;  /* will not occur */
     }
     dest.append(fString);
-    dest.append((UChar)0);
+    dest.append((char16_t)0);
 }
 
 void
index a7d1f5d3cbb6a6cbe215996b7bc238a2cb2aed77..23106c3b44f206a2f009caea3ea70a12862115ab 100644 (file)
@@ -78,7 +78,7 @@ struct SRBRoot {
     void write(const char *outputDir, const char *outputPkg,
                char *writtenFilename, int writtenFilenameLen, UErrorCode &errorCode);
 
-    void setLocale(UChar *locale, UErrorCode &errorCode);
+    void setLocale(char16_t *locale, UErrorCode &errorCode);
     int32_t addTag(const char *tag, UErrorCode &errorCode);
 
     const char *getKeyString(int32_t key) const;
@@ -149,9 +149,9 @@ TableResource *table_open(struct SRBRoot *bundle, const char *tag, const struct
 
 ArrayResource *array_open(struct SRBRoot *bundle, const char *tag, const struct UString* comment, UErrorCode *status);
 
-struct SResource *string_open(struct SRBRoot *bundle, const char *tag, const UChar *value, int32_t len, const struct UString* comment, UErrorCode *status);
+struct SResource *string_open(struct SRBRoot *bundle, const char *tag, const char16_t *value, int32_t len, const struct UString* comment, UErrorCode *status);
 
-struct SResource *alias_open(struct SRBRoot *bundle, const char *tag, UChar *value, int32_t len, const struct UString* comment, UErrorCode *status);
+struct SResource *alias_open(struct SRBRoot *bundle, const char *tag, char16_t *value, int32_t len, const struct UString* comment, UErrorCode *status);
 
 IntVectorResource *intvector_open(struct SRBRoot *bundle, const char *tag,  const struct UString* comment, UErrorCode *status);
 
@@ -319,14 +319,14 @@ public:
 class StringBaseResource : public SResource {
 public:
     StringBaseResource(SRBRoot *bundle, const char *tag, int8_t type,
-                       const UChar *value, int32_t len,
+                       const char16_t *value, int32_t len,
                        const UString* comment, UErrorCode &errorCode);
     StringBaseResource(SRBRoot *bundle, int8_t type,
                        const icu::UnicodeString &value, UErrorCode &errorCode);
-    StringBaseResource(int8_t type, const UChar *value, int32_t len, UErrorCode &errorCode);
+    StringBaseResource(int8_t type, const char16_t *value, int32_t len, UErrorCode &errorCode);
     virtual ~StringBaseResource();
 
-    const UChar *getBuffer() const { return icu::toUCharPtr(fString.getBuffer()); }
+    const char16_t *getBuffer() const { return icu::toUCharPtr(fString.getBuffer()); }
     int32_t length() const { return fString.length(); }
 
     virtual void handlePreWrite(uint32_t *byteOffset) override;
@@ -338,7 +338,7 @@ public:
 
 class StringResource : public StringBaseResource {
 public:
-    StringResource(SRBRoot *bundle, const char *tag, const UChar *value, int32_t len,
+    StringResource(SRBRoot *bundle, const char *tag, const char16_t *value, int32_t len,
                    const UString* comment, UErrorCode &errorCode)
             : StringBaseResource(bundle, tag, URES_STRING, value, len, comment, errorCode),
               fSame(nullptr), fSuffixOffset(0),
@@ -348,7 +348,7 @@ public:
               fSame(nullptr), fSuffixOffset(0),
               fNumCopies(0), fNumUnitsSaved(0), fNumCharsForLength(0) {}
     StringResource(int32_t poolStringIndex, int8_t numCharsForLength,
-                   const UChar *value, int32_t length,
+                   const char16_t *value, int32_t length,
                    UErrorCode &errorCode)
             : StringBaseResource(URES_STRING, value, length, errorCode),
               fSame(nullptr), fSuffixOffset(0),
@@ -377,7 +377,7 @@ public:
 
 class AliasResource : public StringBaseResource {
 public:
-    AliasResource(SRBRoot *bundle, const char *tag, const UChar *value, int32_t len,
+    AliasResource(SRBRoot *bundle, const char *tag, const char16_t *value, int32_t len,
                   const UString* comment, UErrorCode &errorCode)
             : StringBaseResource(bundle, tag, URES_ALIAS, value, len, comment, errorCode) {}
     virtual ~AliasResource();
index d471a01931aca93bb600e7f45bb8530da67d2785..cb04b5a44ab94909f8e639befbd01d54eeeb855c 100644 (file)
@@ -104,7 +104,7 @@ static const char* enc ="";
 static UConverter* conv = nullptr;
 
 static int32_t
-uCharsToChars(char *target, int32_t targetLen, const UChar *source, int32_t sourceLen, UErrorCode *status) {
+uCharsToChars(char *target, int32_t targetLen, const char16_t *source, int32_t sourceLen, UErrorCode *status) {
     int i=0, j=0;
     char str[30]={'\0'};
     while(i<sourceLen){
@@ -229,7 +229,7 @@ static int32_t getColumnCount(int32_t len){
     return columnCount;
 }
 static void
-str_write_java(const UChar *src, int32_t srcLen, UBool printEndLine, UErrorCode *status) {
+str_write_java(const char16_t *src, int32_t srcLen, UBool printEndLine, UErrorCode *status) {
 
     uint32_t length = srcLen*8;
     uint32_t bufLen = 0;
index 2eebddd992c552159c8dd1022fd4d99bf7ad086a..16f67fabcaf301c18a47d6941a28c87a701982cb 100644 (file)
@@ -233,7 +233,7 @@ static const char* bundleEnd   = "</xliff>\n";
 void res_write_xml(struct SResource *res, const char* id, const char* language, UBool isTopLevel, UErrorCode *status);
 
 static char* convertAndEscape(char** pDest, int32_t destCap, int32_t* destLength,
-                              const UChar* src, int32_t srcLen, UErrorCode* status){
+                              const char16_t* src, int32_t srcLen, UErrorCode* status){
     int32_t srcIndex=0;
     char* dest=nullptr;
     char* temp=nullptr;
@@ -397,7 +397,7 @@ trim(char **src, int32_t *len){
 }
 
 static void
-print(UChar* src, int32_t srcLen,const char *tagStart,const char *tagEnd,  UErrorCode *status){
+print(char16_t* src, int32_t srcLen,const char *tagStart,const char *tagEnd,  UErrorCode *status){
     int32_t bufCapacity   = srcLen*4;
     char *buf       = nullptr;
     int32_t bufLen = 0;
@@ -429,7 +429,7 @@ printNoteElements(const UString *src, UErrorCode *status){
 #if UCONFIG_NO_REGULAR_EXPRESSIONS==0 /* donot compile when no RegularExpressions are available */
 
     int32_t capacity = 0;
-    UChar* note = nullptr;
+    char16_t* note = nullptr;
     int32_t noteLen = 0;
     int32_t count = 0,i;
 
@@ -438,7 +438,7 @@ printNoteElements(const UString *src, UErrorCode *status){
     }
 
     capacity = src->fLength;
-    note  = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
+    note  = (char16_t*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
 
     count = getCount(src->fChars,src->fLength, UPC_NOTE, status);
     if(U_FAILURE(*status)){
@@ -497,8 +497,8 @@ printComments(struct UString *src, const char *resName, UBool printTranslate, UE
     int32_t capacity = src->fLength + 1;
     char* buf = nullptr;
     int32_t bufLen = 0;
-    UChar* desc  = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
-    UChar* trans = (UChar*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
+    char16_t* desc  = (char16_t*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
+    char16_t* trans = (char16_t*) uprv_malloc(U_SIZEOF_UCHAR * capacity);
 
     int32_t descLen = 0, transLen=0;
     if(desc==nullptr || trans==nullptr){
index 59c1eb66705d1e6f46fa7f102cce05e6fa605ce4..b14b4316f3bcdbaf56121540b704a03a413e2ab2 100644 (file)
@@ -100,7 +100,7 @@ static UDataInfo dataInfo={
 
     U_IS_BIG_ENDIAN,
     U_CHARSET_FAMILY,
-    sizeof(UChar),
+    sizeof(char16_t),
     0,
 
     {0x63, 0x6e, 0x76, 0x74},     /* dataFormat="cnvt" */
index 0a2833ed566ab610d0faa36c529a278ba32a7b19..4f3a9808eb57451b4368b1cfb7dae2b70eeff50c 100644 (file)
@@ -117,7 +117,7 @@ U_CAPI int32_t
 udbg_stoi(const UnicodeString &s)
 {
     char ch[256];
-    const UChar *u = toUCharPtr(s.getBuffer());
+    const char16_t *u = toUCharPtr(s.getBuffer());
     int32_t len = s.length();
     u_UCharsToChars(u, ch, len);
     ch[len] = 0; /* include terminating \0 */
@@ -129,7 +129,7 @@ U_CAPI double
 udbg_stod(const UnicodeString &s)
 {
     char ch[256];
-    const UChar *u = toUCharPtr(s.getBuffer());
+    const char16_t *u = toUCharPtr(s.getBuffer());
     int32_t len = s.length();
     u_UCharsToChars(u, ch, len);
     ch[len] = 0; /* include terminating \0 */
@@ -141,7 +141,7 @@ udbg_escape(const UnicodeString &src, UnicodeString *dst)
 {
     dst->remove();
     for (int32_t i = 0; i < src.length(); ++i) {
-        UChar c = src[i];
+        char16_t c = src[i];
         if(ICU_Utility::isUnprintable(c)) {
             *dst += UnicodeString("[");
             ICU_Utility::escapeUnprintable(*dst, c);
index 58aaeea81cd6b0310ce73059808d877e8f1c9ffa..3098f5d57d45233fed7b94aaacc9a4b3342327d1 100644 (file)
@@ -51,7 +51,7 @@ static const UDataInfo dataInfo={
 
     U_IS_BIG_ENDIAN,
     U_CHARSET_FAMILY,
-    (uint8_t)sizeof(UChar),
+    (uint8_t)sizeof(char16_t),
     0,
 
     {0x43, 0x6d, 0x6e, 0x44},     /* dataFormat="CmnD" */
index 64b58dc7b13c78d2a51a2ea91e56d395f6f75285..a301c322ebec09fbe7dbcacce60c6c85a4e366a3 100644 (file)
@@ -68,7 +68,7 @@ static const UDataInfo dataInfo={
 
     U_IS_BIG_ENDIAN,
     U_CHARSET_FAMILY,
-    sizeof(UChar),
+    sizeof(char16_t),
     0,
 
     {0x43, 0x6d, 0x6e, 0x44},     /* dataFormat="CmnD" */
index 06f24c4617a3474769eea772ca13bdba28c916b9..e49775d56da5dfd3196664aa03871026d3afd5a3 100644 (file)
@@ -214,14 +214,14 @@ checkParent(const char *itemName, CheckDependency check, void *context,
 
 // get dependencies from resource bundles ---------------------------------- ***
 
-static const UChar SLASH=0x2f;
+static const char16_t SLASH=0x2f;
 
 /*
  * Check for the alias from the string or alias resource res.
  */
 static void
 checkAlias(const char *itemName,
-           Resource res, const UChar *alias, int32_t length, UBool useResSuffix,
+           Resource res, const char16_t *alias, int32_t length, UBool useResSuffix,
            CheckDependency check, void *context, UErrorCode *pErrorCode) {
     int32_t i;
 
@@ -297,7 +297,7 @@ ures_enumDependencies(const char *itemName,
             doCheckParent = false;
             // No tracing: build tool
             int32_t length;
-            const UChar *alias=res_getStringNoTrace(pResData, res, &length);
+            const char16_t *alias=res_getStringNoTrace(pResData, res, &length);
             checkAlias(itemName, res, alias, length, /*useResSuffix=*/ true,
                        check, context, pErrorCode);
             // If there is a %%ALIAS, then there should be nothing else in this resource bundle.
@@ -306,7 +306,7 @@ ures_enumDependencies(const char *itemName,
             // Explicit declaration of a dependency of this item on that one.
             // No tracing: build tool
             int32_t length;
-            const UChar *alias=res_getStringNoTrace(pResData, res, &length);
+            const char16_t *alias=res_getStringNoTrace(pResData, res, &length);
             checkAlias(itemName, res, alias, length, /*useResSuffix=*/ false,
                        check, context, pErrorCode);
         }
@@ -315,7 +315,7 @@ ures_enumDependencies(const char *itemName,
     case URES_ALIAS:
         {
             int32_t length;
-            const UChar *alias=res_getAlias(pResData, res, &length);
+            const char16_t *alias=res_getAlias(pResData, res, &length);
             checkAlias(itemName, res, alias, length, true, check, context, pErrorCode);
         }
         break;
index d10568fedb414270d58d50f5800217b3cb5b6620..0d59b28ce48a7b7856471db112be3312ac8594b6 100644 (file)
@@ -561,7 +561,7 @@ PreparsedUCD::parseCodePointRange(const char *s, UChar32 &start, UChar32 &end, U
 
 void
 PreparsedUCD::parseString(const char *s, UnicodeString &uni, UErrorCode &errorCode) {
-    UChar *buffer=toUCharPtr(uni.getBuffer(-1));
+    char16_t *buffer=toUCharPtr(uni.getBuffer(-1));
     int32_t length=u_parseString(s, buffer, uni.getCapacity(), nullptr, &errorCode);
     if(errorCode==U_BUFFER_OVERFLOW_ERROR) {
         errorCode=U_ZERO_ERROR;
index fd6f830f372d2278dc1c216faf1146b599b25f95..9c585639657cca95bba84c831bd5025db9c95258 100644 (file)
@@ -264,7 +264,7 @@ uprops_swap(const UDataSwapper *ds,
 
         /*
          * swap the UChars
-         * U  const UChar uchars[2*(i3-i2)];
+         * U  const char16_t uchars[2*(i3-i2)];
          */
         ds->swapArray16(ds,
             inData32+dataIndexes[UPROPS_EXCEPTIONS_TOP_INDEX],
@@ -997,7 +997,7 @@ udata_swap(const UDataSwapper *ds,
 
     {
         /* convert the data format from ASCII to Unicode to the system charset */
-        UChar u[4]={
+        char16_t u[4]={
              pInfo->dataFormat[0], pInfo->dataFormat[1],
              pInfo->dataFormat[2], pInfo->dataFormat[3]
         };
index 9d33481d91aaf5733c57c1a96d9a570ec5d2f24c..1eb54e260e6b3c0bfb8a4145979312a1b1706a24 100644 (file)
@@ -39,9 +39,9 @@
 #define CONTEXT_LEN 20
 
 struct UCHARBUF {
-    UChar* buffer;
-    UChar* currentPos;
-    UChar* bufLimit;
+    char16_t* buffer;
+    char16_t* currentPos;
+    char16_t* bufLimit;
     int32_t bufCapacity;
     int32_t remaining;
     int32_t signatureLength;
@@ -56,8 +56,8 @@ ucbuf_autodetect_fs(FileStream* in, const char** cp, UConverter** conv, int32_t*
     char start[8];
     int32_t numRead;
 
-    UChar target[1]={ 0 };
-    UChar* pTarget;
+    char16_t target[1]={ 0 };
+    char16_t* pTarget;
     const char* pStart;
 
     /* read a few bytes */
@@ -161,8 +161,8 @@ ucbuf_autodetect(const char* fileName, const char** cp,UConverter** conv, int32_
 /* fill the uchar buffer */
 static UCHARBUF*
 ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){
-    UChar* pTarget=nullptr;
-    UChar* target=nullptr;
+    char16_t* pTarget=nullptr;
+    char16_t* target=nullptr;
     const char* source=nullptr;
     char  carr[MAX_IN_BUF] = {'\0'};
     char* cbuf =  carr;
@@ -175,11 +175,11 @@ ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){
     /* check if we arrived here without exhausting the buffer*/
     if(buf->currentPos<buf->bufLimit){
         offset = (int32_t)(buf->bufLimit-buf->currentPos);
-        memmove(buf->buffer,buf->currentPos,offset* sizeof(UChar));
+        memmove(buf->buffer,buf->currentPos,offset* sizeof(char16_t));
     }
 
 #ifdef UCBUF_DEBUG
-    memset(pTarget+offset,0xff,sizeof(UChar)*(MAX_IN_BUF-offset));
+    memset(pTarget+offset,0xff,sizeof(char16_t)*(MAX_IN_BUF-offset));
 #endif
     if(buf->isBuffered){
         cbufSize = MAX_IN_BUF;
@@ -320,7 +320,7 @@ ucbuf_fillucbuf( UCHARBUF* buf,UErrorCode* error){
 
 
 
-/* get a UChar from the stream*/
+/* get a char16_t from the stream*/
 U_CAPI int32_t U_EXPORT2
 ucbuf_getc(UCHARBUF* buf,UErrorCode* error){
     if(error==nullptr || U_FAILURE(*error)){
@@ -364,8 +364,8 @@ ucbuf_getc32(UCHARBUF* buf,UErrorCode* error){
     return retVal;
 }
 
-/* u_unescapeAt() callback to return a UChar*/
-static UChar U_CALLCONV
+/* u_unescapeAt() callback to return a char16_t*/
+static char16_t U_CALLCONV
 _charAt(int32_t offset, void *context) {
     return ((UCHARBUF*) context)->currentPos[offset];
 }
@@ -504,7 +504,7 @@ ucbuf_open(const char* fileName,const char** cp,UBool showWarning, UBool buffere
         }else{
             buf->bufCapacity=buf->remaining+buf->signatureLength+1/*for terminating nul*/;               
         }
-        buf->buffer=(UChar*) uprv_malloc(U_SIZEOF_UCHAR * buf->bufCapacity );
+        buf->buffer=(char16_t*) uprv_malloc(U_SIZEOF_UCHAR * buf->bufCapacity );
         if (buf->buffer == nullptr) {
             *error = U_MEMORY_ALLOCATION_ERROR;
             ucbuf_close(buf);
@@ -551,7 +551,7 @@ ucbuf_ungetc(int32_t c,UCHARBUF* buf){
     }
 }
 
-/* frees the resources of UChar* buffer */
+/* frees the resources of char16_t* buffer */
 static void
 ucbuf_closebuf(UCHARBUF* buf){
     uprv_free(buf->buffer);
@@ -585,8 +585,8 @@ ucbuf_rewind(UCHARBUF* buf,UErrorCode* error){
 
         ucnv_resetToUnicode(buf->conv);
         if(buf->signatureLength>0) {
-            UChar target[1]={ 0 };
-            UChar* pTarget;
+            char16_t target[1]={ 0 };
+            char16_t* pTarget;
             char start[8];
             const char* pStart;
             int32_t numRead;
@@ -623,7 +623,7 @@ ucbuf_size(UCHARBUF* buf){
     return 0;
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 ucbuf_getBuffer(UCHARBUF* buf,int32_t* len,UErrorCode* error){
     if(error==nullptr || U_FAILURE(*error)){
         return nullptr;
@@ -698,7 +698,7 @@ ucbuf_resolveFileName(const char* inputDir, const char* fileName, char* target,
  * to CR+LF combination which needs to be 
  * handled separately
  */
-static UBool ucbuf_isCharNewLine(UChar c){
+static UBool ucbuf_isCharNewLine(char16_t c){
     switch(c){
     case 0x000A: /* LF  */
     case 0x000D: /* CR  */
@@ -712,11 +712,11 @@ static UBool ucbuf_isCharNewLine(UChar c){
     }
 }
 
-U_CAPI const UChar* U_EXPORT2
+U_CAPI const char16_t* U_EXPORT2
 ucbuf_readline(UCHARBUF* buf,int32_t* len,UErrorCode* err){
-    UChar* temp = buf->currentPos;
-    UChar* savePos =nullptr;
-    UChar c=0x0000;
+    char16_t* temp = buf->currentPos;
+    char16_t* savePos =nullptr;
+    char16_t c=0x0000;
     if(buf->isBuffered){
         /* The input is buffered we have to do more
         * for returning a pointer U_TRUNCATED_CHAR_FOUND
index 17a0be604ff7f2954dcf2d4eeee7683adfce953e..989e7a4a9747d1a734fe1611acb6d17843f46a25 100644 (file)
@@ -475,7 +475,7 @@ paramCldrVersion(const USystemParams * /* param */, char *target, int32_t target
 U_CAPI  int32_t
 paramTimezoneDefault(const USystemParams * /* param */, char *target, int32_t targetCapacity, UErrorCode *status) {
   if(U_FAILURE(*status))return 0;
-  UChar buf[100];
+  char16_t buf[100];
   char buf2[100];
   int32_t len;
 
@@ -614,7 +614,7 @@ class KnownIssues {
 public:
   KnownIssues();
   ~KnownIssues();
-  void add(const char *ticket, const char *where, const UChar *msg, UBool *firstForTicket, UBool *firstForWhere);
+  void add(const char *ticket, const char *where, const char16_t *msg, UBool *firstForTicket, UBool *firstForWhere);
   void add(const char *ticket, const char *where, const char *msg, UBool *firstForTicket, UBool *firstForWhere);
   UBool print();
 private:
@@ -649,7 +649,7 @@ static std::string mapTicketId(const char *ticketStr) {
   return ticket;
 }
 
-void KnownIssues::add(const char *ticketStr, const char *where, const UChar *msg, UBool *firstForTicket, UBool *firstForWhere)
+void KnownIssues::add(const char *ticketStr, const char *where, const char16_t *msg, UBool *firstForTicket, UBool *firstForWhere)
 {
   const std::string ticket = mapTicketId(ticketStr);
   if(fTable.find(ticket) == fTable.end()) {
@@ -729,7 +729,7 @@ UBool KnownIssues::print()
   return true;
 }
 
-U_CAPI void *udbg_knownIssue_openU(void *ptr, const char *ticket, char *where, const UChar *msg, UBool *firstForTicket,
+U_CAPI void *udbg_knownIssue_openU(void *ptr, const char *ticket, char *where, const char16_t *msg, UBool *firstForTicket,
                                    UBool *firstForWhere) {
   KnownIssues *t = static_cast<KnownIssues*>(ptr);
   if(t==nullptr) {
index 03d729fe8580b636fda3a90e81855a03af7a0bf7..27414d2eba2803d5941195919d48b52942e3285e 100644 (file)
@@ -264,13 +264,13 @@ udata_writeString(UNewDataMemory *pData, const char *s, int32_t length) {
 }
 
 U_CAPI void U_EXPORT2
-udata_writeUString(UNewDataMemory *pData, const UChar *s, int32_t length) {
+udata_writeUString(UNewDataMemory *pData, const char16_t *s, int32_t length) {
     if(pData!=nullptr && pData->file!=nullptr) {
         if(length==-1) {
             length=u_strlen(s);
         }
         if(length>0) {
-            T_FileStream_write(pData->file, s, length*sizeof(UChar));
+            T_FileStream_write(pData->file, s, length*sizeof(char16_t));
         }
     }
 }
index 76bd2629f9a13e83747e05e9749d7028f80eab95..5aee48b5a4580c4053893af7856c8fcb70d8f361 100644 (file)
@@ -235,7 +235,7 @@ u_parseCodePoints(const char *s,
  */
 U_CAPI int32_t U_EXPORT2
 u_parseString(const char *s,
-              UChar *dest, int32_t destCapacity,
+              char16_t *dest, int32_t destCapacity,
               uint32_t *pFirst,
               UErrorCode *pErrorCode) {
     char *end;
index 9355957590c0849e1cac349e9cec6650a4312e78..55c2f277b33ca65f23d3cbc29256ffaab1430ac6 100644 (file)
@@ -489,7 +489,7 @@ usrc_writeArrayOfMostlyInvChars(FILE *f,
 
 U_CAPI void U_EXPORT2
 usrc_writeStringAsASCII(FILE *f,
-        const UChar* ptr, int32_t length,
+        const char16_t* ptr, int32_t length,
         UTargetSyntax) {
     // For now, assume all UTargetSyntax values are valid here.
     fprintf(f, "\"");
index c61c89643f2cb7634e593309b8989b83645c5fa2..edb85bdab0e9375971eafbb1fd1ccb1f7438455b 100644 (file)
@@ -146,7 +146,7 @@ UXMLParser::UXMLParser(UErrorCode &status) :
 
       fNames(status),
       fElementStack(status),
-      fOneLF((UChar)0x0a)        // Plain new-line string, used in new line normalization.
+      fOneLF((char16_t)0x0a)        // Plain new-line string, used in new line normalization.
       {
       }
 
@@ -168,7 +168,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
     const char *charset, *pb;
     UnicodeString src;
     UConverter *cnv;
-    UChar *buffer, *pu;
+    char16_t *buffer, *pu;
     int32_t fileLength, bytesLength, length, capacity;
     UBool flush;
 
@@ -235,7 +235,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
         if(mXMLDecl.reset(src).lookingAt(0, errorCode)) {
             int32_t declEnd=mXMLDecl.end(errorCode);
             // go beyond <?xml
-            int32_t pos=src.indexOf((UChar)x_l)+1;
+            int32_t pos=src.indexOf((char16_t)x_l)+1;
 
             mAttrValue.reset(src);
             while(pos<declEnd && mAttrValue.lookingAt(pos, errorCode)) {  // loop runs once per attribute on this element.
@@ -514,7 +514,7 @@ UXMLParser::createElement(RegexMatcher  &mEl, UErrorCode &status) {
 
         // Next change all xml white space chars to plain \u0020 spaces.
         mAttrNormalizer.reset(attValue);
-        UnicodeString oneSpace((UChar)0x0020);
+        UnicodeString oneSpace((char16_t)0x0020);
         attValue = mAttrNormalizer.replaceAll(oneSpace, status);
 
         // Replace character entities.
@@ -595,15 +595,15 @@ UXMLParser::replaceCharRefs(UnicodeString &s, UErrorCode &status) {
     //      which is flagged by start() of that group not being -1.
     while (mAmps.find()) {
         if (mAmps.start(1, status) != -1) {
-            replacement.setTo((UChar)x_AMP);
+            replacement.setTo((char16_t)x_AMP);
         } else if (mAmps.start(2, status) != -1) {
-            replacement.setTo((UChar)x_LT);
+            replacement.setTo((char16_t)x_LT);
         } else if (mAmps.start(3, status) != -1) {
-            replacement.setTo((UChar)x_GT);
+            replacement.setTo((char16_t)x_GT);
         } else if (mAmps.start(4, status) != -1) {
-            replacement.setTo((UChar)x_APOS);
+            replacement.setTo((char16_t)x_APOS);
         } else if (mAmps.start(5, status) != -1) {
-            replacement.setTo((UChar)x_QUOT);
+            replacement.setTo((char16_t)x_QUOT);
         } else if (mAmps.start(6, status) != -1) {
             UnicodeString hexString = mAmps.group(6, status);
             UChar32 val = 0;
@@ -639,7 +639,7 @@ UXMLParser::error(const char *message, UErrorCode &status) {
     int  line = 0;
     int  ci = 0;
     while (ci < fPos && ci>=0) {
-        ci = src.indexOf((UChar)0x0a, ci+1);
+        ci = src.indexOf((char16_t)0x0a, ci+1);
         line++;
     }
     fprintf(stderr, "Error: %s at line %d\n", message, line);
index 2d55efd623f5448c7448fb58e89e4e5758cc871d..48b8fc3ba6d6f4bae90b75bd33180d113e101a8f 100644 (file)
@@ -49,7 +49,7 @@
 //  Stubs for Windows API functions when building on UNIXes.
 //
 typedef int DWORD;
-inline int CompareStringW(DWORD, DWORD, UChar *, int, UChar *, int) {return 0;};
+inline int CompareStringW(DWORD, DWORD, char16_t *, int, char16_t *, int) {return 0;};
 #include <sys/time.h>
 unsigned long timeGetTime() {
     struct timeval t;
@@ -58,7 +58,7 @@ unsigned long timeGetTime() {
     val += t.tv_usec / 1000;
     return val;
 };
-inline int LCMapStringW(DWORD, DWORD, UChar *, int, UChar *, int) {return 0;};
+inline int LCMapStringW(DWORD, DWORD, char16_t *, int, char16_t *, int) {return 0;};
 const int LCMAP_SORTKEY = 0;
 #define MAKELCID(a,b) 0
 const int SORT_DEFAULT = 0;
@@ -84,7 +84,7 @@ Hashtable     gElements(false);
 Hashtable     gExpansions(false);
 CompareFn gComparer;
 
-const UChar separatorChar = 0x0030;
+const char16_t separatorChar = 0x0030;
 
 UFILE *out = nullptr;
 UFILE *err = nullptr;
@@ -286,10 +286,10 @@ void processArgs(int argc, char* argv[], UErrorCode &status)
 
 }
 
-void printRules(const UChar *name, int32_t len, UFILE *file) {
+void printRules(const char16_t *name, int32_t len, UFILE *file) {
   // very rudimentary pretty rules print
   int32_t i = 0;
-  UChar toPrint[16384];
+  char16_t toPrint[16384];
   int32_t toPrintIndex = 0;
   for(i = 0; i < len; i++) {
     if(name[i] == 0x0026) {
@@ -314,7 +314,7 @@ void printRules(const UChar *name, int32_t len, UFILE *file) {
 
 }
 
-void escapeString(const UChar *name, int32_t len, UFILE *file) {
+void escapeString(const char16_t *name, int32_t len, UFILE *file) {
   u_fprintf(file, "%U", name);
 /*
   int32_t j = 0;
@@ -365,7 +365,7 @@ setArray(Line **array, Hashtable *table = &gElements) {
   return size;
 }
 
-UBool trySwamped(Line **smaller, Line **greater, UChar chars[2], CompareFn comparer) {
+UBool trySwamped(Line **smaller, Line **greater, char16_t chars[2], CompareFn comparer) {
   u_strcpy(gSource->name, (*smaller)->name);
   gSource->name[(*smaller)->len] = separatorChar;
   gSource->name[(*smaller)->len+1] = chars[0];
@@ -385,7 +385,7 @@ UBool trySwamped(Line **smaller, Line **greater, UChar chars[2], CompareFn compa
   }
 }
 
-UBool trySwamps(Line **smaller, Line **greater, UChar chars[2], CompareFn comparer) {
+UBool trySwamps(Line **smaller, Line **greater, char16_t chars[2], CompareFn comparer) {
   gSource->name[0] = chars[0];
   gSource->name[1] = separatorChar;
   u_strcpy(gSource->name+2, (*smaller)->name);
@@ -407,28 +407,28 @@ UColAttributeValue
 probeStrength(Line** prevLine, Line **currLine, CompareFn comparer) {
   // Primary swamps secondary
   // have pairs where [0] 2> [1]
-  UChar primSwamps[][2] = {
+  char16_t primSwamps[][2] = {
     { 0x00E0, 0x0061 },
     { 0x0450, 0x0435 },
     { 0x31a3, 0x310d }
   };
   // Secondary swamps tertiary
   // have pairs where [0] 3> [1]
-  UChar secSwamps[][2] = {
+  char16_t secSwamps[][2] = {
     { 0x0053, 0x0073 },
     { 0x0415, 0x0435 },
     { 0x31b6, 0x310e }
   };
   // Secondary is swamped by primary
   // have pairs where [0] 1> [1]
-  UChar secSwamped[][2] = {
+  char16_t secSwamped[][2] = {
     { 0x0062, 0x0061 },
     { 0x0436, 0x0454 },
     { 0x310e, 0x310d }
   };
   // Tertiary is swamped by secondary
   // have pairs where [0] 2> [1]
-  UChar terSwamped[][2] = {
+  char16_t terSwamped[][2] = {
     { 0x00E0, 0x0061 },
     { 0x0450, 0x0435 },
     { 0x31a3, 0x310d }
@@ -699,7 +699,7 @@ positionExpansions(Line **gLines, int32_t size, CompareFn comparer) {
             // check for craziness such as s = ss/s
             // such line would consist of previous (or next) concatenated with the expansion value
             // make a test
-            UChar fullString[256];
+            char16_t fullString[256];
             u_strcpy(fullString, toMove->previous->name);
             u_strcat(fullString, toMove->expansionString);
             if(u_strcmp(fullString, toMove->name) == 0) {
@@ -711,7 +711,7 @@ positionExpansions(Line **gLines, int32_t size, CompareFn comparer) {
               u_fprintf(log, "\n");
             } 
           } else if(toMove->next->strength == UCOL_IDENTICAL) {
-            UChar fullString[256];
+            char16_t fullString[256];
             u_strcpy(fullString, toMove->next->name);
             u_strcat(fullString, toMove->expansionString);
             if(u_strcmp(fullString, toMove->name) == 0) {
@@ -1244,7 +1244,7 @@ constructAndAnalyze(Line **gLines, Line *lines, int32_t size, CompareFn comparer
 // Check whether upper case comes before lower case or vice-versa
 int32_t 
 checkCaseOrdering(void) {
-  UChar stuff[][3] = {
+  char16_t stuff[][3] = {
     { 0x0061, separatorChar, 0x0061}, //"aa",
     { 0x0061, separatorChar, 0x0041 }, //"a\\u00E0",
     { 0x0041, separatorChar, 0x0061 }, //"\\u00E0a",
@@ -1288,7 +1288,7 @@ checkCaseOrdering(void) {
 // Check whether the secondaries are in the straight or reversed order
 int32_t 
 checkSecondaryOrdering(void) {
-  UChar stuff[][5] = {
+  char16_t stuff[][5] = {
     { 0x0061, separatorChar, 0x0061, separatorChar, 0x00E0 }, //"aa",
     { 0x0061, separatorChar, 0x00E0, separatorChar, 0x0061 }, //"a\\u00E0",
     { 0x00E0, separatorChar, 0x0061, separatorChar, 0x0061 }, //"\\u00E0a",
@@ -1514,7 +1514,7 @@ void
 processCollator(UCollator *col, UErrorCode &status) {
   int32_t i = 0;
   gCol = col;
-  UChar ruleString[16384];
+  char16_t ruleString[16384];
   int32_t ruleStringLength = ucol_getRulesEx(gCol, UCOL_TAILORING_ONLY, ruleString, 16384);
   if(!gQuiet) {
     u_fprintf(out, "ICU rules:\n");
@@ -1677,8 +1677,8 @@ main(int argc,
 
   if(gRulesStdin) {
     char buffer[1024];
-    UChar ruleBuffer[16384];
-    UChar *rules = ruleBuffer;
+    char16_t ruleBuffer[16384];
+    char16_t *rules = ruleBuffer;
     int32_t maxRuleLen = 16384;
     int32_t rLen = 0;
     while(gets(buffer)) {
index ff08befa1e3da29fe39860900443aa2bd5813d4a..0f893e9e65f6887b53b9d611f813947371756502 100644 (file)
@@ -7,7 +7,7 @@
 #include "unicode/normlzr.h"
 
 typedef int (*CompareFn) (const void *elem1, const void *elem2);
-typedef int (*GetSortKeyFn) (const UChar *string, int32_t len, uint8_t *buffer, int32_t buffCapacity);
+typedef int (*GetSortKeyFn) (const char16_t *string, int32_t len, uint8_t *buffer, int32_t buffCapacity);
 //typedef int (__cdecl *CompareFn)(const void *elem1, const void *elem2);
 void generateRepertoire(const char *locale, UnicodeSet &rep, UBool &hanAppears, UErrorCode &status);
 UnicodeSet flatten(const UnicodeSet &source, UErrorCode &status);
index 27070d347366ba62a10c55ef4183f5ca30193d4a..d5360c904d857bd69890e4fbb2a6c2f10425819c 100644 (file)
@@ -96,7 +96,7 @@ int createDir(const char* dirName) {
 //  Stubs for Windows API functions when building on UNIXes.
 //
 typedef int DWORD;
-inline int CompareStringW(DWORD, DWORD, UChar *, int, UChar *, int) {return 0;};
+inline int CompareStringW(DWORD, DWORD, char16_t *, int, char16_t *, int) {return 0;};
 //#else
 //#error "Not POSIX or Windows. Won't work."
 #endif
@@ -118,7 +118,7 @@ int       gRefNum;
 UnicodeSet gExcludeSet;
 UnicodeSet gRepertoire;
 
-const UChar separatorChar = 0x0030;
+const char16_t separatorChar = 0x0030;
 
 UPrinter *logger;
 UPrinter *debug;
@@ -184,8 +184,8 @@ UOption options[]={
   /*18*/ UOPTION_DEF("output", 0, UOPT_REQUIRES_ARG)
 };
 
-UChar compA[256];
-UChar compB[256];
+char16_t compA[256];
+char16_t compB[256];
 int32_t compALen = 0;
 int32_t compBLen = 0;
 
@@ -208,7 +208,7 @@ int UNIXstrcmp(const void *a, const void *b) {
     return t;
 }
 
-int UNIXgetSortKey(const UChar *string, int32_t len, uint8_t *buffer, int32_t buffCapacity) {
+int UNIXgetSortKey(const char16_t *string, int32_t len, uint8_t *buffer, int32_t buffCapacity) {
   UErrorCode status = U_ZERO_ERROR;
   compALen = unorm_normalize(string, len, UNORM_NFC, 0, compA, 256, &status);
   compUTF8ALen = ucnv_fromUChars(utf8cnv, compUTF8A, 256, compA, compALen, &status);
@@ -237,7 +237,7 @@ int Winstrcmp(const void *a, const void *b) {
     return t-2;
 }
 
-int WingetSortKey(const UChar *string, int32_t len, uint8_t *buffer, int32_t buffCapacity) {
+int WingetSortKey(const char16_t *string, int32_t len, uint8_t *buffer, int32_t buffCapacity) {
   UErrorCode status = U_ZERO_ERROR;
   compALen = unorm_normalize(string, len, UNORM_NFC, 0, compA, 256, &status);
   return LCMapStringW(gWinLCID, LCMAP_SORTKEY | SORT_STRINGSORT, compA, compALen, (unsigned short *)buffer, buffCapacity);
@@ -263,7 +263,7 @@ int Winstrcmp(const void *a, const void *b) {
   if(a == b);
   return 0;
 }
-int WingetSortKey(const UChar *, int32_t , uint8_t *, int32_t ) {
+int WingetSortKey(const char16_t *, int32_t , uint8_t *, int32_t ) {
   return 0;
 }
 #endif
@@ -279,7 +279,7 @@ int ICUstrcmp(const void *a, const void *b) {
     return 0;
 }
 
-int ICUgetSortKey(const UChar *string, int32_t len, uint8_t *buffer, int32_t buffCapacity) {
+int ICUgetSortKey(const char16_t *string, int32_t len, uint8_t *buffer, int32_t buffCapacity) {
   return ucol_getSortKey(gCol, string, len, buffer, buffCapacity);
 }
 
@@ -439,7 +439,7 @@ void processArgs(int argc, char* argv[], UErrorCode &status)
 // Check whether upper case comes before lower case or vice-versa
 int32_t 
 checkCaseOrdering(void) {
-  UChar stuff[][3] = {
+  char16_t stuff[][3] = {
     { 0x0061, separatorChar, 0x0061}, //"aa",
     { 0x0061, separatorChar, 0x0041 }, //"a\\u00E0",
     { 0x0041, separatorChar, 0x0061 }, //"\\u00E0a",
@@ -626,7 +626,7 @@ processInteractive() {
   }
 }
 
-UChar probeChars[][4] = {
+char16_t probeChars[][4] = {
   { 0x0061, 0x0062, 0x00E1, 0x0041 }, // latin with a-grave
   { 0x0041, 0x0042, 0x00C1, 0x0061 }, // upper first
   { 0x006E, 0x006F, 0x00F1, 0x004E }, // latin with n-tilda
@@ -642,7 +642,7 @@ processCollator(UCollator *col, UErrorCode &status) {
   int32_t i = 0;
   uint32_t j = 0;
   gCol = col;
-  UChar ruleString[16384];
+  char16_t ruleString[16384];
   char myLoc[256];
 
   int32_t ruleStringLength = ucol_getRulesEx(gCol, UCOL_TAILORING_ONLY, ruleString, 16384);
@@ -844,8 +844,8 @@ main(int argc,
   } else {
     if(gRulesStdin) {
       char buffer[1024];
-      UChar ruleBuffer[16384];
-      UChar *rules = ruleBuffer;
+      char16_t ruleBuffer[16384];
+      char16_t *rules = ruleBuffer;
       int32_t maxRuleLen = 16384;
       int32_t rLen = 0;
       while(fgets(buffer, 1024, stdin)) {
@@ -1044,10 +1044,10 @@ void testWin(StrengthProbe &probe, UErrorCode &status)
 {
   UnicodeSet trailings(UnicodeString("[\\uFE7D\\uFE7C\\u30FD\\uFF70\\u30FC\\u309D\\u3032\\u3031\\u3005\\u0651]"), status);
   char intChar[] = "\\uFE7D\\uFE7C\\u30FD\\uFF70\\u30FC\\u309D\\u3032\\u3031\\u3005\\u0651";
-  UChar interesting[256];
+  char16_t interesting[256];
   int32_t intLen = u_unescape(intChar, interesting, 256);
-  UChar i = 0;
-  UChar j = 0,  k = 0;
+  char16_t i = 0;
+  char16_t j = 0,  k = 0;
   int32_t count;
   Line myCh, combo, trial, inter, kLine;
   for(i = 0; i < intLen; i++) {
index 82d512d37bcf4eb1dc2d7b458fba644470f7aa5e..e15c04fdd2610a1cfad7fee5a6dbe4ddf44154e3 100644 (file)
@@ -48,16 +48,16 @@ Line::init()
 Line::Line()
 {
   init();
-  memset(name, 0, 25*sizeof(UChar));
-  memset(expansionString, 0, 25*sizeof(UChar));
+  memset(name, 0, 25*sizeof(char16_t));
+  memset(expansionString, 0, 25*sizeof(char16_t));
 }
 
-Line::Line(const UChar* name, int32_t len)
+Line::Line(const char16_t* name, int32_t len)
 {
   init();
   this->len = len;
   u_memcpy(this->name, name, len);
-  memset(expansionString, 0, 25*sizeof(UChar));
+  memset(expansionString, 0, 25*sizeof(char16_t));
   UChar32 c;
   U16_GET(name, 0, 0, len, c);
   firstCC = u_getCombiningClass(c);
@@ -65,13 +65,13 @@ Line::Line(const UChar* name, int32_t len)
   lastCC = u_getCombiningClass(c);
 }
 
-Line::Line(const UChar name)
+Line::Line(const char16_t name)
 {
     init();
     len = 1;
     this->name[0] = name;
     this->name[1] = 0;
-  memset(expansionString, 0, 25*sizeof(UChar));
+  memset(expansionString, 0, 25*sizeof(char16_t));
   firstCC = u_getCombiningClass(name);
   lastCC = firstCC;
 }
@@ -178,7 +178,7 @@ Line::copyArray(Line *dest, const Line *src, int32_t size) {
 }
 
 void
-Line::setName(const UChar* name, int32_t len) {
+Line::setName(const char16_t* name, int32_t len) {
   this->len = len;
   u_memcpy(this->name, name, len);
   UChar32 c;
@@ -198,7 +198,7 @@ Line::setToConcat(const Line *first, const Line *second) {
 }
 
 UnicodeString
-Line::stringToName(UChar *string, int32_t len) {
+Line::stringToName(char16_t *string, int32_t len) {
   UErrorCode status = U_ZERO_ERROR;
   UnicodeString result;
   char buffer[256];
@@ -245,7 +245,7 @@ Line::toBundleString()
   if(!needsQuoting) {
     needsQuoting = new UnicodeSet("[[:whitespace:][:c:][:z:][[:ascii:]-[a-zA-Z0-9]]]", status);
   }
-  UChar NFC[50];
+  char16_t NFC[50];
   int32_t NFCLen = unorm_normalize(name, len, UNORM_NFC, 0, NFC, 50, &status);
   result.append("\"");
   if(isReset) {
@@ -292,7 +292,7 @@ Line::toHTMLString()
 {
   UnicodeString result;
   UErrorCode status = U_ZERO_ERROR;
-  UChar NFC[50];
+  char16_t NFC[50];
   int32_t NFCLen = unorm_normalize(name, len, UNORM_NFC, 0, NFC, 50, &status);
   result.append("<span title=\"");
   result.append(stringToName(NFC, NFCLen));
@@ -326,7 +326,7 @@ Line::toString(UBool pretty) {
     }
   } else {
     UErrorCode status = U_ZERO_ERROR;
-    UChar NFC[50];
+    char16_t NFC[50];
     int32_t NFCLen = unorm_normalize(name, len, UNORM_NFC, 0, NFC, 50, &status);
     result.setTo(NFC, NFCLen);
     if(expLen) {
@@ -475,7 +475,7 @@ Line::nextInteresting() {
 }
 
 void
-Line::append(const UChar* n, int32_t length) 
+Line::append(const char16_t* n, int32_t length)
 {
   u_strncat(name, n, length);
   name[len+length] = 0;
@@ -486,7 +486,7 @@ Line::append(const UChar* n, int32_t length)
 }
 
 void
-Line::append(const UChar n) 
+Line::append(const char16_t n)
 {
   name[len] = n;
   name[len+1] = 0;
@@ -512,9 +512,9 @@ int32_t
 Line::write(char *buff, int32_t, UErrorCode &) 
 {
   /*
-    UChar     name[25];
+    char16_t  name[25];
     int32_t   len;
-    UChar     expansionString[25];
+    char16_t  expansionString[25];
     int32_t   expLen;
 
     UColAttributeValue strength;
@@ -652,11 +652,11 @@ Line::initFromString(const char *buff, int32_t, UErrorCode &)
 }
 
 void
-Line::swapCase(UChar *string, int32_t &sLen)
+Line::swapCase(char16_t *string, int32_t &sLen)
 {
   UChar32 c = 0;
   int32_t i = 0, j = 0;
-  UChar buff[256];
+  char16_t buff[256];
   UBool isError = false;
   while(i < sLen) {
     U16_NEXT(string, i, sLen, c);
index f702c51c74bb764ef6bded100806a26914e8bafd..1f68159eb34c57fd04179e5f7d041ef9169e820b 100644 (file)
@@ -44,16 +44,16 @@ public:
   static void copyArray(Line *dest, const Line *src, int32_t size);
   Line();
   Line(const Line &other);
-  Line(const UChar* name, int32_t len);
+  Line(const char16_t* name, int32_t len);
   Line(const UnicodeString &string);
-  Line(const UChar name);
+  Line(const char16_t name);
   Line(const char *buff, int32_t buffLen, UErrorCode &status);
   ~Line();
   Line & operator=(const Line &other);
   UBool operator==(const Line &other) const;
   UBool operator!=(const Line &other) const;
   void setToConcat(const Line *first, const Line *second);
-  void setName(const UChar* name, int32_t len);
+  void setName(const char16_t* name, int32_t len);
   UnicodeString toString(UBool pretty = false);
   UnicodeString toBundleString();
   UnicodeString toHTMLString();
@@ -63,25 +63,25 @@ public:
 
   UnicodeString strengthIndent(UColAttributeValue strength, int indentSize, UnicodeString &result);
   UnicodeString strengthToString(UColAttributeValue strength, UBool pretty, UBool html = false);
-  UnicodeString stringToName(UChar *string, int32_t len);
+  UnicodeString stringToName(char16_t *string, int32_t len);
   void setTo(const UnicodeString &string);
   void setTo(const UChar32 n);
   UBool equals(const Line &other) const;
   Line *nextInteresting();
-  void append(const UChar n);
-  void append(const UChar* n, int32_t length);
+  void append(const char16_t n);
+  void append(const char16_t* n, int32_t length);
   void append(const Line &l);
   void clear();
   void swapCase();
-  void swapCase(UChar *string, int32_t &sLen);
+  void swapCase(char16_t *string, int32_t &sLen);
   UnicodeString dumpSortkey();
   void init();
 
   
 public:
-    UChar     name[25];
+    char16_t  name[25];
     int32_t   len;
-    UChar     expansionString[25];
+    char16_t  expansionString[25];
     int32_t   expLen;
 
     UColAttributeValue strength;
index 0fbd4291c2ba0753376924b46c32f747f93745b5..5420ace343220be06e34d5b788c78b14978be544 100644 (file)
@@ -14,7 +14,7 @@ int main(int argc,
   UConverter *conv = ucnv_open("utf8", &status);
 
   
-  UChar UBuffer[256];
+  char16_t UBuffer[256];
   int32_t uBufLen = 0;
   char buffer[256];
   int32_t bufLen = 0;
index b93d4c5676d9f5020d30a2be51939bce26c4f34c..d3ebd7f90fda81c381280a5dfb41aaeb3b612707 100644 (file)
@@ -79,7 +79,7 @@ SortedLines::getBounds(UErrorCode &status) {
   //u_strcpy(UB[strength], toSort[size-1]->name);
   // a different solution for bounds: go from end and see if the guys on the top
   // cause duplication for things
-  UChar dupch[] = { 0x0020, 0x0030, 0x0042, 0x0051, 0x0062, 0x0071, 0x0391, 0x0396, 0x03b1, 0x03b6 };
+  char16_t dupch[] = { 0x0020, 0x0030, 0x0042, 0x0051, 0x0062, 0x0071, 0x0391, 0x0396, 0x03b1, 0x03b6 };
   j = 1;
   Line dup;
   Line bound;
@@ -489,7 +489,7 @@ int32_t SortedLines::detectContractions(Line **firstRep, int32_t firstSize,
   int i = 0, j = 0, k = 0;
   Line lower, upper, trial, toAdd, helper;
   UChar32 firstStart, firstEnd, secondStart;
-  UChar NFCTrial[256];
+  char16_t NFCTrial[256];
   int32_t NFCTrialLen = 0;
   UBool thai;
   i = -1;
@@ -2002,8 +2002,8 @@ void
 SortedLines::removeDecompositionsFromRepertoire() {
   UnicodeSetIterator repertoireIter(repertoire);
   UErrorCode status = U_ZERO_ERROR;
-  UChar string[256];
-  UChar composed[256];
+  char16_t string[256];
+  char16_t composed[256];
   int32_t len = 0, compLen = 0;
   UnicodeString compString;
   UnicodeSet toRemove;
index 8010cc623b847dcf97ec100cb8ef2fb32b562f36..9ac48a9283e3060ebfe30f450a72b5a8d69fda8c 100644 (file)
@@ -26,8 +26,8 @@
 
 #include "strengthprobe.h"
 
-StrengthProbe::StrengthProbe(CompareFn comparer, GetSortKeyFn getter, UChar SE, 
-                             UChar B0, UChar B1, UChar B2, UChar B3) :
+StrengthProbe::StrengthProbe(CompareFn comparer, GetSortKeyFn getter, char16_t SE,
+                             char16_t B0, char16_t B1, char16_t B2, char16_t B3) :
 SE(SE),
 B0(B0), B1(B1), B2(B2), B3(B3),
 utilFirstP(&utilFirst), utilSecondP(&utilSecond),
@@ -37,7 +37,7 @@ comparer(comparer), skgetter(getter)
 }
 
 int
-StrengthProbe::setProbeChars(UChar B0, UChar B1, UChar B2, UChar B3)
+StrengthProbe::setProbeChars(char16_t B0, char16_t B1, char16_t B2, char16_t B3)
 {
   this->B0 = B0;
   this->B1 = B1;
@@ -97,7 +97,7 @@ StrengthProbe::checkSanity()
 }
 
 UBool 
-StrengthProbe::probePrefix(const Line &x, const Line &y, UChar first, UChar second) {
+StrengthProbe::probePrefix(const Line &x, const Line &y, char16_t first, char16_t second) {
   utilFirst.name[0] = first;
   utilFirst.name[1] = SE;
   u_strcpy(utilFirst.name+2, x.name);
@@ -118,7 +118,7 @@ StrengthProbe::probePrefix(const Line &x, const Line &y, UChar first, UChar seco
 }
 
 UBool 
-StrengthProbe::probeSuffix(const Line &x, const Line &y, UChar first, UChar second) {
+StrengthProbe::probeSuffix(const Line &x, const Line &y, char16_t first, char16_t second) {
   u_strcpy(utilFirst.name, x.name);
   utilFirst.name[x.len] = SE;
   utilFirst.name[x.len+1] = first;
@@ -138,7 +138,7 @@ StrengthProbe::probeSuffix(const Line &x, const Line &y, UChar first, UChar seco
 }
 
 UBool 
-StrengthProbe::probePrefixNoSep(const Line &x, const Line &y, UChar first, UChar second) {
+StrengthProbe::probePrefixNoSep(const Line &x, const Line &y, char16_t first, char16_t second) {
   utilFirst.name[0] = first;
   u_strcpy(utilFirst.name+1, x.name);
   utilFirst.name[x.len+1] = 0;
@@ -157,7 +157,7 @@ StrengthProbe::probePrefixNoSep(const Line &x, const Line &y, UChar first, UChar
 }
 
 UBool 
-StrengthProbe::probeSuffixNoSep(const Line &x, const Line &y, UChar first, UChar second) {
+StrengthProbe::probeSuffixNoSep(const Line &x, const Line &y, char16_t first, char16_t second) {
   u_strcpy(utilFirst.name, x.name);
   utilFirst.name[x.len] = first;
   utilFirst.name[x.len+1] = 0;
@@ -376,7 +376,7 @@ StrengthProbe::isFrenchSecondary(UErrorCode &status) {
 
 UBool
 StrengthProbe::isUpperFirst(UErrorCode &status) {
-  UChar i = 0;
+  char16_t i = 0;
   int32_t result = 0;
   int32_t upper = 0, lower = 0, equal = 0;
   for(i = 0x41; i < 0x5B; i++) {
index df5313667a1d3528637a9e9f0fa9b42bac0887bc..d8259328e5a760454c1e6ddb1c8915ae91e56fb7 100644 (file)
 
 class StrengthProbe {
 public:
-  UChar SE;
-  UChar B0;
-  UChar B1;
-  UChar B2;
-  UChar B3;
+  char16_t SE;
+  char16_t B0;
+  char16_t B1;
+  char16_t B2;
+  char16_t B3;
 private:
   Line utilFirst;
   Line utilSecond;
@@ -46,10 +46,10 @@ private:
   Line *utilSecondP;
   Line contractionUtilFirst;
   Line contractionUtilSecond;
-  UBool probePrefix(const Line &x, const Line &y, UChar first, UChar second);
-  UBool probeSuffix(const Line &x, const Line &y, UChar first, UChar second);
-  UBool probePrefixNoSep(const Line &x, const Line &y, UChar first, UChar second);
-  UBool probeSuffixNoSep(const Line &x, const Line &y, UChar first, UChar second);
+  UBool probePrefix(const Line &x, const Line &y, char16_t first, char16_t second);
+  UBool probeSuffix(const Line &x, const Line &y, char16_t first, char16_t second);
+  UBool probePrefixNoSep(const Line &x, const Line &y, char16_t first, char16_t second);
+  UBool probeSuffixNoSep(const Line &x, const Line &y, char16_t first, char16_t second);
 
   UBool frenchSecondary;
 
@@ -58,8 +58,8 @@ public:
   GetSortKeyFn skgetter;
   
   StrengthProbe() {};
-  StrengthProbe(CompareFn comparer, GetSortKeyFn getter, UChar SE = 0x0030, UChar B0 = 0x0061, UChar B1 = 0x0062, UChar B2 = 0x00E1, UChar B3 = 0x0041); //, UChar LB = 0x0039, UChar UB = 0xfa29);
-  int setProbeChars(UChar B0, UChar B1, UChar B2, UChar B3);
+  StrengthProbe(CompareFn comparer, GetSortKeyFn getter, char16_t SE = 0x0030, char16_t B0 = 0x0061, char16_t B1 = 0x0062, char16_t B2 = 0x00E1, char16_t B3 = 0x0041); //, char16_t LB = 0x0039, char16_t UB = 0xfa29);
+  int setProbeChars(char16_t B0, char16_t B1, char16_t B2, char16_t B3);
   int checkSanity();
   StrengthProbe(const StrengthProbe &that);
   StrengthProbe &operator=(const StrengthProbe &that);
@@ -76,7 +76,7 @@ public:
     return skgetter(l.name, l.len, buffer, buffCap);
   };
 
-  int getSortKey(UChar *string, int32_t sLen, uint8_t *buffer, int32_t buffCap) {
+  int getSortKey(char16_t *string, int32_t sLen, uint8_t *buffer, int32_t buffCap) {
     return skgetter(string, sLen, buffer, buffCap);
   };
  
index d95e25df06553558af0125692d7082cba4c9a41f..939ae6b38562dbb1a0273ea031916dca27e736ce 100644 (file)
@@ -58,7 +58,7 @@ UPrinter::log(const UnicodeString &string, UBool nl) {
 }
 
 void 
-UPrinter::log(const UChar *string, UBool nl) {
+UPrinter::log(const char16_t *string, UBool nl) {
   if(_on) {
     u_fprintf(out, "%S", string);
     if(nl) {
@@ -95,7 +95,7 @@ UPrinter::log(const Line *line, UBool nl) {
 
 void UPrinter::log(const char *fmt, ...)
 {
-    UChar buffer[4000];
+    char16_t buffer[4000];
     va_list ap;
 
     va_start(ap, fmt);
index 6c70b82001242bf2b065b6a0820e8a5960bc6b76..7aee902ba744efc47437b15a0cf95c730ecd8701 100644 (file)
@@ -29,7 +29,7 @@
 
 class UPrinter {
   UFILE *out;
-  UChar buffer[256];
+  char16_t buffer[256];
   UBool _on;
   char _locale[256];
 public:
@@ -37,7 +37,7 @@ public:
   UPrinter(const char *name, const char *locale, const char *encoding, UTransliterator *trans, UBool transliterateNonPrintable);
   ~UPrinter();
   void log(const UnicodeString &string, UBool nl = false);
-  void log(const UChar *string, UBool nl = false);
+  void log(const char16_t *string, UBool nl = false);
   //void log(const char *string, UBool nl = false);
   void log(const Line *line, UBool nl = false);
   void log(const char *fmt, ...);
index ef3b59c9ca7a1120a7b8ffa40bc999cb0bd55f43..60366dc6a0d8952808f7afdd431c680cb4ef5780 100644 (file)
@@ -24,7 +24,7 @@
 
 /* Print a ustring to the specified FILE* in the default codepage */
 U_CAPI void
-uprint(const UChar *s,
+uprint(const char16_t *s,
           FILE *f,
           UErrorCode *status)
 {
@@ -32,8 +32,8 @@ uprint(const UChar *s,
   UConverter *converter;
   char buf [BUF_SIZE];
   int32_t sourceLen;
-  const UChar *mySource;
-  const UChar *mySourceEnd;
+  const char16_t *mySource;
+  const char16_t *mySourceEnd;
   char *myTarget;
   int32_t arraySize;
 
index 1a70f763028f46b7161bb983f905861e7cc1f867..945836c945461bb1001f9e611a5dd37b81895978 100644 (file)
@@ -53,7 +53,7 @@ void usageAndDie(int retCode) {
 }
 
 /*U_CAPI void U_EXPORT2*/
-static void _versionFromUString(UVersionInfo versionArray, const UChar *versionString) {
+static void _versionFromUString(UVersionInfo versionArray, const char16_t *versionString) {
     if(versionArray==nullptr) {
         return;
     }
@@ -73,7 +73,7 @@ static void _getCLDRVersionDirect(UVersionInfo versionArray, UErrorCode *status)
 //        fprintf(stderr, "Err: could not open res_index, %s\n", u_errorName(status));
 //        fflush(stderr);
 //    } else {
-        const UChar *cldrver;
+        const char16_t *cldrver;
         int32_t len;
         cldrver = ures_getStringByKey(resindx, "cldrVersion", &len, status);
         if(!U_FAILURE(*status)) {
@@ -99,7 +99,7 @@ static void _getCLDRVersionOld(UVersionInfo versionArray, UErrorCode *status) {
 //        fprintf(stderr, "Err: could not open res_index, %s\n", u_errorName(status));
 //        fflush(stderr);
 //    } else {
-        const UChar *cldrver;
+        const char16_t *cldrver;
         int32_t len;
         cldrver = ures_getStringByKey(resindx, "CLDRVersion", &len, status);
         if(!U_FAILURE(*status)) {
@@ -219,17 +219,17 @@ UDateFormatSymbolType scanArray[] = {
 
 int *starts = nullptr;
 
-UChar ***rootdata = nullptr;
+char16_t ***rootdata = nullptr;
 
 void initroot(UErrorCode *status) {
   UDateFormat *fmt;
   fmt = udat_open(UDAT_DEFAULT, UDAT_DEFAULT, "root", nullptr, -1,nullptr,0, status);
-  rootdata = (UChar***)malloc((sizeof(scanArray)/sizeof(scanArray[0]))*sizeof(rootdata[0]));
+  rootdata = (char16_t***)malloc((sizeof(scanArray)/sizeof(scanArray[0]))*sizeof(rootdata[0]));
   starts = (int*)malloc((sizeof(scanArray)/sizeof(scanArray[0]))*sizeof(starts[0]));
   for(int i=0;U_SUCCESS(*status)&&i<sizeof(scanArray)/sizeof(scanArray[0]);i++) {
     int thisCount = udat_countSymbols(fmt, scanArray[i]);
     rootdata[i]=0;
-    rootdata[i]=(UChar**)malloc(thisCount*sizeof(rootdata[i][0]));
+    rootdata[i]=(char16_t**)malloc(thisCount*sizeof(rootdata[i][0]));
     switch(scanArray[i]) {
         case UDAT_WEEKDAYS:
         case UDAT_SHORT_WEEKDAYS:
@@ -239,7 +239,7 @@ void initroot(UErrorCode *status) {
             starts[i]=0;
     }
     for(int j=starts[i];U_SUCCESS(*status)&&j<thisCount;j++) {
-        rootdata[i][j]=(UChar*)malloc(1024);
+        rootdata[i][j]=(char16_t*)malloc(1024);
         int sz =  
         udat_getSymbols(fmt,
             scanArray[i],
@@ -253,16 +253,16 @@ void initroot(UErrorCode *status) {
 
 /* Format the date */
 static void
-date(const UChar *tz,
+date(const char16_t *tz,
      UDateFormatStyle style,
      char *format,
      const char *locale, char *comments,
      UErrorCode *status)
 {
-  UChar *s = 0;
+  char16_t *s = 0;
   int32_t len = 0;
   UDateFormat *fmt;
-  UChar uFormat[100];
+  char16_t uFormat[100];
   char tmp[200];
   
   int tc=0; // total count
@@ -277,7 +277,7 @@ date(const UChar *tz,
   len = udat_format(fmt, ucal_getNow(), 0, len, 0, status);
   if(*status == U_BUFFER_OVERFLOW_ERROR) {
     *status = U_ZERO_ERROR;
-    s = (UChar*) malloc(sizeof(UChar) * (len+1));
+    s = (char16_t*) malloc(sizeof(char16_t) * (len+1));
     if(s == 0) goto finish;
     udat_format(fmt, ucal_getNow(), s, len + 1, 0, status);
     if(U_FAILURE(*status)) goto finish;
@@ -289,7 +289,7 @@ date(const UChar *tz,
   /* print a trailing newline */
   //printf("\n");
   /* count bits */
-  UChar outbuf[1024];
+  char16_t outbuf[1024];
   for(int i=0;U_SUCCESS(*status)&&i<sizeof(scanArray)/sizeof(scanArray[0]);i++) {
     int thisCount = udat_countSymbols(fmt, scanArray[i]);
     tc += thisCount;
index 3bec20dfee7ea35f2d78eb1259b73e72ee555c43..cb10e0a860f14e9315f00c057581bc06a5987408 100644 (file)
@@ -17,7 +17,7 @@
 
 
 /* String to use. */
-const UChar stuff[] = { 0x30BB, 0x0d4c, 0x53, 0x74, 0x75, 0x66, 0x66, 0x00 }; /* Stuff */
+const char16_t stuff[] = { 0x30BB, 0x0d4c, 0x53, 0x74, 0x75, 0x66, 0x66, 0x00 }; /* Stuff */
 
 #include "provider_version.h"
 
index b728ffa2b43dec0a85f96cf8ac2e067fd4f5a2d1..248f50974b6918962054680e0601aa402953ce20 100644 (file)
@@ -57,7 +57,7 @@ int main(int /* argc*/ , const char * /*argv*/ []) {
     for(uint32_t s=0;s<sizeof(styles)/sizeof(styles[0]);s++) {
       for(int l=0;l<LOCALE_COUNT;l++) {
         printf("\n");
-        UChar oldChars[200];
+        char16_t oldChars[200];
         int32_t oldLen = -1;
         for(int v=0;v<=expected;v++) {
           
@@ -72,7 +72,7 @@ int main(int /* argc*/ , const char * /*argv*/ []) {
           printf("%18s : ", locID);
           
           UErrorCode subStatus = U_ZERO_ERROR;
-          UChar outchars[200];
+          char16_t outchars[200];
           
           UDateFormat *dat = udat_open(styles[s],styles[s], locID, nullptr, -1, nullptr, 0, &subStatus);
           
index 462ebc27464857021048e631345c16f050ebd2f0..b44de1fb4e9a44e7b6cf12052ab051301cb2f846 100644 (file)
@@ -125,9 +125,9 @@ Calendar* GLUE_SYM ( Calendar ) :: clone(void) const {
 // GLUE_SYM ( DateFormat ) :: create(UDateFormatStyle  timeStyle,
 //                                                     UDateFormatStyle  dateStyle,
 //                                                     const char        *locale,
-//                                                     const UChar       *tzID,
+//                                                     const char16_t    *tzID,
 //                                                     int32_t           tzIDLength,
-//                                                     const UChar       *pattern,
+//                                                     const char16_t    *pattern,
 //                                                     int32_t           patternLength,
 //                                                     UErrorCode        *status,
 //                                   const Locale &loc, const char */*ver*/) {
@@ -175,7 +175,7 @@ int32_t GLUE_SYM ( Calendar ) :: appendAvailable(UnicodeString* strs, int32_t i,
 #if CAL_FE_DEBUG
          { 
             char foo[999];
-            const UChar *ss = strs[i+j].getTerminatedBuffer();
+            const char16_t *ss = strs[i+j].getTerminatedBuffer();
             u_austrcpy(foo, ss);
             fprintf(stderr,  "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo);
         }
@@ -213,9 +213,9 @@ public:
   // virtual Calendar *createFormat(UCalendarStyle  timeStyle,
   //                                  UCalendarStyle  dateStyle,
   //                                  const char        *locale,
-  //                                  const UChar       *tzID,
+  //                                  const char16_t    *tzID,
   //                                  int32_t           tzIDLength,
-  //                                  const UChar       *pattern,
+  //                                  const char16_t    *pattern,
   //                                  int32_t           patternLength,
   //                                  UErrorCode        *status);
   virtual void* getDynamicClassID() const; 
index a29259c699ce19145acf7c392ac556b71a3aea6b..5fad0e3de1ae3c977a4c5c7286b52b1beee1d984 100644 (file)
@@ -57,9 +57,9 @@
     virtual Collator* clone() const;                                    \
     virtual UCollationResult compare(const UnicodeString&, const UnicodeString&, UErrorCode&) const; \
     virtual UCollationResult compare(const UnicodeString&, const UnicodeString&, int32_t, UErrorCode&) const; \
-    virtual UCollationResult compare(const UChar*, int32_t, const UChar*, int32_t, UErrorCode&) const; \
+    virtual UCollationResult compare(const char16_t*, int32_t, const char16_t*, int32_t, UErrorCode&) const; \
     virtual CollationKey& getCollationKey(const UnicodeString&, CollationKey&, UErrorCode&) const; \
-    virtual CollationKey& getCollationKey(const UChar*, int32_t, CollationKey&, UErrorCode&) const; \
+    virtual CollationKey& getCollationKey(const char16_t*, int32_t, CollationKey&, UErrorCode&) const; \
     virtual int32_t hashCode() const;                                   \
     virtual CONST_BEFORE_50_0_2 Locale getLocale(ULocDataLocaleType, UErrorCode&) const; \
     virtual ECollationStrength getStrength() const;                     \
     virtual void getVersion(uint8_t*) const;                            \
     virtual void setAttribute(UColAttribute, UColAttributeValue, UErrorCode&) ; \
     virtual UColAttributeValue getAttribute(UColAttribute, UErrorCode&) CONST_AFTER_50_0_2; \
-    virtual uint32_t setVariableTop(const UChar*, int32_t, UErrorCode&); \
+    virtual uint32_t setVariableTop(const char16_t*, int32_t, UErrorCode&); \
     virtual uint32_t setVariableTop(const UnicodeString REF_AFTER_50_0_2, UErrorCode&);        \
     virtual void setVariableTop(uint32_t, UErrorCode&);                 \
     virtual uint32_t getVariableTop(UErrorCode&) const;                 \
     virtual Collator* safeClone() CONST_AFTER_50_0_2 ;                                      \
     virtual int32_t getSortKey(const UnicodeString&, uint8_t*, int32_t) const; \
-    virtual int32_t getSortKey(const UChar*, int32_t, uint8_t*, int32_t) const; \
+    virtual int32_t getSortKey(const char16_t*, int32_t, uint8_t*, int32_t) const; \
   public: static int32_t countAvailable();                              \
   public: static int32_t appendAvailable(UnicodeString* strs, int32_t i, int32_t count); \
   public: virtual int32_t internalGetShortDefinitionString(const char *locale, char *buffer, int32_t capacity, UErrorCode &status) const; \
@@ -142,7 +142,7 @@ GLUE_SYM ( Collator ) :: ~ GLUE_SYM(Collator) () {
 #if 0
 U_CFUNC int32_t U_CALLCONV
 GLUE_SYM ( glue_calcSortKey) (const    UCollator    *coll,
-        const    UChar        *source,
+        const    char16_t     *source,
         int32_t        sourceLength,
         uint8_t        **result,
         uint32_t        resultLength,
@@ -203,7 +203,7 @@ UCollationResult GLUE_SYM ( Collator ) :: compare(const UnicodeString&, const Un
 }
 
 
-UCollationResult GLUE_SYM ( Collator ) :: compare(const UChar* s, int32_t sl, const UChar* d , int32_t dl, UErrorCode&/*e*/ ) const  {
+UCollationResult GLUE_SYM ( Collator ) :: compare(const char16_t* s, int32_t sl, const char16_t* d , int32_t dl, UErrorCode&/*e*/ ) const  {
     return OICU_ucol_strcoll(_this, s, sl, d, dl);
 }
 
@@ -219,7 +219,7 @@ return kk;
 }
 
 
-CollationKey& GLUE_SYM ( Collator ) :: getCollationKey(const UChar*, int32_t, CollationKey&, UErrorCode&) const  {
+CollationKey& GLUE_SYM ( Collator ) :: getCollationKey(const char16_t*, int32_t, CollationKey&, UErrorCode&) const  {
     fprintf(stderr,  "VCF " ICUGLUE_VER_STR " GKK2 - notimp");
 return kk;
 }
@@ -259,7 +259,7 @@ return (UColAttributeValue)0;
 }
 
 
-uint32_t GLUE_SYM ( Collator ) :: setVariableTop(const UChar*, int32_t, UErrorCode&)  {
+uint32_t GLUE_SYM ( Collator ) :: setVariableTop(const char16_t*, int32_t, UErrorCode&)  {
 return 0;
 }
 
@@ -293,7 +293,7 @@ int32_t GLUE_SYM ( Collator ) :: getSortKey(const UnicodeString& s, uint8_t*buf,
 
 
 
-int32_t GLUE_SYM ( Collator ) :: getSortKey(const UChar*s, int32_t l, uint8_t*d, int32_t b) const  {
+int32_t GLUE_SYM ( Collator ) :: getSortKey(const char16_t*s, int32_t l, uint8_t*d, int32_t b) const  {
 #if COLL_FE_DEBUG
     fprintf(stderr,  "VCF " ICUGLUE_VER_STR " GKS");
 #endif
@@ -352,7 +352,7 @@ int32_t GLUE_SYM ( Collator ) :: appendAvailable(UnicodeString* strs, int32_t i,
 #if COLL_FE_DEBUG
          { 
             char foo[999];
-            const UChar *ss = strs[i+j].getTerminatedBuffer();
+            const char16_t *ss = strs[i+j].getTerminatedBuffer();
             u_austrcpy(foo, ss);
             debugfprintf((stderr,  "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo));
         }
index 3ea1a85f24713097de23a5f36a23df4b129d532f..d2bfd16b099d3329db482c16c83009d3c45ca0f3 100644 (file)
@@ -36,9 +36,9 @@
   public:  static DateFormat *create(UDateFormatStyle  timeStyle, \
                                                     UDateFormatStyle  dateStyle, \
                                                     const char        *locale, \
-                                                    const UChar       *tzID, \
+                                                    const char16_t    *tzID, \
                                                     int32_t           tzIDLength, \
-                                                    const UChar       *pattern,  \
+                                                    const char16_t    *pattern,  \
                                                     int32_t           patternLength,  \
                                                       UErrorCode        *status, const Locale &loc, const char *ver); \
   private: UDateFormat *_this; GLUE_SYM_V( DateFormat, x ) ( UDateFormat* tn ); \
@@ -87,9 +87,9 @@ DateFormat *
 GLUE_SYM ( DateFormat ) :: create(UDateFormatStyle  timeStyle,
                                                     UDateFormatStyle  dateStyle,
                                                     const char        *locale,
-                                                    const UChar       *tzID,
+                                                    const char16_t    *tzID,
                                                     int32_t           tzIDLength,
-                                                    const UChar       *pattern,
+                                                    const char16_t    *pattern,
                                                     int32_t           patternLength,
                                                     UErrorCode        *status,
                                   const Locale &loc, const char */*ver*/) {
@@ -117,7 +117,7 @@ UnicodeString& GLUE_SYM (DateFormat ) :: format(  Calendar& cal, UnicodeString&
 #endif
   int32_t len = appendTo.length();
 
-  UChar junk[200];
+  char16_t junk[200];
   UErrorCode status = U_ZERO_ERROR;
 
   UFieldPosition pos2;
@@ -170,7 +170,7 @@ int32_t GLUE_SYM ( DateFormat ) :: appendAvailable(UnicodeString* strs, int32_t
 #if DATE_FE_DEBUG
          { 
             char foo[999];
-            const UChar *ss = strs[i+j].getTerminatedBuffer();
+            const char16_t *ss = strs[i+j].getTerminatedBuffer();
             u_austrcpy(foo, ss);
             //            fprintf(stderr,  "VCF " ICUGLUE_VER_STR " appending [%d+%d=%d] <<%s>>\n", i, j, i+j, foo);
         }
@@ -204,9 +204,9 @@ public:
   virtual DateFormat *createFormat(UDateFormatStyle  timeStyle,
                                    UDateFormatStyle  dateStyle,
                                    const char        *locale,
-                                   const UChar       *tzID,
+                                   const char16_t    *tzID,
                                    int32_t           tzIDLength,
-                                   const UChar       *pattern,
+                                   const char16_t    *pattern,
                                    int32_t           patternLength,
                                    UErrorCode        *status);
   virtual const UnicodeString *getSupportedIDs(int32_t &count, UErrorCode &status);
@@ -219,9 +219,9 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION( VersionDateFormatFactory )
 DateFormat *VersionDateFormatFactory::createFormat(UDateFormatStyle  timeStyle,
                                                     UDateFormatStyle  dateStyle,
                                                     const char        *locale,
-                                                    const UChar       *tzID,
+                                                    const char16_t    *tzID,
                                                     int32_t           tzIDLength,
-                                                    const UChar       *pattern,
+                                                    const char16_t    *pattern,
                                                     int32_t           patternLength,
                                                        UErrorCode        *status) {
     Locale loc(locale);
@@ -312,9 +312,9 @@ static VersionDateFormatFactory vdf;
 extern "C" UDateFormat *versionDateFormatOpener(UDateFormatStyle  timeStyle,
                                                     UDateFormatStyle  dateStyle,
                                                     const char        *locale,
-                                                    const UChar       *tzID,
+                                                    const char16_t    *tzID,
                                                     int32_t           tzIDLength,
-                                                    const UChar       *pattern,
+                                                    const char16_t    *pattern,
                                                     int32_t           patternLength,
                                                        UErrorCode        *status) {
   DateFormat *df = vdf.createFormat(timeStyle,dateStyle,locale,tzID,tzIDLength,pattern,patternLength,status);
index 16f0de318877d14029dfac161a8308435b7dc642..b6562d5e6411d97f75a167e1e6085dfcdf597876 100644 (file)
@@ -93,7 +93,7 @@ The file contains the following structures:
 
     const uint16_t exceptions[exceptionsLength];
 
-    const UChar unfold[unfoldLength];
+    const char16_t unfold[unfoldLength];
 
 
 Trie data word:
@@ -328,8 +328,8 @@ CasePropsBuilder::CasePropsBuilder(UErrorCode &errorCode)
     // Write "unfold" meta data into the first row. Must be UGENCASE_UNFOLD_WIDTH UChars.
     unfold.
         append(0).
-        append((UChar)UGENCASE_UNFOLD_WIDTH).
-        append((UChar)UGENCASE_UNFOLD_STRING_WIDTH).
+        append((char16_t)UGENCASE_UNFOLD_WIDTH).
+        append((char16_t)UGENCASE_UNFOLD_STRING_WIDTH).
         append(0).
         append(0);
     U_ASSERT(unfold.length()==UGENCASE_UNFOLD_WIDTH);
@@ -620,20 +620,20 @@ CasePropsBuilder::makeExcProps(UChar32 c, uint32_t value, UErrorCode &errorCode)
 
 static int32_t U_CALLCONV
 compareUnfold(const void *context, const void *left, const void *right) {
-    return u_memcmp((const UChar *)left, (const UChar *)right, UGENCASE_UNFOLD_WIDTH);
+    return u_memcmp((const char16_t *)left, (const char16_t *)right, UGENCASE_UNFOLD_WIDTH);
 }
 
 void
 CasePropsBuilder::makeUnfoldData(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) { return; }
 
-    UChar *p, *q;
+    char16_t *p, *q;
     int32_t i, j, k;
 
     /* sort the data */
     int32_t unfoldLength=unfold.length();
     int32_t unfoldRows=unfoldLength/UGENCASE_UNFOLD_WIDTH-1;
-    UChar *unfoldBuffer=unfold.getBuffer(-1);
+    char16_t *unfoldBuffer=unfold.getBuffer(-1);
     uprv_sortArray(unfoldBuffer+UGENCASE_UNFOLD_WIDTH, unfoldRows, UGENCASE_UNFOLD_WIDTH*2,
                    compareUnfold, nullptr, false, &errorCode);
 
@@ -666,7 +666,7 @@ CasePropsBuilder::makeUnfoldData(UErrorCode &errorCode) {
         }
     }
 
-    unfoldBuffer[UCASE_UNFOLD_ROWS]=(UChar)unfoldRows;
+    unfoldBuffer[UCASE_UNFOLD_ROWS]=(char16_t)unfoldRows;
 
     if(beVerbose) {
         puts("unfold data:");
@@ -859,7 +859,7 @@ CasePropsBuilder::makeCaseClosure(UErrorCode &errorCode) {
     /* use the "unfold" data to add mappings */
 
     /* p always points to the code points; this loop ignores the strings completely */
-    const UChar *p=unfold.getBuffer()+UGENCASE_UNFOLD_WIDTH+UGENCASE_UNFOLD_STRING_WIDTH;
+    const char16_t *p=unfold.getBuffer()+UGENCASE_UNFOLD_WIDTH+UGENCASE_UNFOLD_STRING_WIDTH;
     int32_t unfoldRows=unfold.length()/UGENCASE_UNFOLD_WIDTH-1;
 
     for(int32_t i=0; i<unfoldRows; p+=UGENCASE_UNFOLD_WIDTH, ++i) {
@@ -917,7 +917,7 @@ CasePropsBuilder::makeException(UChar32 c, uint32_t value, ExcProps &ep, UErrorC
     }
 
     /* copy and shift the soft-dotted and case-sensitive bits */
-    UChar excWord=(UChar)((value&(UCASE_DOT_MASK|UCASE_SENSITIVE))<<UCASE_EXC_DOT_SHIFT);
+    char16_t excWord=(char16_t)((value&(UCASE_DOT_MASK|UCASE_SENSITIVE))<<UCASE_EXC_DOT_SHIFT);
 
     UniProps &p=ep.props;
 
@@ -1035,28 +1035,28 @@ CasePropsBuilder::makeException(UChar32 c, uint32_t value, ExcProps &ep, UErrorC
 
     if(count==0) {
         /* No optional slots: Try to share excWord entries. */
-        int32_t excIndex=exceptions.indexOf((UChar)excWord);
+        int32_t excIndex=exceptions.indexOf((char16_t)excWord);
         if(excIndex>=0) {
             return excIndex;
         }
         /* not found */
         excIndex=exceptions.length();
-        exceptions.append((UChar)excWord);
+        exceptions.append((char16_t)excWord);
         return excIndex;
     } else {
         /* write slots */
         UnicodeString excString;
-        excString.append((UChar)0);  /* placeholder for excWord which will be stored at excIndex */
+        excString.append((char16_t)0);  /* placeholder for excWord which will be stored at excIndex */
 
         if(slotBits<=0xffff) {
             for(int32_t i=0; i<count; ++i) {
-                excString.append((UChar)slots[i]);
+                excString.append((char16_t)slots[i]);
             }
         } else {
             excWord|=UCASE_EXC_DOUBLE_SLOTS;
             for(int32_t i=0; i<count; ++i) {
-                excString.append((UChar)(slots[i]>>16));
-                excString.append((UChar)slots[i]);
+                excString.append((char16_t)(slots[i]>>16));
+                excString.append((char16_t)slots[i]);
             }
         }
 
@@ -1070,7 +1070,7 @@ CasePropsBuilder::makeException(UChar32 c, uint32_t value, ExcProps &ep, UErrorC
         excString.append(closureString);
 
         /* write the main exceptions word */
-        excString.setCharAt(0, (UChar)excWord);
+        excString.setCharAt(0, (char16_t)excWord);
 
         // Try to share data.
         if(count==1 && ep.delta!=0) {
index 9acdf340333c8f2528c611799abd3e4feef64b92..0b29391cfc0835c1efcc9475b0cda779b80ec167 100644 (file)
@@ -95,7 +95,7 @@ Formally, the file contains the following structures:
 
     P  const uint32_t props32[i1-i0];
     E  const uint32_t exceptions[i2-i1];
-    U  const UChar uchars[2*(i3-i2)];
+    U  const char16_t uchars[2*(i3-i2)];
 
     AT serialized trie for additional properties (byte size: 4*(i4-i3))
     PV const uint32_t propsVectors[(i6-i4)/i5][i5]==uint32_t propsVectors[i6-i4];
@@ -729,11 +729,11 @@ CorePropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues,
     ) {
         UnicodeString codes;  // vector of 16-bit UScriptCode values
         UnicodeSetIterator iter(props.scx);
-        while(iter.next()) { codes.append((UChar)iter.getCodepoint()); }
+        while(iter.next()) { codes.append((char16_t)iter.getCodepoint()); }
 
         // Set bit 15 on the last script code, for termination.
         int32_t length=codes.length();
-        codes.setCharAt(length-1, (UChar)(codes[length-1]|0x8000));
+        codes.setCharAt(length-1, (char16_t)(codes[length-1]|0x8000));
         // Find this list of codes in the Script_Extensions data so far, or add this list.
         int32_t index=scriptExtensions.indexOf(codes);
         if(index<0) {
@@ -752,7 +752,7 @@ CorePropsBuilder::setProps(const UniProps &props, const UnicodeSet &newValues,
             // Store an additional pair of 16-bit units for an unusual main Script code
             // together with the Script_Extensions index.
             UnicodeString codeIndexPair;
-            codeIndexPair.append((UChar)script).append((UChar)index);
+            codeIndexPair.append((char16_t)script).append((char16_t)index);
             index=scriptExtensions.indexOf(codeIndexPair);
             if(index<0) {
                 index=scriptExtensions.length();
@@ -831,7 +831,7 @@ CorePropsBuilder::build(UErrorCode &errorCode) {
 
     /* round up scriptExtensions to multiple of 4 bytes */
     if(scriptExtensions.length()&1) {
-        scriptExtensions.append((UChar)0);
+        scriptExtensions.append((char16_t)0);
     }
 
     /* set indexes */
index 750602176644c1239da19a4e0f4f30898f030eda..44cb8ff9d3b0d85ec3b5492d47fc2faa54c61fc9 100644 (file)
@@ -353,7 +353,7 @@ void EmojiPropsBuilder::parsePropsOfStringsLine(char *fields[][2], UErrorCode &e
         // 23F0          ; Basic_Emoji                  ; alarm clock
         // 23F1 FE0F     ; Basic_Emoji                  ; stopwatch
         uint32_t first;
-        UChar s[100];
+        char16_t s[100];
         int32_t length = u_parseString(rangeOrString, s, UPRV_LENGTHOF(s), &first, &errorCode);
         if (U_FAILURE(errorCode)) { return; }
         if (length == 0) {
index 883aea363049b0a330cbc66e8f2cc546f85a73ff..25e2e3f346fff1aca918265d630d3deda27de9f2 100644 (file)
@@ -155,7 +155,7 @@ static UDataInfo dataInfo={
 
     U_IS_BIG_ENDIAN,
     U_CHARSET_FAMILY,
-    sizeof(UChar),
+    sizeof(char16_t),
     0,
 
     {0x75, 0x6e, 0x61, 0x6d},     /* dataFormat="unam" */
index 54313eef27adca1dbab52742a986e9017842a39e..9f215d476da0dc7eea722a28030cca5db2e5eca4 100644 (file)
@@ -453,7 +453,7 @@ static const UDataInfo dataInfo = {
 
     U_IS_BIG_ENDIAN,
     U_CHARSET_FAMILY,
-    sizeof(UChar),
+    sizeof(char16_t),
     0,
 
     { PNAME_SIG_0, PNAME_SIG_1, PNAME_SIG_2, PNAME_SIG_3 },
index 099807262415f4ead15aa49fc8ef0deff48c9ec9..0f55c420d7bed23d036e844cd374d84983d79fc6 100644 (file)
@@ -129,7 +129,7 @@ int main() {
     }
     std::cout << "0};\n\n";
 
-    std::cout << "    static const UChar RECaseFixData[] = {";
+    std::cout << "    static const char16_t RECaseFixData[] = {";
     for (int i=0; i<outString.length(); i++) {
         if (i % 10 == 0) {
             std::cout << "\n        ";
index 302c5324113d74c12b77e8aa422f3031830a4028..e84414af2dd3c029e5e4766b422fe3b2788e9466 100644 (file)
@@ -138,8 +138,8 @@ CollationBaseDataBuilder::init(UErrorCode &errorCode) {
 
     // Add a mapping for the first-unassigned boundary,
     // which is the AlphabeticIndex overflow boundary.
-    UnicodeString s((UChar)0xfdd1);  // Script boundary contractions start with U+FDD1.
-    s.append((UChar)0xfdd0);  // Zzzz script sample character U+FDD0.
+    UnicodeString s((char16_t)0xfdd1);  // Script boundary contractions start with U+FDD1.
+    s.append((char16_t)0xfdd0);  // Zzzz script sample character U+FDD0.
     int64_t ce = Collation::makeCE(Collation::FIRST_UNASSIGNED_PRIMARY);
     add(UnicodeString(), s, &ce, 1, errorCode);
 
index 1f08eba66411456f6a7faf549f3499dc6a21a3b7..02bb556d1691fae275af2b04b350f8b0522d9acd 100644 (file)
@@ -718,7 +718,7 @@ readAnElement(char *line,
     if (pipePointer != nullptr) {
         // Read the prefix string which precedes the actual string.
         input.append(startCodePoint, (int32_t)(pipePointer - startCodePoint), *status);
-        UChar *prefixChars = prefix.getBuffer(32);
+        char16_t *prefixChars = prefix.getBuffer(32);
         int32_t prefixSize =
             u_parseString(input.data(),
                           prefixChars, prefix.getCapacity(),
@@ -737,7 +737,7 @@ readAnElement(char *line,
 
     // Read the string which gets the CE(s) assigned.
     input.append(startCodePoint, (int32_t)(endCodePoint - startCodePoint), *status);
-    UChar *uchars = s.getBuffer(32);
+    char16_t *uchars = s.getBuffer(32);
     int32_t cSize =
         u_parseString(input.data(),
                       uchars, s.getCapacity(),
@@ -1183,7 +1183,7 @@ buildAndWriteBaseData(CollationBaseDataBuilder &builder,
 static void
 setLeadSurrogatesForAssociatedSupplementary(UnicodeSet &bmp, const UnicodeSet &supp) {
     UChar32 c = 0x10000;
-    for(UChar lead = 0xd800; lead < 0xdc00; ++lead, c += 0x400) {
+    for(char16_t lead = 0xd800; lead < 0xdc00; ++lead, c += 0x400) {
         if(supp.containsSome(c, c + 0x3ff)) {
             bmp.add(lead);
         }
index aa3324b4b585b798607e9d27cde922987fd87213..f6fdc2a40daa56f154bb406cb512e40f97ddc520 100644 (file)
@@ -58,10 +58,10 @@ void ExitingErrorCode::handleFailure() const {
 
 static int
 toIDNA2003(const UStringPrepProfile *prep, UChar32 c, icu::UnicodeString &destString) {
-    UChar src[2];
+    char16_t src[2];
     int32_t srcLength=0;
     U16_APPEND_UNSAFE(src, srcLength, c);
-    UChar *dest;
+    char16_t *dest;
     int32_t destLength;
     dest=destString.getBuffer(32);
     if(dest==nullptr) {
@@ -100,7 +100,7 @@ printLine(UChar32 start, UChar32 end, Status status, const icu::UnicodeString &m
     printf("; %s", statusNames[status]);
     if(status==MAPPED || status==DEVIATION || !mapping.isEmpty()) {
         printf(" ;");
-        const UChar *buffer=mapping.getBuffer();
+        const char16_t *buffer=mapping.getBuffer();
         int32_t length=mapping.length();
         int32_t i=0;
         UChar32 c;